[Kita-svn] [2363] replace double quotes with single quotes for efficiency

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2009年 7月 5日 (日) 13:37:30 JST


Revision: 2363
          http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2363
Author:   nogu
Date:     2009-07-05 13:37:30 +0900 (Sun, 05 Jul 2009)

Log Message:
-----------
replace double quotes with single quotes for efficiency

Modified Paths:
--------------
    kita/branches/KITA-KDE4/kita/src/bbsview.cpp
    kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp
    kita/branches/KITA-KDE4/kita/src/boardview.cpp
    kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp
    kita/branches/KITA-KDE4/kita/src/htmlpart.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/access.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp
    kita/branches/KITA-KDE4/kita/src/threadview.cpp
    kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp

Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/bbsview.cpp	2009-07-05 03:51:51 UTC (rev 2362)
+++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp	2009-07-05 04:37:30 UTC (rev 2363)
@@ -168,10 +168,10 @@
                       true /* test only */
                                                      );
             if ( ret == Kita::Board_enrollNew ) {
-                newBoards += boardName + "  ( " + category.category_name + " )  " + boardURL + "\n";
+                newBoards += boardName + "  ( " + category.category_name + " )  " + boardURL + '\n';
             }
             if ( ret == Kita::Board_enrollMoved ) {
-                oldBoards += boardName + "  ( " + category.category_name + " )  " + oldURL + "  ->  " + boardURL + "\n";
+                oldBoards += boardName + "  ( " + category.category_name + " )  " + oldURL + "  ->  " + boardURL + '\n';
             }
             count++;
             oldURLs += oldURL;
