[Kita-svn] [2366] - use QString::isEmpty() instead of QString::isNull()

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 7月 5日 (日) 16:05:20 JST


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

Log Message:
-----------
- use QString::isEmpty() instead of QString::isNull()
- use QString() instead of QString::null
- don't return reference to temporary

Modified Paths:
--------------
    kita/branches/KITA-KDE4/kita/src/bbsview.cpp
    kita/branches/KITA-KDE4/kita/src/htmlpart.cpp
    kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h
    kita/branches/KITA-KDE4/kita/src/libkita/access.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/account.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/datinfo.h
    kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h
    kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp
    kita/branches/KITA-KDE4/kita/src/mainwindow.cpp
    kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp
    kita/branches/KITA-KDE4/kita/src/threadview.cpp
    kita/branches/KITA-KDE4/kita/src/threadview.h
    kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp
    kita/branches/KITA-KDE4/kita/src/writetabwidget.h
    kita/branches/KITA-KDE4/kita/src/writeview.cpp

Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/bbsview.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -150,8 +150,8 @@
     Q3ValueList<Kita::Category>::iterator it;
 
     /* Are there new boards or moved boards ? */
-    QString newBoards = QString::null;
-    QString oldBoards = QString::null;
+    QString newBoards;
+    QString oldBoards;
     for ( it = categoryList.begin(); it != categoryList.end(); ++it ) {
         Kita::Category category = ( *it );
         Q3ValueList<QString> board_url_list = category.boardURLList;
@@ -182,7 +182,7 @@
     const int maxNewBoard = 64;
 
     /* show new board names */
-    if ( !newBoards.isNull() && newBoards.count( "\n" ) < maxNewBoard ) {
+    if ( !newBoards.isEmpty() && newBoards.count( "\n" ) < maxNewBoard ) {
 
         QStringList boardList = newBoards.split( '\n' );
         KMessageBox::informationList( this,
@@ -191,7 +191,7 @@
     }
 
     /* show moved board names */
-    if ( !oldBoards.isNull() ) {
+    if ( !oldBoards.isEmpty() ) {
 
         QStringList boardList = oldBoards.split( '\n' );
         KMessageBox::informationList( this,
@@ -200,8 +200,8 @@
                                       boardList, "Kita" );
     }
 
-    if ( ( !newBoards.isNull() && newBoards.count( "\n" ) < maxNewBoard )
-            || !oldBoards.isNull() ) {
+    if ( ( !newBoards.isEmpty() && newBoards.count( "\n" ) < maxNewBoard )
+            || !oldBoards.isEmpty() ) {
 
         QMessageBox mb( "kita", i18n( "Do you really want to update board list?" ),
                         QMessageBox::Information,
@@ -220,7 +220,7 @@
         }
 
         if ( ret == QMessageBox::Cancel ) return false;
-    } else if ( newBoards.isNull() && oldBoards.isNull() ) {
+    } else if ( newBoards.isEmpty() && oldBoards.isEmpty() ) {
 
         QMessageBox::information( this, "Kita", i18n( "no new boards" ) );
         return false;
@@ -377,7 +377,7 @@
         Kita::ListViewItem* categoryItem = new Kita::ListViewItem( m_boardList, "extboard" );
 //        categoryItem->setColor( m_textColor, m_baseColor ); // TODO
 
-        while ( !( str = stream.readLine() ).isNull() ) {
+        while ( !( str = stream.readLine() ).isEmpty() ) {
             if ( ! str.isEmpty() ) {
                 QStringList list = str.split( "<>" );
 
@@ -407,13 +407,13 @@
     QStringList::iterator it;
 
     Kita::Category current_category;
-    current_category.category_name = QString::null;
+    current_category.category_name.clear();
     current_category.boardNameList.clear();
     current_category.boardURLList.clear();
     for ( it = lines.begin(); it != lines.end(); ++it ) {
         QString category_name = Kita::getCategory( *it );
-        if ( !category_name.isNull() ) {
-            if ( !current_category.category_name.isNull() ) {
+        if ( !category_name.isEmpty() ) {
+            if ( !current_category.category_name.isEmpty() ) {
                 result.append( current_category );
             }
             current_category.category_name = category_name;
@@ -424,7 +424,7 @@
             if ( regexp.indexIn( ( *it ) ) != -1 ) {
                 QString url = regexp.cap( 1 );
                 QString title = regexp.cap( 2 );
-                if ( Kita::isBoardURL( url ) && !current_category.category_name.isNull() ) {
+                if ( Kita::isBoardURL( url ) && !current_category.category_name.isEmpty() ) {
                     current_category.boardNameList.append( title );
                     current_category.boardURLList.append( url );
                 }

Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -52,7 +52,7 @@
     m_mode = HTMLPART_MODE_MAINPART;
     m_popup = NULL;
     m_domtree = NULL;
-    m_datURL = QString::null;
+    m_datURL.clear();
     m_updatedKokoyon = false;
 
     clearPart();
@@ -106,7 +106,7 @@
         }
     }
 
-    m_datURL = QString::null;
+    m_datURL.clear();
     m_mode = HTMLPART_MODE_MAINPART;
 }
 
@@ -439,7 +439,7 @@
 /* public */
 bool KitaHTMLPart::gotoAnchor( const QString& anc, bool pushPosition )
 {
-    if ( anc.isNull() ) return false;
+    if ( anc.isEmpty() ) return false;
     if ( !m_domtree || m_mode == HTMLPART_MODE_POPUP )
         return KHTMLPart::gotoAnchor( anc );
 
@@ -508,7 +508,7 @@
     DOM::Node node;
     node = nodeUnderMouse();
     while ( node != NULL && node.nodeName().string() != "div" ) node = node.parentNode();
-    if ( node == NULL ) return QString::null;
+    if ( node == NULL ) return QString();
 
     return static_cast<DOM::Element>( node ).getAttribute( "id" ).string();
 }
@@ -777,7 +777,7 @@
     // copy link
     KAction* openBrowserAct = 0;
     KAction* copyLinkAct = 0;
-    if ( !url.isNull() ) {
+    if ( !url.isEmpty() ) {
         if ( showppm ) popupMenu.addSeparator();
         showppm = true;
 
@@ -871,7 +871,7 @@
     emit mousePressed(); /* to KitaThreadView to focus this view. */
 
     KUrl kurl;
-    if ( !e->url().string().isNull() )
+    if ( !e->url().string().isEmpty() )
         kurl = KUrl( Kita::BoardManager::boardURL( m_datURL ), e->url().string() );
 
     m_pushctrl = m_pushmidbt = m_pushrightbt = false;
@@ -952,7 +952,7 @@
         return ;
     }
 
-    if ( refstr.isNull() ) return ;
+    if ( refstr.isEmpty() ) return ;
 
     /*---------------------------*/
     /* show popupmenu for #write */
@@ -1127,7 +1127,7 @@
     } else if ( action == markAct ) {
         Kita::DatManager::setMark( m_datURL, resNum, ! Kita::DatManager::isMarked( m_datURL, resNum ) );
     } else if ( action == copyAct || action == copyUrlAct || action == copyThreadNameAct ) {
-        str = QString::null;
+        str.clear();
 
         // title 
         if ( action == copyThreadNameAct || action == copyAct ) {
@@ -1135,7 +1135,7 @@
         }
 
         // url
-        if ( !str.isNull() ) str += '\n';
+        if ( !str.isEmpty() ) str += '\n';
         str += Kita::DatManager::threadURL( m_datURL ) + '/' + QString().setNum( resNum ) + '\n';
 
         // body
@@ -1283,7 +1283,7 @@
 void KitaHTMLPart::slotShowResPopup( QPoint point, int refNum, int refNum2 )
 {
     QString innerHTML = Kita::DatManager::getHtml( m_datURL, refNum, refNum2 );
-    if ( innerHTML.isNull() ) return ;
+    if ( innerHTML.isEmpty() ) return ;
 
     showPopupCore( m_datURL, innerHTML, point );
 }
@@ -1504,7 +1504,7 @@
     /*-------------------------*/
     /* popup for anchor        */
 
-    QString innerHTML = QString::null;
+    QString innerHTML;
     int refNum;
     int refNum2;
 
@@ -1529,7 +1529,7 @@
 
         /* get board name */
         QString boardName = Kita::BoardManager::boardName( datURL );
-        if ( !boardName.isNull() ) innerHTML += '[' + boardName + "] ";
+        if ( !boardName.isEmpty() ) 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(). */
@@ -1537,7 +1537,7 @@
 
         /* get thread Name */
         QString subName = Kita::DatManager::threadName( datURL );
-        if ( !subName.isNull() ) innerHTML += subName + "<br><br>";
+        if ( !subName.isEmpty() ) innerHTML += subName + "<br><br>";
 
         if ( !refNum ) refNum = refNum2 = 1;
     }
@@ -1546,7 +1546,7 @@
     if ( !refNum ) return ;
     innerHTML += Kita::DatManager::getHtml( datURL, refNum, refNum2 );
 
-    if ( !innerHTML.isNull() ) showPopup( datURL, innerHTML );
+    if ( !innerHTML.isEmpty() ) showPopup( datURL, innerHTML );
 }
 
 
@@ -1565,7 +1565,7 @@
 
     if ( ( refNum = Kita::stringToPositiveNum( chpt, length ) ) != -1 ) {
         QString innerHTML = Kita::DatManager::getHtml( m_datURL, refNum, refNum );
-        if ( !innerHTML.isNull() ) {
+        if ( !innerHTML.isEmpty() ) {
             showPopup( m_datURL, innerHTML );
             startMultiPopup();
             return true;

Modified: kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/kitaui/listviewitem.h	2009-07-05 07:05:20 UTC (rev 2366)
@@ -23,20 +23,20 @@
     public:
 
         ListViewItem( Q3ListView *parent, Q3ListViewItem *after,
-                      QString, QString = QString::null,
-                      QString = QString::null, QString = QString::null,
-                      QString = QString::null, QString = QString::null,
-                      QString = QString::null, QString = QString::null );
+                      QString, QString = QString(),
+                      QString = QString(), QString = QString(),
+                      QString = QString(), QString = QString(),
+                      QString = QString(), QString = QString() );
 
         ListViewItem( Q3ListViewItem *parent, Q3ListViewItem *after,
-                      QString, QString = QString::null,
-                      QString = QString::null, QString = QString::null,
-                      QString = QString::null, QString = QString::null,
-                      QString = QString::null, QString = QString::null );
+                      QString, QString = QString(),
+                      QString = QString(), QString = QString(),
+                      QString = QString(), QString = QString(),
+                      QString = QString(), QString = QString() );
 
-        explicit ListViewItem( Q3ListView* parent, QString = QString::null, QString = QString::null );
+        explicit ListViewItem( Q3ListView* parent, QString = QString(), QString = QString() );
 
-        explicit ListViewItem( Q3ListViewItem* parent, QString = QString::null, QString = QString::null );
+        explicit ListViewItem( Q3ListViewItem* parent, QString = QString(), QString = QString() );
 
         ~ListViewItem();
 

Modified: kita/branches/KITA-KDE4/kita/src/libkita/access.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/access.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/libkita/access.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -49,7 +49,7 @@
 
     // get cache path.
     QString cachePath = Kita::Cache::getPath( m_datURL );
-    if ( cachePath.isNull() ) {
+    if ( cachePath.isEmpty() ) {
         return;
     }
 
@@ -93,7 +93,7 @@
     m_dataSize += m_threadData.length();
 
     QString cachePath = Kita::Cache::getPath( m_datURL );
-    if ( !cachePath.isNull() ) {
+    if ( !cachePath.isEmpty() ) {
         FILE * fs = fopen( QFile::encodeName( cachePath ), "a" );
         if ( !fs ) return ;
 
@@ -282,7 +282,7 @@
                 ba = lineList[i];
             }
 
-            if ( line2.isNull() ) continue;
+            if ( line2.isEmpty() ) continue;
 
             /* add abone lines */
             const char aboneStr[] = "abone<><><>abone<>";
@@ -389,7 +389,7 @@
     // use 'HTTP-Headers' metadata.
     job->addMetaData( "PropagateHttpHeader", "true" );
 
-    return QString::null; /* dummy */
+    return QString(); /* dummy */
 }
 
 void OfflawAccess::slotThreadResult( KIO::Job* job )

Modified: kita/branches/KITA-KDE4/kita/src/libkita/account.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/account.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/libkita/account.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -90,7 +90,7 @@
     QString str( m_data );
     QRegExp regexp( "SESSION-ID=(.*)" );
     if ( regexp.indexIn( str ) == -1 ) {
-        m_sessionID = QString::null;
+        m_sessionID.clear();
         m_isLogged = false;
     } else {
         QString value = regexp.cap( 1 );
@@ -101,7 +101,7 @@
             m_sessionID = value;
         } else {
             m_isLogged = false;
-            m_sessionID = QString::null;
+            m_sessionID.clear();
         }
     }
     m_eventLoop.exit();

Modified: kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/libkita/boardmanager.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -206,10 +206,10 @@
 {
     m_settingLoaded = set;
     if ( ! set ) {
-            m_defaultName = QString::null;
+            m_defaultName.clear();
             m_linenum = 0;
             m_msgCount = 0;
-            m_titleImgURL = QString::null;
+            m_titleImgURL.clear();
         }
 }
 
@@ -322,7 +322,7 @@
 const QString BoardManager::boardURL( const KUrl& url )
 {
     BoardData * bdata = getBoardData( url );
-    if ( bdata == NULL ) return QString::null;
+    if ( bdata == NULL ) return QString();
 
     return bdata->basePath();
 }
@@ -343,7 +343,7 @@
 const QString BoardManager::boardRoot( const KUrl& url )
 {
     BoardData * bdata = getBoardData( url );
-    if ( bdata == NULL ) return QString::null;
+    if ( bdata == NULL ) return QString();
 
     return bdata->hostName() + bdata->rootPath();
 }
@@ -352,7 +352,7 @@
 const QString BoardManager::boardPath( const KUrl& url )
 {
     BoardData * bdata = getBoardData( url );
-    if ( bdata == NULL ) return QString::null;
+    if ( bdata == NULL ) return QString();
 
     return bdata->bbsPath();
 }
@@ -361,7 +361,7 @@
 const QString BoardManager::ext( const KUrl& url )
 {
     BoardData * bdata = getBoardData( url );
-    if ( bdata == NULL ) return QString::null;
+    if ( bdata == NULL ) return QString();
 
     return bdata->ext();
 }
@@ -370,7 +370,7 @@
 const QString BoardManager::boardID( const KUrl& url )
 {
     BoardData * bdata = getBoardData( url );
-    if ( bdata == NULL ) return QString::null;
+    if ( bdata == NULL ) return QString();
 
     return bdata->bbsPath().mid( 1 ); /* remove "/" */
 }
@@ -380,7 +380,7 @@
 const QString BoardManager::subjectURL( const KUrl& url )
 {
     BoardData * bdata = getBoardData( url );
-    if ( bdata == NULL ) return QString::null;
+    if ( bdata == NULL ) return QString();
 
     return bdata->basePath() + "subject.txt";
 }
@@ -390,7 +390,7 @@
 const QString BoardManager::boardName( const KUrl& url )
 {
     BoardData * bdata = getBoardData( url );
-    if ( bdata == NULL ) return QString::null;
+    if ( bdata == NULL ) return QString();
 
     return bdata->boardName();
 }
@@ -504,7 +504,7 @@
         QStringList flist = d.entryList(filter);
 
         for ( QStringList::iterator it = flist.begin(); it != flist.end(); ++it ) {
-            if ( ( *it ).isNull() ) continue;
+            if ( ( *it ).isEmpty() ) continue;
 
             QString datURL = boardURL + "dat/" + ( *it );
 
@@ -569,7 +569,7 @@
     }
     QString line;
 
-    while ( !( line = stream.readLine() ).isNull() ) {
+    while ( !( line = stream.readLine() ).isEmpty() ) {
         int pos = regexp.indexIn( line );
         if ( pos != -1 ) {
             QString fname = regexp.cap( 1 );
@@ -622,7 +622,7 @@
 
     m_boardDataList.clear();
     m_previousBoardData = NULL;
-    m_previousBoardURL = QString::null;
+    m_previousBoardURL.clear();
 }
 
 /**
@@ -634,8 +634,8 @@
  *
  * @param[out] oldURL
  *
- * @retval Board_enrollEnrolled if board is already enrolled. oldURL is QString::null.
- * @retval Board_enrollNew if board is new board. oldURL is QString::null.
+ * @retval Board_enrollEnrolled if board is already enrolled. oldURL is QString().
+ * @retval Board_enrollNew if board is new board. oldURL is QString().
  * @retval Board_enrollMoved if board is moved. oldURL is old URL.
  *
  * @note board is NOT enrolled when board is moved.
@@ -655,7 +655,7 @@
     QString bbsPath;
     QString ext;
     type = parseBoardURL( url, type, hostname, rootPath, delimiter, bbsPath, ext );
-    oldURL = QString::null;
+    oldURL.clear();
 
     if ( type == Board_Unknown ) return Board_enrollFailed;
 
@@ -703,10 +703,10 @@
     QString& ext )
 {
     hostname = url.protocol() + "://" + url.host();
-    rootPath = QString::null;
-    delimiter = QString::null;
-    bbsPath = QString::null;
-    ext = QString::null;
+    rootPath.clear();
+    delimiter.clear();
+    bbsPath.clear();
+    ext.clear();
 
     /* decide type */
     if ( type == Board_Unknown ) {
@@ -739,7 +739,7 @@
         delimiter = "/test/read.cgi";
         bbsPath = url.fileName();
         rootPath = url.prettyUrl().remove( hostname + '/' ).remove( bbsPath + '/' );
-        if ( rootPath.length() == 0 ) rootPath = QString::null;
+        if ( rootPath.length() == 0 ) rootPath.clear();
         ext = ".dat";
         break;
 
@@ -748,7 +748,7 @@
         delimiter = "/test/read.cgi";
         bbsPath = url.fileName();
         rootPath = url.prettyUrl().remove( hostname + '/' ).remove( bbsPath + '/' );
-        if ( rootPath.length() == 0 ) rootPath = QString::null;
+        if ( rootPath.length() == 0 ) rootPath.clear();
         ext = ".dat";
         type = Board_2ch;
         break;
@@ -758,8 +758,8 @@
     const QRegExp exp( "/$" );
     rootPath.remove( exp );
     bbsPath.remove( exp );
-    if ( !rootPath.isNull() && rootPath.at( 0 ) != '/' ) rootPath = '/' + rootPath;
-    if ( !bbsPath.isNull() && bbsPath.at( 0 ) != '/' ) bbsPath = '/' + bbsPath;
+    if ( !rootPath.isEmpty() && rootPath.at( 0 ) != '/' ) rootPath = '/' + rootPath;
+    if ( !bbsPath.isEmpty() && bbsPath.at( 0 ) != '/' ) bbsPath = '/' + bbsPath;
 
     return type;
 }

Modified: kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/libkita/cache.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -31,7 +31,7 @@
 {
     /* Is board enrolled ? */
     BoardData * bdata = BoardManager::getBoardData( url );
-    if ( bdata == NULL ) return QString::null;
+    if ( bdata == NULL ) return QString();
 
     QString root = bdata->hostName() + bdata->rootPath();
 
@@ -43,7 +43,7 @@
 {
     /* Is board enrolled ? */
     BoardData * bdata = BoardManager::getBoardData( url );
-    if ( bdata == NULL ) return QString::null;
+    if ( bdata == NULL ) return QString();
 
     QString bbs = bdata->bbsPath();
 
@@ -54,7 +54,7 @@
 QString Cache::getPath( const KUrl& url )
 {
     QString path = baseDir() + serverDir( url ) + boardDir( url );
-    if ( path.isNull() ) return QString::null;
+    if ( path.isEmpty() ) return QString();
 
     //    qDebug( "%s -> %s",url.prettyUrl().ascii(),path.ascii());
 
@@ -64,8 +64,8 @@
 QString Cache::getIndexPath( const KUrl& url )
 {
     QString path = getPath( url );
-    if ( path.isNull() ) {
-        return QString::null;
+    if ( path.isEmpty() ) {
+        return QString();
     } else {
         return path + ".idx";
     }
@@ -80,7 +80,7 @@
 QString Cache::getSettingPath( const KUrl& url )
 {
     QString path = baseDir() + serverDir( url ) + boardDir( url );
-    if ( path.isNull() ) return QString::null;
+    if ( path.isEmpty() ) return QString();
 
     return path + "SETTING.TXT";
 }
@@ -89,7 +89,7 @@
 QString Cache::getBBSHistoryPath( const KUrl& url )
 {
     QString path = baseDir() + serverDir( url ) + boardDir( url );
-    if ( path.isNull() ) return QString::null;
+    if ( path.isEmpty() ) return QString();
 
     return path + "BBSHISTORY";
 }
@@ -98,7 +98,7 @@
 QString Cache::getSubjectPath( const KUrl& url )
 {
     QString path = baseDir() + serverDir( url ) + boardDir( url );
-    if ( path.isNull() ) return QString::null;
+    if ( path.isEmpty() ) return QString();
 
     return path + "subject.txt";
 }

Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -95,7 +95,7 @@
     /* init variables */
     m_broken = false;
     m_nowLoading = false;
-    m_lastLine = QString::null;
+    m_lastLine.clear();
 
     /* clear ResDatVec */
     m_resDatVec.clear();
@@ -225,7 +225,7 @@
    See also DatInfo::slotReceiveData()   */ /* private */
 bool DatInfo::copyOneLineToResDat( const QString& line )
 {
-    if ( line.isNull() ) return false;
+    if ( line.isEmpty() ) return false;
 
     /* update ReadNum */
     const int num = m_thread->readNum() + 1;
@@ -355,16 +355,16 @@
 
 /* They are public */
 
-const QString& DatInfo::getDat( int num )
+QString DatInfo::getDat( int num )
 {
-    if ( !parseDat( num ) ) return QString::null;
+    if ( !parseDat( num ) ) return QString();
 
     return m_resDatVec[ num ].linestr;
 }
 
-const QString& DatInfo::getId( int num )
+QString DatInfo::getId( int num )
 {
-    if ( !parseDat( num ) ) return QString::null;
+    if ( !parseDat( num ) ) return QString();
 
     return m_resDatVec[ num ].id;
 }
@@ -372,7 +372,7 @@
 /* plain strings of name */
 QString DatInfo::getPlainName( int num )
 {
-    if ( !parseDat( num ) ) return QString::null;
+    if ( !parseDat( num ) ) return QString();
 
     return m_resDatVec[ num ].name;
 }
@@ -381,7 +381,7 @@
 /* plain strings of title */
 QString DatInfo::getPlainTitle( int num )
 {
-    if ( !parseDat( num ) ) return QString::null;
+    if ( !parseDat( num ) ) return QString();
 
     QString titleHTML;
     Kita::createTitleHTML( m_resDatVec[ num ], titleHTML );
@@ -396,7 +396,7 @@
 /* plain strings of body  */
 QString DatInfo::getPlainBody( int num )
 {
-    if ( !parseDat( num ) ) return QString::null;
+    if ( !parseDat( num ) ) return QString();
 
     QString retStr;
     Kita::DatToText( m_resDatVec[ num ].bodyHTML, retStr );
@@ -462,7 +462,7 @@
    return value is HTML strings               */  /* public */
 QString DatInfo::getHTMLString( int startnum, int endnum, bool checkAbone )
 {
-    QString retHTML = QString::null;
+    QString retHTML;
 
     for ( int num = startnum; num <= endnum; num++ ) {
 
@@ -478,7 +478,7 @@
 /* return HTML strings that have ID = strid. */ /* public */
 QString DatInfo::getHtmlByID( const QString& strid, int &count )
 {
-    QString retHTML = QString::null;
+    QString retHTML;
     count = 0;
 
     for ( int i = 1; i <= m_thread->readNum(); i++ ) {
@@ -509,7 +509,7 @@
  */
 void DatInfo::getHTMLofOneRes( int num, bool checkAbone, QString& html )
 {
-    html = QString::null;
+    html.clear();
     QString titleHTML, bodyHTML;
     if ( getHTMLPrivate( num, checkAbone, titleHTML, bodyHTML ) == KITA_HTML_NOTPARSED ) return ;
 
@@ -574,10 +574,10 @@
     bool reverse,    /* reverse search */
     int& count, QString prestr )
 {
-    if ( !parseDat( rootnum ) ) return QString::null;
-    if ( checkAbonePrivate( rootnum ) ) return QString::null;
+    if ( !parseDat( rootnum ) ) return QString();
+    if ( checkAbonePrivate( rootnum ) ) return QString();
 
-    QString retstr = QString::null ;
+    QString retstr;
     count = 0;
     QStringList strlists;
 
@@ -890,9 +890,9 @@
 
     //   qDebug("parseDat %d",num);
 
-    QString subject = QString::null;
+    QString subject;
     Kita::parseResDat( m_resDatVec[ num ], subject );
-    if ( num == 1 && !subject.isNull() ) m_thread->setThreadName( subject );
+    if ( num == 1 && !subject.isEmpty() ) m_thread->setThreadName( subject );
     if ( m_resDatVec[ num ].broken ) m_broken = true;
 
     return true;

Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.h	2009-07-05 07:05:20 UTC (rev 2366)
@@ -151,8 +151,8 @@
         void stopLoading();
 
         /* string data */
-        const QString& getDat( int num );
-        const QString& getId( int num );
+        QString getDat( int num );
+        QString getId( int num );
         QString getPlainName( int num );
         QString getPlainTitle( int num );
         QString getPlainBody( int num );

Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -251,10 +251,10 @@
 
 
 /* public */
-const QString& DatManager::getDat( const KUrl& url, int num )
+QString DatManager::getDat( const KUrl& url, int num )
 {
     DatInfo * datInfo = getDatInfo( url );
-    if ( datInfo == NULL ) return QString::null;
+    if ( datInfo == NULL ) return QString();
 
     return datInfo->getDat( num );
 }
@@ -262,10 +262,10 @@
 
 
 /* public */
-const QString& DatManager::getId( const KUrl& url, int num )
+QString DatManager::getId( const KUrl& url, int num )
 {
     DatInfo * datInfo = getDatInfo( url );
-    if ( datInfo == NULL ) return QString::null;
+    if ( datInfo == NULL ) return QString();
 
     return datInfo->getId( num );
 }
@@ -275,7 +275,7 @@
 QString DatManager::getPlainName( const KUrl& url, int num )
 {
     DatInfo * datInfo = getDatInfo( url );
-    if ( datInfo == NULL ) return QString::null;
+    if ( datInfo == NULL ) return QString();
 
     return datInfo->getPlainName( num );
 }
@@ -285,7 +285,7 @@
 QString DatManager::getPlainBody( const KUrl& url, int num )
 {
     DatInfo * datInfo = getDatInfo( url );
-    if ( datInfo == NULL ) return QString::null;
+    if ( datInfo == NULL ) return QString();
 
     return datInfo->getPlainBody( num );
 }
@@ -295,7 +295,7 @@
 QString DatManager::getPlainTitle( const KUrl& url, int num )
 {
     DatInfo * datInfo = getDatInfo( url );
-    if ( datInfo == NULL ) return QString::null;
+    if ( datInfo == NULL ) return QString();
 
     return datInfo->getPlainTitle( num );
 }
@@ -308,7 +308,7 @@
     Kita::Thread* thread = Kita::Thread::getByURLNew( datURL );
     if ( thread != NULL ) return thread->threadName();
 
-    return QString::null;
+    return QString();
 }
 
 
@@ -337,7 +337,7 @@
 QString DatManager::getHtml( const KUrl& url, int startnum, int endnum, bool checkAbone )
 {
     DatInfo * datInfo = getDatInfo( url );
-    if ( datInfo == NULL ) return QString::null;
+    if ( datInfo == NULL ) return QString();
 
     return datInfo->getHTMLString( startnum, endnum, checkAbone );
 }
@@ -348,7 +348,7 @@
 QString DatManager::getHtmlByID( const KUrl& url, const QString& strid, int &count )
 {
     DatInfo * datInfo = getDatInfo( url );
-    if ( datInfo == NULL ) return QString::null;
+    if ( datInfo == NULL ) return QString();
 
     return datInfo->getHtmlByID( strid, count );
 }
@@ -359,7 +359,7 @@
 QString DatManager::getTreeByRes( const KUrl& url, const int rootnum, int &count )
 {
     DatInfo * datInfo = getDatInfo( url );
-    if ( datInfo == NULL ) return QString::null;
+    if ( datInfo == NULL ) return QString();
 
     return datInfo->getTreeByRes( rootnum, count );
 }
@@ -368,7 +368,7 @@
 QString DatManager::getTreeByResReverse( const KUrl& url, const int rootnum, int &count )
 {
     DatInfo * datInfo = getDatInfo( url );
-    if ( datInfo == NULL ) return QString::null;
+    if ( datInfo == NULL ) return QString();
 
     return datInfo->getTreeByResReverse( rootnum, count );
 }

Modified: kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/libkita/datmanager.h	2009-07-05 07:05:20 UTC (rev 2366)
@@ -44,8 +44,8 @@
         static void stopLoading( const KUrl& url );
 
         /* string data */
-        static const QString& getDat( const KUrl& url, int num );
-        static const QString& getId( const KUrl& url, int num );
+        static QString getDat( const KUrl& url, int num );
+        static QString getId( const KUrl& url, int num );
         static QString getPlainName( const KUrl& url, int num );
         static QString getPlainBody( const KUrl& url, int num );
         static QString getPlainTitle( const KUrl& url, int num );

Modified: kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/libkita/favoritethreads.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -187,6 +187,6 @@
     if ( getInstance() ->m_threadList.count() > i ) {
         return getInstance() ->m_threadList[ i ].m_datURL;
     } else {
-        return QString::null;
+        return QString();
     }
 }

Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -134,7 +134,7 @@
     QString& text
 )
 {
-    text = QString::null;
+    text.clear();
 
     unsigned int startPos, pos;
     const QChar *chpt = rawData.unicode();
@@ -179,7 +179,7 @@
                 QString tmpstr;
                 tmpstr = parseSpecialChar( chpt + i, pos );
 
-                if ( !tmpstr.isNull() ) {
+                if ( !tmpstr.isEmpty() ) {
                     text += rawData.mid( startPos, i - startPos ) + tmpstr;
                     startPos = i + pos;
                     i = startPos - 1;
@@ -208,7 +208,7 @@
     /* output */
     unsigned int& pos )
 {
-    QString retstr = QString::null;
+    QString retstr;
 
     if ( ( pos = isEqual( cdat , "&gt;" ) ) ) retstr = '>';
     else if ( ( pos = isEqual( cdat , "&lt;" ) ) ) retstr = '<';
@@ -333,7 +333,7 @@
    If mode = URLMODE_DAT, output is URL of dat file.
    If mode = URLMODE_THREAD, output is URL of read.cgi .
  
-   If url is NOT enrolled, return QString::null. 
+   If url is NOT enrolled, return QString(). 
    
 (ex.1)
  
@@ -369,9 +369,9 @@
     /* output */
     QString& refstr )
 {
-    refstr = QString::null;
+    refstr.clear();
 
-    if ( url.isEmpty() ) return QString::null;
+    if ( url.isEmpty() ) return QString();
 
     /* cache */
     if ( m_prevConvMode == mode && m_prevConvURL == url.prettyUrl() ) {
@@ -382,13 +382,13 @@
 
     /* Is board enrolled ? */
     BoardData* bdata = Kita::BoardManager::getBoardData( url );
-    if ( bdata == NULL ) return QString::null;
+    if ( bdata == NULL ) return QString();
 
     QString urlstr = url.prettyUrl();
 
     /* get thread & reference */
-    QString thread = QString::null;
-    QString refBase = QString::null;;
+    QString thread;
+    QString refBase;
 
     if ( urlstr.contains( "/dat/" ) ) {
 
@@ -405,7 +405,7 @@
                then, thread = 1096716679                                */
         case Board_MachiBBS:
             thread = url.queryItem( "KEY" );
-            refBase = QString::null;
+            refBase.clear();
             break;
 
             /* url = (hostname)/(rootPath)/(delimiter)/(bbsPath)/(thread_ID)/(refBase) */
@@ -417,9 +417,9 @@
         }
     }
 
-    if ( thread.isNull() ) return QString::null;
+    if ( thread.isEmpty() ) return QString();
 
-    if ( !refBase.isNull() ) {
+    if ( !refBase.isEmpty() ) {
 
         if ( refBase.at( 0 ) == '-' ) refstr = '1' + refBase;
         else refstr = refBase;
@@ -466,13 +466,13 @@
 
     QStringList list = url.fileName().split( '.' );
     if ( list.size() != 2 ) {
-        return QString::null;
+        return QString();
     }
     QString datName = list[ 0 ];
 
     url.cd( ".." );
     if ( url.fileName() != "dat" ) {
-        return QString::null;
+        return QString();
     }
 
     url.cd( ".." );
@@ -494,7 +494,7 @@
     if ( !qdir.exists() ) {
 
         QStringList pathList = targetPath.split( '/' );
-        QString path = QString::null;
+        QString path;
 
         for ( int i = 0; i < pathList.count(); ++i ) {
 
@@ -586,23 +586,23 @@
 /* init parser. Don't forget to call this before parsing. */
 void Kita::InitParseMachiBBS()
 {
-    m_machiSubject = QString::null;
-    m_machiLine = QString::null;
+    m_machiSubject.clear();
+    m_machiLine.clear();
 }
 
 QString Kita::ParseMachiBBSOneLine( const QString& inputLine, int& nextNum )
 {
-    QString ret = QString::null;
+    QString ret;
     m_machiLine += inputLine;
 
     int num = 0;
-    QString name = QString::null;
-    QString mail = QString::null;
-    QString date = QString::null;
-    QString time = QString::null;
-    QString id = QString::null;
-    QString host = QString::null;
-    QString message = QString::null;
+    QString name;
+    QString mail;
+    QString date;
+    QString time;
+    QString id;
+    QString host;
+    QString message;
 
     // Subject
     QRegExp title_regexp( "<title>(.*)</title>" );
@@ -662,28 +662,28 @@
     } else if ( regexp5.indexIn( m_machiLine ) != -1 ) { /* abone */
 
         num = regexp5.cap( 1 ).toInt();
-        m_machiLine = QString::null;
+        m_machiLine.clear();
         if ( num == nextNum ) return "abone<><><>abone<>";
-        else return QString::null;
+        else return QString();
 
     } else if ( title_regexp.indexIn( m_machiLine ) != -1 ) { /* get title */
 
         m_machiSubject = title_regexp.cap( 1 );
-        m_machiLine = QString::null;
-        return QString::null;
+        m_machiLine.clear();
+        return QString();
     }
-    else return QString::null;
+    else return QString();
 
     if ( num >= nextNum ) {
 
-        if ( num != 1 ) m_machiSubject = QString::null;
+        if ( num != 1 ) m_machiSubject.clear();
         ret += name + "<><>" + date + ' ' + time + " ID:" + id;
-        if ( !host.isNull() ) ret += " HOST:" + host;
+        if ( !host.isEmpty() ) ret += " HOST:" + host;
         ret += "<>" + message + "<>" + m_machiSubject;
         nextNum = num;
     }
 
-    m_machiLine = QString::null;
+    m_machiLine.clear();
     return ret;
 }
 
@@ -694,9 +694,9 @@
 
 QString Kita::ParseJBBSOneLine( const QString& line, int& nextNum )
 {
-    QString ret = QString::null;
+    QString ret;
     QStringList list = line.split( "<>" );
-    if ( list.size() != 7 ) return QString::null;
+    if ( list.size() != 7 ) return QString();
 
     int num = list[ 0 ].toInt();
     QString name = list[ 1 ];
@@ -706,7 +706,7 @@
     QString subject = list[ 5 ];
     QString id = list[ 6 ];
 
-    if ( num < nextNum ) return QString::null;
+    if ( num < nextNum ) return QString();
 
     /* remove tag */
     QRegExp rex( "<[^<]*>" );
@@ -729,9 +729,9 @@
 
 QString Kita::ParseFlashCGIOneLine( const QString& line )
 {
-    QString ret = QString::null;
+    QString ret;
     QStringList list = line.split( "<>" );
-    if ( list.size() != 13 ) return QString::null;
+    if ( list.size() != 13 ) return QString();
 
     QString name = list[ 0 ];
     QString mail = list[ 1 ];
@@ -746,7 +746,7 @@
     name.remove( rex );
 
     ret += name + "<>" + mail + "<>" + date + " ID:" + id;
-    if ( !host.isNull() ) ret += " HOST:" + host;
+    if ( !host.isEmpty() ) ret += " HOST:" + host;
     ret += "<>" + body + "<>" + subject;
 
     return ret;
@@ -857,7 +857,7 @@
 
     const QChar * chpt = resdat.name.unicode();
     unsigned int length = resdat.name.length();
-    resdat.nameHTML = QString::null;
+    resdat.nameHTML.clear();
 
     /* anchor */
     while ( parseResAnchor( chpt + i, length - i, linkstr, refNum, pos ) ) {
@@ -902,10 +902,10 @@
 void Kita::parseDateId( const QString& rawStr, RESDAT& resdat )
 {
     resdat.date = rawStr;
-    resdat.id = QString::null;
-    resdat.host = QString::null;
-    resdat.be = QString::null;
-    resdat.bepointmark = QString::null;
+    resdat.id.clear();
+    resdat.host.clear();
+    resdat.be.clear();
+    resdat.bepointmark.clear();
 
     const QChar *chpt = rawStr.unicode();
     unsigned int pos = 0, startpos = 0;
@@ -969,7 +969,7 @@
 */
 void Kita::parseBody( const QString &rawStr, RESDAT& resdat )
 {
-    resdat.bodyHTML = QString::null;
+    resdat.bodyHTML.clear();
 
     unsigned int startPos, pos;
     QString linkstr, linkurl;
@@ -1098,12 +1098,12 @@
 
     /*-----------------------------*/
 
-    linkstr = QString::null;
-    linkurl = QString::null;
+    linkstr.clear();
+    linkurl.clear();
 
-    QString retlinkstr = QString::null;
-    QString prefix = QString::null;
-    QString scheme = QString::null;
+    QString retlinkstr;
+    QString prefix;
+    QString scheme;
 
     if ( isEqual( cdat , "http://" ) ) {
         prefix = "http://";
@@ -1135,7 +1135,7 @@
     }
     if ( pos > length ) return false;
 
-    if ( !retlinkstr.isNull() ) DatToText( retlinkstr, linkstr );
+    if ( !retlinkstr.isEmpty() ) DatToText( retlinkstr, linkstr );
 
     linkurl = scheme + linkstr;
     linkstr = prefix + linkstr;
@@ -1189,7 +1189,7 @@
 
     if ( length == 0 ) return false;
 
-    linkstr = QString::null;
+    linkstr.clear();
     refNum[ 0 ] = 0;
     refNum[ 1 ] = 0;
     pos = 0;
@@ -1307,13 +1307,13 @@
 */
 void Kita::createTitleHTML( RESDAT& resdat, QString& titleHTML )
 {
-    titleHTML = QString::null;
+    titleHTML.clear();
     if ( !resdat.parsed ) return ;
 
     bool showMailAddress = Kita::Config::showMailAddress();
     bool useTableTag = Kita::Config::useStyleSheet();
 
-    if ( m_colonstr.isNull() ) {
+    if ( m_colonstr.isEmpty() ) {
         m_colonstr = utf8ToUnicode( KITAUTF8_COLON );
         m_colonnamestr = utf8ToUnicode( KITAUTF8_NAME );
     }
@@ -1335,11 +1335,11 @@
     if ( showMailAddress ) {
 
         titleHTML += resdat.nameHTML;
-        if ( !resdat.address.isNull() ) titleHTML += " [" + resdat.address + ']';
+        if ( !resdat.address.isEmpty() ) titleHTML += " [" + resdat.address + ']';
 
     } else { /* don't show mail address */
 
-        if ( resdat.address.isNull() ) {
+        if ( resdat.address.isEmpty() ) {
 
             titleHTML += "<span class=\"name_noaddr\">";
             titleHTML += resdat.name;
@@ -1362,7 +1362,7 @@
     if ( useTableTag ) titleHTML += "</td>";
 
     /* ID */
-    if ( !resdat.id.isNull() ) {
+    if ( !resdat.id.isEmpty() ) {
 
         if ( useTableTag ) titleHTML += "<td class=\"res_title_id\">";
         if ( resdat.id.count( "???" ) >= 1 ) titleHTML += " ID:" + resdat.id;
@@ -1371,7 +1371,7 @@
     }
 
     /* BE */
-    if ( !resdat.be.isNull() ) {
+    if ( !resdat.be.isEmpty() ) {
 
         if ( useTableTag ) titleHTML += "<td class=\"res_title_be\">";
         titleHTML += " <a href=\"#bepop" + resdat.be + "\">?" + resdat.bepointmark + "</a>";
@@ -1379,7 +1379,7 @@
     }
 
     /* host */
-    if ( !resdat.host.isNull() ) {
+    if ( !resdat.host.isEmpty() ) {
 
         if ( useTableTag ) titleHTML += "<td class=\"res_title_host\">";
         titleHTML += " HOST:" + resdat.host;
@@ -1396,7 +1396,7 @@
     if ( regexp.indexIn( line ) != -1 ) {
         return regexp.cap( 1 );
     } else {
-        return QString::null;
+        return QString();
     }
 }
 
@@ -1451,7 +1451,7 @@
   int old_length = isRawURI ? local.size() - 1 : local.length();
 
   if ( !old_length )
-    return segment.isNull() ? QString::null : QString(""); // differentiate null and empty
+    return segment.isEmpty() ? QString() : QString(""); // differentiate null and empty
 
   // a worst case approximation
   QChar *new_segment = new QChar[ old_length * 3 + 1 ];

Modified: kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/libkita/threadindex.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -104,12 +104,12 @@
 
     /* load thread name */
     QString subject = getSubjectPrivate( config );
-    if ( subject.isNull() && !thread->threadName().isNull() ) {
+    if ( subject.isEmpty() && !thread->threadName().isEmpty() ) {
         subject = thread->threadName();
         KConfigGroup group = config.group("");
         group.writeEntry( "Subject", subject );
     }
-    if ( subject.isNull() ) thread->setThreadName( "?" );
+    if ( subject.isEmpty() ) thread->setThreadName( "?" );
     else thread->setThreadName( subject );
 
     /* load res number */

Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -469,7 +469,7 @@
         QStringList list;
         QString str;
 
-        while ( !( str = stream.readLine() ).isNull() ) {
+        while ( !( str = stream.readLine() ).isEmpty() ) {
             if ( ! str.isEmpty() ) {
                 list << str;
             }
@@ -489,7 +489,7 @@
         QStringList list;
         QString str;
 
-        while ( !( str = stream.readLine() ).isNull() ) {
+        while ( !( str = stream.readLine() ).isEmpty() ) {
             if ( ! str.isEmpty() ) {
                 list << str;
             }
@@ -509,7 +509,7 @@
         QStringList list;
         QString str;
 
-        while ( !( str = stream.readLine() ).isNull() ) {
+        while ( !( str = stream.readLine() ).isEmpty() ) {
             if ( ! str.isEmpty() ) {
                 list << str;
             }
@@ -529,7 +529,7 @@
         QStringList list;
         QString str;
 
-        while ( !( str = stream.readLine() ).isNull() ) {
+        while ( !( str = stream.readLine() ).isEmpty() ) {
             if ( ! str.isEmpty() ) {
                 list << str;
             }

Modified: kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -63,7 +63,7 @@
     KitaThreadView* currentView = isThreadView( currentWidget() );
     if ( currentView ) viewMode = currentView->getViewMode();
 
-    if ( !refstr.isNull() ) {
+    if ( !refstr.isEmpty() ) {
         int i = refstr.indexOf( "-" );
         if ( i != -1 ) jumpNum = refstr.left( i ).toInt();
         else jumpNum = refstr.toInt();
@@ -195,8 +195,8 @@
     KitaTabWidgetBase::deleteWidget( w );
 
     if ( count() == 0 ) {
-        ViewMediator::getInstance()->setMainCaption( QString::null );
-        ViewMediator::getInstance()->setMainStatus( QString::null );
+        ViewMediator::getInstance()->setMainCaption( QString() );
+        ViewMediator::getInstance()->setMainStatus( QString() );
         ViewMediator::getInstance()->setMainURLLine( KUrl() );
 
         /* default view */

Modified: kita/branches/KITA-KDE4/kita/src/threadview.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/threadview.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/threadview.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -156,7 +156,7 @@
     m_viewmode = VIEWMODE_MAINVIEW;
     m_rescode = 200;
     m_serverTime = 0;
-    m_datURL = QString::null;
+    m_datURL.clear();
 
 }
 
@@ -284,7 +284,7 @@
 void KitaThreadView::setFocus()
 {
     ViewMediator::getInstance()->changeWriteTab( m_datURL );
-    showStatusBar( QString::null );
+    showStatusBar( QString() );
     m_threadPart->view() ->setFocus();
 }
 
@@ -386,9 +386,9 @@
 void KitaThreadView::showStatusBar( QString info )
 {
     if ( m_datURL.isEmpty() ) return ;
-    QString captionStr = QString::null;
-    QString infostr = QString::null;
-    QString errstr = QString::null;
+    QString captionStr;
+    QString infostr;
+    QString errstr;
     int viewPos = Kita::DatManager::getViewPos( m_datURL );
     int resNum = Kita::DatManager::getResNum( m_datURL );
     bool broken = Kita::DatManager::isBroken( m_datURL );
@@ -398,7 +398,7 @@
 
     case VIEWMODE_MAINVIEW:
 
-        errstr = QString::null;
+        errstr.clear();
         if ( m_rescode != 200 && m_rescode != 206 && m_rescode != 0 )
             errstr = QString( "Error %1" ).arg( m_rescode );
         if ( broken ) info += " This thread is broken.";
@@ -507,8 +507,8 @@
 
     /* jump */
     QString str = SearchCombo->currentText();
-    if ( str.isNull() ) return ;
     if ( str.isEmpty() ) return ;
+    if ( str.isEmpty() ) return ;
     if ( str.at( 0 ) == ':' ) return ;
     if ( str.at( 0 ) == '?' ) return ;
 

Modified: kita/branches/KITA-KDE4/kita/src/threadview.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/threadview.h	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/threadview.h	2009-07-05 07:05:20 UTC (rev 2366)
@@ -112,7 +112,7 @@
 private slots:
     void slotSearchButton();
     void slotBookmarkButtonClicked( bool on );
-    void slotWriteButtonClicked( QString resstr = QString::null );
+    void slotWriteButtonClicked( QString resstr = QString() );
     void slotComboActivated( int index );
     void slotUpdateInfo();
     void slotSearchPrivate( bool rev );

Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/writetabwidget.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -44,7 +44,7 @@
 void KitaWriteTabWidget::slotShowWriteView( const KUrl& url,
         const QString& resStr )
 {
-    openWriteView( url, resStr, QString::null );
+    openWriteView( url, resStr, QString() );
 }
 
 
@@ -186,8 +186,8 @@
     if ( view ) {
         QClipboard * clipboard = QApplication::clipboard();
         QString str = clipboard->text( QClipboard::Selection );
-        if ( str.isNull() ) str = clipboard->text( QClipboard::Clipboard );
-        if ( !str.isNull() ) {
+        if ( str.isEmpty() ) str = clipboard->text( QClipboard::Clipboard );
+        if ( !str.isEmpty() ) {
 
             QString msg = "\n> " + str.replace( '\n', "\n> " ) + '\n';
             view->insertMessage( msg );

Modified: kita/branches/KITA-KDE4/kita/src/writetabwidget.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/writetabwidget.h	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/writetabwidget.h	2009-07-05 07:05:20 UTC (rev 2366)
@@ -28,7 +28,7 @@
     void slotShowWriteView( const KUrl& url, const QString& resStr );
 
 private:
-    void openWriteView( const KUrl& url, const QString& resStr = QString::null, const QString& subject = QString::null );
+    void openWriteView( const KUrl& url, const QString& resStr = QString(), const QString& subject = QString() );
     KitaWriteView* findWriteView( const KUrl& url );
     KitaWriteView* isWriteView( QWidget* w );
 

Modified: kita/branches/KITA-KDE4/kita/src/writeview.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/writeview.cpp	2009-07-05 05:22:43 UTC (rev 2365)
+++ kita/branches/KITA-KDE4/kita/src/writeview.cpp	2009-07-05 07:05:20 UTC (rev 2366)
@@ -267,7 +267,7 @@
                                          "Do you want to close?" ),
                                    QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default ) ) {
     case QMessageBox::Ok:
-        setMessage( QString::null );
+        setMessage( QString() );
         m_parent->slotCloseCurrentTab();
         break;
     case QMessageBox::Cancel:
@@ -311,7 +311,7 @@
         logPostMessage();
 
         /* clear message */
-        setMessage( QString::null );
+        setMessage( QString() );
 
         /* reload thread */
         ViewMediator::getInstance()->openThread( m_datURL );
@@ -485,7 +485,7 @@
     } else {
         /* get code from title */
         QString title = resultTitle( response );
-        if ( title.isNull() ) return K2ch_Unknown;
+        if ( title.isEmpty() ) return K2ch_Unknown;
 
         if ( title.contains( errstr ) ) return K2ch_Error;
         if ( title.contains( truestr ) ) return K2ch_True;
@@ -529,7 +529,7 @@
             return regexp.cap( 1 ).replace( "<br>", "\n" );
         }
 
-        return QString::null;
+        return QString();
     }
 
     {
@@ -552,7 +552,7 @@
         return body_regexp.cap( 1 );
     }
 
-    return QString::null;
+    return QString();
 }
 
 
@@ -564,6 +564,6 @@
     if ( pos != -1 ) {
         return regexp.cap( 1 );
     } else {
-        return QString::null;
+        return QString();
     }
 }




Kita-svn メーリングリストの案内
Back to archive index