@@ -184,7 +184,7 @@
     /* show new board names */
     if ( newBoards != QString::null && newBoards.count( "\n" ) < maxNewBoard ) {
 
-        QStringList boardList = newBoards.split( "\n" );
+        QStringList boardList = newBoards.split( '\n' );
         KMessageBox::informationList( this,
                                       i18n( "New boards:\n\n" ),
                                       boardList, "Kita" );
@@ -193,7 +193,7 @@
     /* show moved board names */
     if ( oldBoards != QString::null ) {
 
-        QStringList boardList = oldBoards.split( "\n" );
+        QStringList boardList = oldBoards.split( '\n' );
         KMessageBox::informationList( this,
                                       i18n( "These boards were moved:\n\n" )
                                       + i18n( "\nPlease create the backup of those caches.\n" ),
@@ -213,7 +213,7 @@
 
         int ret;
         while ( ( ret = mb.exec() ) == QMessageBox::No ) {
-            QString str = i18n( "New boards:\n\n" ) + newBoards + "\n"
+            QString str = i18n( "New boards:\n\n" ) + newBoards + '\n'
                           + i18n( "These boards were moved:\n\n" ) + oldBoards;
             QApplication::clipboard() ->setText( str , QClipboard::Clipboard );
             QApplication::clipboard() ->setText( str , QClipboard::Selection );
@@ -274,7 +274,7 @@
         stream.setCodec( "UTF-8" );
 
         stream << "Date: " << now.toString( "yyyy/MM/dd hh:mm:ss" ) << endl;
-        stream << i18n( "New boards:\n\n" ) + newBoards + "\n";
+        stream << i18n( "New boards:\n\n" ) + newBoards + '\n';
         stream << i18n( "These boards were moved:\n\n" ) + oldBoards;
         stream << "----------------------------------------" << endl;
         logfile.close();
@@ -403,7 +403,7 @@
 {
     Q3ValueList<Kita::Category> result;
 
-    QStringList lines = html.split( "\n" );
+    QStringList lines = html.split( '\n' );
     QStringList::iterator it;
 
     Kita::Category current_category;
@@ -536,8 +536,8 @@
         clipboard->setText( boardURL_upToDate.prettyUrl(), QClipboard::Clipboard );
         clipboard->setText( boardURL_upToDate.prettyUrl(), QClipboard::Selection );
     } else if ( action == copyTitleAndURLAct ) {
-        clipboard->setText( boardName + "\n" + boardURL_upToDate.prettyUrl(), QClipboard::Clipboard );
-        clipboard->setText( boardName + "\n" + boardURL_upToDate.prettyUrl(), QClipboard::Selection );
+        clipboard->setText( boardName + '\n' + boardURL_upToDate.prettyUrl(), QClipboard::Clipboard );
+        clipboard->setText( boardName + '\n' + boardURL_upToDate.prettyUrl(), QClipboard::Selection );
     } else if ( action == addToFavoritesAct ) {
         Kita::FavoriteBoards::append( boardURL_upToDate );
     } else if ( action == removeFromFavoritesAct ) {

Modified: kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp	2009-07-05 03:51:51 UTC (rev 2362)
+++ kita/branches/KITA-KDE4/kita/src/boardtabwidget.cpp	2009-07-05 04:37:30 UTC (rev 2363)
@@ -239,7 +239,7 @@
     } else if ( action == openBrowserAct ) {
         KRun::runUrl( subjectView->boardURL(), "text/html", this );
     } else if ( action == copyTitleAct ) {
-        QString cliptxt = Kita::BoardManager::boardName( subjectView->boardURL() ) + "\n" + subjectView->boardURL().prettyUrl();
+        QString cliptxt = Kita::BoardManager::boardName( subjectView->boardURL() ) + '\n' + subjectView->boardURL().prettyUrl();
         clipboard->setText( cliptxt , QClipboard::Clipboard );
         clipboard->setText( cliptxt , QClipboard::Selection );
     }

Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/boardview.cpp	2009-07-05 03:51:51 UTC (rev 2362)
+++ kita/branches/KITA-KDE4/kita/src/boardview.cpp	2009-07-05 04:37:30 UTC (rev 2363)
@@ -381,7 +381,7 @@
         clipboard->setText( threadURL, QClipboard::Clipboard );
         clipboard->setText( threadURL, QClipboard::Selection );
     } else if ( action == copyTitleAndURLAct ) {
-        cliptxt = Kita::DatManager::threadName( datURL ) + "\n" + threadURL;
+        cliptxt = Kita::DatManager::threadName( datURL ) + '\n' + threadURL;
         clipboard->setText( cliptxt , QClipboard::Clipboard );
         clipboard->setText( cliptxt , QClipboard::Selection );
     } else if ( action == favoritesAct ) {

Modified: kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp	2009-07-05 03:51:51 UTC (rev 2362)
+++ kita/branches/KITA-KDE4/kita/src/favoritelistview.cpp	2009-07-05 04:37:30 UTC (rev 2363)
@@ -148,7 +148,7 @@
     } else if ( action == copyURLAct ) {
         clipboard->setText( threadURL );
     } else if ( action == copyTitleAndURLAct ) {
-        clipText = Kita::DatManager::threadName( datURL ) + "\n" + threadURL;
+        clipText = Kita::DatManager::threadName( datURL ) + '\n' + threadURL;
         clipboard->setText( clipText , QClipboard::Clipboard );
         clipboard->setText( clipText , QClipboard::Selection );
     } else if ( action == removeFromFavoritesAct ) {

Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp	2009-07-05 03:51:51 UTC (rev 2362)
+++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp	2009-07-05 04:37:30 UTC (rev 2363)
@@ -1117,12 +1117,12 @@
         return;
     }
     if ( action == resAct ) {
-        resstr = ">>" + QString().setNum( resNum ) + "\n";
+        resstr = ">>" + QString().setNum( resNum ) + '\n';
         ViewMediator::getInstance()->showWriteView( m_datURL, resstr );
     } else if ( action == quoteAct ) {
-        resstr = ">>" + QString().setNum( resNum ) + "\n"
-                 + "> " + Kita::DatManager::getPlainTitle( m_datURL, resNum ) + "\n"
-                 + "> " + Kita::DatManager::getPlainBody( m_datURL, resNum ).replace( "\n", "\n> " ) + "\n";
+        resstr = ">>" + QString().setNum( resNum ) + '\n'
+                 + "> " + Kita::DatManager::getPlainTitle( m_datURL, resNum ) + '\n'
+                 + "> " + Kita::DatManager::getPlainBody( m_datURL, resNum ).replace( '\n', "\n> " ) + '\n';
         ViewMediator::getInstance()->showWriteView( m_datURL, resstr );
     } else if ( action == markAct ) {
         Kita::DatManager::setMark( m_datURL, resNum, ! Kita::DatManager::isMarked( m_datURL, resNum ) );
@@ -1135,14 +1135,14 @@
         }
 
         // url
-        if ( str != QString::null ) str += "\n";
-        str += Kita::DatManager::threadURL( m_datURL ) + "/" + QString().setNum( resNum ) + "\n";
+        if ( str != QString::null ) str += '\n';
+        str += Kita::DatManager::threadURL( m_datURL ) + '/' + QString().setNum( resNum ) + '\n';
 
         // body
         if ( action == copyAct ) {
-            str += "\n"
-                   + Kita::DatManager::getPlainTitle( m_datURL, resNum ) + "\n"
-                   + Kita::DatManager::getPlainBody( m_datURL, resNum ) + "\n";
+            str += '\n'
+                   + Kita::DatManager::getPlainTitle( m_datURL, resNum ) + '\n'
+                   + Kita::DatManager::getPlainBody( m_datURL, resNum ) + '\n';
         }
 
         // copy
@@ -1157,7 +1157,7 @@
         gotoAnchor( QString().setNum( resNum ), false );
 
     } else if ( action == showBrowserAct ) {
-        str = Kita::DatManager::threadURL( m_datURL ) + "/" + QString().setNum( resNum );
+        str = Kita::DatManager::threadURL( m_datURL ) + '/' + QString().setNum( resNum );
 
         KRun::runUrl( str, "text/html", view() );
     } else if ( action == aboneNameAct ) {
@@ -1529,7 +1529,7 @@
 
         /* get board name */
         QString boardName = Kita::BoardManager::boardName( datURL );
-        if ( boardName != QString::null ) innerHTML += "[" + boardName + "] ";
+        if ( boardName != QString::null ) innerHTML += '[' + boardName + "] ";
 
         /* If idx file of datURL is not read, thread name cannot be obtained.
            so, create DatInfo if cache exists, and read idx file in DatInfo::DatInfo(). */

Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp	2009-07-05 03:51:51 UTC (rev 2362)
+++ kita/branches/KITA-KDE4/kita/src/libkita/access.cpp	2009-07-05 04:37:30 UTC (rev 2363)
@@ -71,7 +71,7 @@
 
         {
             QString tmpData = Kita::qcpToUnicode( orgData );
-            QStringList tmpList = tmpData.split( "\n" );
+            QStringList tmpList = tmpData.split( '\n' );
             emit receiveData( tmpList );
         }
         break;
@@ -128,7 +128,7 @@
     case Board_JBBS:
         getURL = Kita::getThreadURL( m_datURL );
         getURL.replace( "read.cgi", "rawmode.cgi" );  /* adhoc... */
-        if ( m_readNum > 0 ) getURL += "/" + QString().setNum( m_readNum + 1 ) + "-";
+        if ( m_readNum > 0 ) getURL += '/' + QString().setNum( m_readNum + 1 ) + '-';
         break;
 
     default:
@@ -293,8 +293,8 @@
             }
 
             /* save line */
-            if ( m_bbstype == Board_MachiBBS ) m_threadData += ba + "\n";
-            else m_threadData += lineList[ i ] + "\n";
+            if ( m_bbstype == Board_MachiBBS ) m_threadData += ba + '\n';
+            else m_threadData += lineList[ i ] + '\n';
             ++m_readNum;
 
             datLineList += line2;
@@ -322,7 +322,7 @@
     if ( m_currentJob ) m_header = m_currentJob->queryMetaData( "HTTP-Headers" );
     //if ( m_header.isEmpty() ) return QDateTime::currentDateTime().toTime_t();
     // parse HTTP headers
-    QStringList headerList = m_header.split( "\n" );
+    QStringList headerList = m_header.split( '\n' );
     QRegExp regexp( "Date: (.*)" );
     QStringList dateStrList = headerList.filter( regexp );
     if ( dateStrList.isEmpty() || regexp.indexIn( dateStrList[0] ) == -1 ) {
@@ -338,7 +338,7 @@
     if ( m_currentJob ) m_header = m_currentJob->queryMetaData( "HTTP-Headers" );
     //if ( m_header.isEmpty() ) return 200;
     // parse HTTP headers
-    QStringList headerList = m_header.split( "\n" );
+    QStringList headerList = m_header.split( '\n' );
     QRegExp regexp( "HTTP/1\\.[01] ([0-9]+) .*" );
     QStringList dateStrList = headerList.filter( regexp );
     if ( dateStrList.isEmpty() || regexp.indexIn( dateStrList[0] ) == -1 ) {

Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp	2009-07-05 03:51:51 UTC (rev 2362)
+++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp	2009-07-05 04:37:30 UTC (rev 2363)
@@ -76,7 +76,7 @@
     m_hostname = hostName;
 
     /* m_basePath = (hostname)/(rootPath)/(bbsPath)/ */
-    m_basePath = m_hostname + m_rootPath + m_bbsPath + "/";
+    m_basePath = m_hostname + m_rootPath + m_bbsPath + '/';
 
     switch ( m_type ) {
 
@@ -86,7 +86,7 @@
 
         /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ */
     default:
-        m_cgiBasePath = m_hostname + m_rootPath + m_delimiter + m_bbsPath + "/";
+        m_cgiBasePath = m_hostname + m_rootPath + m_delimiter + m_bbsPath + '/';
         break;
     }
 }
@@ -254,7 +254,7 @@
     /* m_basePath = (hostname)/(rootPath)/(bbsPath)/ */
     for ( int i = 0; i < m_keyHostList.count(); ++i ) {
         if ( m_keyHostList[ i ].length() > 0 )
-            m_keyBasePathList += m_keyHostList[ i ] + m_rootPath + m_bbsPath + "/";
+            m_keyBasePathList += m_keyHostList[ i ] + m_rootPath + m_bbsPath + '/';
     }
 
     switch ( m_type ) {
@@ -268,7 +268,7 @@
         /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ */
     default:
         for ( int i = 0; i < m_keyHostList.count(); ++i )
-            m_keyCgiBasePathList += m_keyHostList[ i ] + m_rootPath + m_delimiter + m_bbsPath + "/";
+            m_keyCgiBasePathList += m_keyHostList[ i ] + m_rootPath + m_delimiter + m_bbsPath + '/';
         break;
     }
 }
@@ -500,7 +500,7 @@
         /* get all file names */
         QString ext = BoardManager::getBoardData( url ) ->ext();
         QString boardURL = BoardManager::getBoardData( url ) ->basePath();
-        QStringList filter("*" + ext);
+        QStringList filter('*' + ext);
         QStringList flist = d.entryList(filter);
 
         for ( QStringList::iterator it = flist.begin(); it != flist.end(); ++it ) {
@@ -535,7 +535,7 @@
         QDir d( cacheDir );
         if ( d.exists() ) {
             QString ext = BoardManager::getBoardData( url ) ->ext();
-            QStringList filter("*" + ext);
+            QStringList filter('*' + ext);
             cacheList = d.entryList( filter );
         }
     }
@@ -738,7 +738,7 @@
 
         delimiter = "/test/read.cgi";
         bbsPath = url.fileName();
-        rootPath = url.prettyUrl().remove( hostname + "/" ).remove( bbsPath + "/" );
+        rootPath = url.prettyUrl().remove( hostname + '/' ).remove( bbsPath + '/' );
         if ( rootPath.length() == 0 ) rootPath = QString::null;
         ext = ".dat";
         break;
@@ -747,7 +747,7 @@
 
         delimiter = "/test/read.cgi";
         bbsPath = url.fileName();
-        rootPath = url.prettyUrl().remove( hostname + "/" ).remove( bbsPath + "/" );
+        rootPath = url.prettyUrl().remove( hostname + '/' ).remove( bbsPath + '/' );
         if ( rootPath.length() == 0 ) rootPath = QString::null;
         ext = ".dat";
         type = Board_2ch;
@@ -758,8 +758,8 @@
     const QRegExp exp( "/$" );
     rootPath.remove( exp );
     bbsPath.remove( exp );
-    if ( rootPath != QString::null && rootPath.at( 0 ) != '/' ) rootPath = "/" + rootPath;
-    if ( bbsPath != QString::null && bbsPath.at( 0 ) != '/' ) bbsPath = "/" + bbsPath;
+    if ( rootPath != QString::null && rootPath.at( 0 ) != '/' ) rootPath = '/' + rootPath;
+    if ( bbsPath != QString::null && bbsPath.at( 0 ) != '/' ) bbsPath = '/' + bbsPath;
 
     return type;
 }
@@ -861,8 +861,8 @@
     QString newURL = toURL.prettyUrl();
     oldURL.remove( exp );
     newURL.remove( exp );
-    oldURL += "/";
-    newURL += "/";
+    oldURL += '/';
+    newURL += '/';
 
     if ( oldURL == newURL ) return false;
 
@@ -927,7 +927,7 @@
     if ( qdir.exists ( newCachePath ) ) {
         QString bkupPath = newCachePath;
         bkupPath.truncate( bkupPath.length() - 1 ); /* remove '/' */
-        bkupPath += "." + QString().setNum( QDateTime::currentDateTime().toTime_t() );
+        bkupPath += '.' + QString().setNum( QDateTime::currentDateTime().toTime_t() );
         qdir.rename( newCachePath, bkupPath );
     }
 

Modified: kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp	2009-07-05 03:51:51 UTC (rev 2362)
+++ kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp	2009-07-05 04:37:30 UTC (rev 2363)
@@ -21,7 +21,7 @@
 {
     QString dir = KGlobal::dirs() ->saveLocation( "cache", "kita" );
     if ( dir[ dir.length() - 1 ] != '/' )
-        dir += "/";
+        dir += '/';
 
     return dir;
 }
@@ -35,7 +35,7 @@
 
     QString root = bdata->hostName() + bdata->rootPath();
 
-    return root.remove( "http://" ).replace( "/", "_" ) + "/";
+    return root.remove( "http://" ).replace( '/', '_' ) + '/';
 }
 
 
@@ -47,7 +47,7 @@
 
     QString bbs = bdata->bbsPath();
 
-    return bbs.mid( 1 ).replace( "/", "_" ) + "/";
+    return bbs.mid( 1 ).replace( '/', '_' ) + '/';
 }
 
 

Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp	2009-07-05 03:51:51 UTC (rev 2362)
+++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp	2009-07-05 04:37:30 UTC (rev 2363)
@@ -439,13 +439,13 @@
     RESDAT& resdat = m_resDatVec[ num ];
 
     if ( abone ) {
-        titleHTML = QString().setNum( num ) + " " + i18n( "Abone" );
+        titleHTML = QString().setNum( num ) + ' ' + i18n( "Abone" );
         bodyHTML = "<a href=\"#abone" + QString().setNum( num ) + "\">";
         bodyHTML += i18n( "Abone" ) + "</a>";
 
         return KITA_HTML_ABONE;
     } else if ( resdat.broken ) {
-        titleHTML = QString().setNum( num ) + " " + i18n( "Broken" );
+        titleHTML = QString().setNum( num ) + ' ' + i18n( "Broken" );
         bodyHTML = i18n( "Broken" );
 
         return KITA_HTML_BROKEN;

Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp	2009-07-05 03:51:51 UTC (rev 2362)
+++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp	2009-07-05 04:37:30 UTC (rev 2363)
@@ -316,7 +316,7 @@
 const QString DatManager::threadID( const KUrl& url )
 {
     KUrl datURL = Kita::getDatURL( url );
-    return datURL.fileName().section( ".", 0, 0 );
+    return datURL.fileName().section( '.', 0, 0 );
 }
 
 

Modified: kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp	2009-07-05 03:51:51 UTC (rev 2362)
+++ kita/branches/KITA-KDE4/kita/src/libkita/jbbs.cpp	2009-07-05 04:37:30 UTC (rev 2363)
@@ -32,9 +32,9 @@
     ( ret += "submit=" ) += "%8f%91%82%ab%8d%9e%82%de";  /* kakikomu */
     ( ret += "&NAME=" ) += Kita::encode_string( name, mib );
     ( ret += "&MAIL=" ) += Kita::encode_string( mail, mib );
-    ( ret += "&MESSAGE=" ) += Kita::encode_string( body, mib ).replace( ";", "%3B" );
-    ( ret += "&BBS=" ) += boardID.section( "/", 1, 1 );
-    ( ret += "&DIR=" ) += boardID.section( "/", 0, 0 );
+    ( ret += "&MESSAGE=" ) += Kita::encode_string( body, mib ).replace( ';', "%3B" );
+    ( ret += "&BBS=" ) += boardID.section( '/', 1, 1 );
+    ( ret += "&DIR=" ) += boardID.section( '/', 0, 0 );
     ( ret += "&KEY=" ) += threadID;
     ( ret += "&TIME=" ) += QString::number( serverTime );
 

Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp	2009-07-05 03:51:51 UTC (rev 2362)
+++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp	2009-07-05 04:37:30 UTC (rev 2363)
@@ -210,11 +210,11 @@
 {
     QString retstr = QString::null;
 
-    if ( ( pos = isEqual( cdat , "&gt;" ) ) ) retstr = ">";
-    else if ( ( pos = isEqual( cdat , "&lt;" ) ) ) retstr = "<";
-    else if ( ( pos = isEqual( cdat , "&nbsp;" ) ) ) retstr = " ";
-    else if ( ( pos = isEqual( cdat , "&amp;" ) ) ) retstr = "&";
-    else if ( ( pos = isEqual( cdat , "&quot;" ) ) ) retstr = "\"";
+    if ( ( pos = isEqual( cdat , "&gt;" ) ) ) retstr = '>';
+    else if ( ( pos = isEqual( cdat , "&lt;" ) ) ) retstr = '<';
+    else if ( ( pos = isEqual( cdat , "&nbsp;" ) ) ) retstr = ' ';
+    else if ( ( pos = isEqual( cdat , "&amp;" ) ) ) retstr = '&';
+    else if ( ( pos = isEqual( cdat , "&quot;" ) ) ) retstr = '"';
 
     else if ( ( pos = isEqual( cdat , "&hearts;" ) ) )
         retstr = utf8ToUnicode( KITAUTF8_HEART );
@@ -269,7 +269,7 @@
 
     case Kita::Board_JBBS: {
             QString cgipath = Kita::BoardManager::boardRoot( m_datURL )
-                              + "/bbs/write.cgi/" + Kita::BoardManager::boardID( m_datURL ) + "/";
+                              + "/bbs/write.cgi/" + Kita::BoardManager::boardID( m_datURL ) + '/';
 
             cgipath += "new/";
 
@@ -304,9 +304,9 @@
 
     case Kita::Board_JBBS: {
             QString cgipath = Kita::BoardManager::boardRoot( m_datURL )
-                              + "/bbs/write.cgi/" + Kita::BoardManager::boardID( m_datURL ) + "/";
+                              + "/bbs/write.cgi/" + Kita::BoardManager::boardID( m_datURL ) + '/';
 
-            cgipath += Kita::DatManager::threadID( m_datURL ) + "/";
+            cgipath += Kita::DatManager::threadID( m_datURL ) + '/';
 
             m_bbscgi = cgipath;
         }
@@ -421,7 +421,7 @@
 
     if ( refBase != QString::null ) {
 
-        if ( refBase.at( 0 ) == '-' ) refstr = "1" + refBase;
+        if ( refBase.at( 0 ) == '-' ) refstr = '1' + refBase;
         else refstr = refBase;
     }
 
@@ -464,7 +464,7 @@
     KUrl url( datURL );
     QString root = url.host();
 
-    QStringList list = url.fileName().split( "." );
+    QStringList list = url.fileName().split( '.' );
     if ( list.size() != 2 ) {
         return QString::null;
     }
@@ -493,12 +493,12 @@
     QDir qdir( targetPath );
     if ( !qdir.exists() ) {
 
-        QStringList pathList = targetPath.split( "/" );
+        QStringList pathList = targetPath.split( '/' );
         QString path = QString::null;
 
         for ( int i = 0; i < pathList.count(); ++i ) {
 
-            path += "/" + pathList[ i ];
+            path += '/' + pathList[ i ];
 
             qdir = path;
             if ( !qdir.exists() ) {
@@ -575,7 +575,7 @@
     QRegExp truncSpace( "\\s*$" );
     QStringList::iterator it = tmp.begin();
     for ( ; it != tmp.end(); ++it )
-        ret_list += ( *it ).replace( truncSpace, "" );
+        ret_list += ( *it ).remove( truncSpace );
     return ret_list;
 }
 
@@ -677,7 +677,7 @@
     if ( num >= nextNum ) {
 
         if ( num != 1 ) m_machiSubject = QString::null;
-        ret += name + "<><>" + date + " " + time + " ID:" + id;
+        ret += name + "<><>" + date + ' ' + time + " ID:" + id;
         if ( host != QString::null ) ret += " HOST:" + host;
         ret += "<>" + message + "<>" + m_machiSubject;
         nextNum = num;
@@ -1202,7 +1202,7 @@
             pos++;
         } else if ( cdat[ pos ] == '&' && cdat[ pos + 1 ] == 'g'  /* &gt; */
                     && cdat[ pos + 2 ] == 't' && cdat[ pos + 3 ] == ';' ) {
-            linkstr += ">";
+            linkstr += '>';
             pos += 4;
         }
 
@@ -1211,7 +1211,7 @@
     /* check ',' */
     if ( !pos ) {
         if ( cdat[ pos ] == ',' || cdat[ pos ].unicode() == UTF16_COMMA ) {
-            linkstr += ",";
+            linkstr += ',';
             pos ++;
         }
     }
@@ -1219,7 +1219,7 @@
     /* check '=' */
     if ( !pos ) {
         if ( cdat[ pos ] == '=' || cdat[ pos ].unicode() == UTF16_EQ ) {
-            linkstr += "=";
+            linkstr += '=';
             pos ++;
         }
     }
@@ -1335,7 +1335,7 @@
     if ( showMailAddress ) {
 
         titleHTML += resdat.nameHTML;
-        if ( resdat.address != QString::null ) titleHTML += " [" + resdat.address + "]";
+        if ( resdat.address != QString::null ) titleHTML += " [" + resdat.address + ']';
 
     } else { /* don't show mail address */
 
@@ -1418,7 +1418,7 @@
 
 QString Kita::fontToString( const QFont& font )
 {
-    return font.family() + " " + QString::number( font.pointSize() );
+    return font.family() + ' ' + QString::number( font.pointSize() );
 }
 
 // copied from kurl.cpp

Modified: kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp	2009-07-05 03:51:51 UTC (rev 2362)
+++ kita/branches/KITA-KDE4/kita/src/libkita/thread.cpp	2009-07-05 04:37:30 UTC (rev 2363)
@@ -42,7 +42,7 @@
 {
     /* remove space */
     QRegExp qrx( " +$" );
-    threadName.replace( qrx, "" );
+    threadName.remove( qrx );
 
     /* unescape */
     threadName.replace( "&lt;", "<" ).replace( "&gt;", ">" ).replace( "&amp;", "&" );

Modified: kita/branches/KITA-KDE4/kita/src/threadview.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/threadview.cpp	2009-07-05 03:51:51 UTC (rev 2362)
+++ kita/branches/KITA-KDE4/kita/src/threadview.cpp	2009-07-05 04:37:30 UTC (rev 2363)
@@ -406,7 +406,7 @@
         /* show status bar,caption, url  */
         infostr = Kita::DatManager::threadName( m_datURL ) +
                   QString( " [Total: %1 New: %2] %3 k" ).arg( resNum ).arg( resNum - viewPos ).arg( datSize / 1024 )
-                  + info + " " + errstr;
+                  + info + ' ' + errstr;
 
         captionStr = Kita::DatManager::threadName( m_datURL ) + QString( " (%1)" ).arg( viewPos );
 
@@ -445,7 +445,7 @@
     gotoCombo->addItem( Kita::utf8ToUnicode( KITAUTF8_GOTO ) );
     gotoCombo->addItem( Kita::utf8ToUnicode( KITAUTF8_KOKOYON ) );
     for ( int i = 1; i < Kita::DatManager::getReadNum( m_datURL ); i += 100 ) {
-        gotoCombo->addItem( QString().setNum( i ) + "-" );
+        gotoCombo->addItem( QString().setNum( i ) + '-' );
     }
     gotoCombo->addItem( Kita::utf8ToUnicode( KITAUTF8_SAIGO ) );
     gotoCombo->adjustSize();

Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp	2009-07-05 03:51:51 UTC (rev 2362)
+++ kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp	2009-07-05 04:37:30 UTC (rev 2363)
@@ -189,7 +189,7 @@
         if ( str == QString::null ) str = clipboard->text( QClipboard::Clipboard );
         if ( str != QString::null ) {
 
-            QString msg = "\n> " + str.replace( "\n", "\n> " ) + "\n";
+            QString msg = "\n> " + str.replace( '\n', "\n> " ) + '\n';
             view->insertMessage( msg );
         }
     }




Kita-svn メーリングリストの案内
アーカイブの一覧に戻る