OSDN Git Service

reformat
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 2 Jan 2005 16:16:19 +0000 (16:16 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 2 Jan 2005 16:16:19 +0000 (16:16 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@1623 56b19765-1e22-0410-a548-a0f45d66c51a

82 files changed:
kita/src/favoritelistview.cpp
kita/src/kita.cpp
kita/src/kita_client.cpp
kita/src/kitaboardview.cpp
kita/src/kitaboardview.h
kita/src/kitaiface.h
kita/src/kitaimgtabwidget.cpp
kita/src/kitaimgtabwidget.h
kita/src/kitasubjecttabwidget.cpp
kita/src/kitasubjecttabwidget.h
kita/src/kitasubjectview.cpp
kita/src/kitasubjectview.h
kita/src/kitatabwidgetbase.cpp
kita/src/kitathreadtabwidget.cpp
kita/src/kitathreadtabwidget.h
kita/src/kitawritetabwidget.cpp
kita/src/kitawritetabwidget.h
kita/src/libkita/access.cpp
kita/src/libkita/access.h
kita/src/libkita/account.cpp
kita/src/libkita/account.h
kita/src/libkita/boardmanager.cpp
kita/src/libkita/boardmanager.h
kita/src/libkita/cache.cpp
kita/src/libkita/cache.h
kita/src/libkita/datinfo.cpp
kita/src/libkita/datinfo.h
kita/src/libkita/datmanager.cpp
kita/src/libkita/datmanager.h
kita/src/libkita/downloadmanager.cpp
kita/src/libkita/downloadmanager.h
kita/src/libkita/favoriteboards.cpp
kita/src/libkita/favoritethreads.cpp
kita/src/libkita/favoritethreads.h
kita/src/libkita/imgmanager.cpp
kita/src/libkita/imgmanager.h
kita/src/libkita/kita_misc.cpp
kita/src/libkita/kita_misc.h
kita/src/libkita/kitaconfig.cpp
kita/src/libkita/kitaconfig.h
kita/src/libkita/parsemisc.h
kita/src/libkita/qcp932codec.cpp
kita/src/libkita/qcp932codec.h
kita/src/libkita/signalcollection.cpp
kita/src/libkita/signalcollection.h
kita/src/libkita/tests/boardtest.cpp
kita/src/libkita/tests/boardtest.h
kita/src/libkita/tests/cachetest.cpp
kita/src/libkita/tests/favoritethreadstest.cpp
kita/src/libkita/tests/k2ch_articlefiletest.cpp
kita/src/libkita/tests/k2ch_articlefiletest.h
kita/src/libkita/tests/test_libkita.cpp
kita/src/libkita/tests/threadtest.cpp
kita/src/libkita/tests/threadtest.h
kita/src/libkita/tests/urlconverttest.cpp
kita/src/libkita/tests/urlconverttest.h
kita/src/libkita/thread.cpp
kita/src/libkita/thread.h
kita/src/libkita/threadindex.cpp
kita/src/libkita/threadindex.h
kita/src/libkita/threadinfo.cpp
kita/src/listviewitem.cpp
kita/src/listviewitem.h
kita/src/main.cpp
kita/src/part/kitadomtree.cpp
kita/src/part/kitadomtree.h
kita/src/part/kitahtmlpart.cpp
kita/src/part/kitahtmlpart.h
kita/src/part/kitahtmlview.cpp
kita/src/part/kitahtmlview.h
kita/src/part/kitaimgview.cpp
kita/src/part/kitathreadview.cpp
kita/src/part/kitathreadview.h
kita/src/part/kitawritedialogbase.ui.h
kita/src/part/kitawriteview.cpp
kita/src/part/kitawriteview.h
kita/src/prefs/aboneprefpage.cpp
kita/src/prefs/loginprefpage.cpp
kita/src/prefs/loginprefpage.h
kita/src/prefs/prefs.cpp
kita/src/prefs/prefs.h
kita/src/threadlistview.cpp

index 3ce8872..fc7c5fc 100644 (file)
@@ -62,7 +62,7 @@ void FavoriteListView::update()
 
     subjectList->clear();
 
-    for( int i = 0; FavoriteThreads::count() > i; i++ ) {
+    for ( int i = 0; FavoriteThreads::count() > i; i++ ) {
         QString datURL = FavoriteThreads::getDatURL( i );
 
         QDateTime since;
@@ -91,9 +91,9 @@ void FavoriteListView::loadThread( QListViewItem* item )
 {
     if ( ! item ) return ;
 
-    for( int i = 0; FavoriteThreads::count() > i; i++ ) {
+    for ( int i = 0; FavoriteThreads::count() > i; i++ ) {
         QString datURL = FavoriteThreads::getDatURL( i );
-        qDebug("FavoriteListView::loadThread(() datURL = %s", datURL.latin1());
+        qDebug( "FavoriteListView::loadThread(() datURL = %s", datURL.latin1() );
 
         if ( datURL == item->text( Col_DatURL ) ) {
             emit openURLRequestExt( datURL, KParts::URLArgs(), "kita_open_2chthread", 0 );
@@ -153,9 +153,9 @@ void FavoriteListView::slotContextMenuRequested( QListViewItem* item, const QPoi
         clipboard->setText( threadURL );
         break;
     case Menu_CopyTitleAndURL:
-       cliptxt = Kita::DatManager::threadName( datURL ) + "\n" + threadURL;
-       clipboard->setText( cliptxt , QClipboard::Clipboard );
-       clipboard->setText( cliptxt , QClipboard::Selection );
+        cliptxt = Kita::DatManager::threadName( datURL ) + "\n" + threadURL;
+        clipboard->setText( cliptxt , QClipboard::Clipboard );
+        clipboard->setText( cliptxt , QClipboard::Selection );
         break;
     case Menu_RemoveFromFavorites:
         emit bookmarked( datURL, false );
@@ -169,9 +169,9 @@ void FavoriteListView::slotReloadButton()
 {
     QValueList<QString> boardList;
 
-    for( int i = 0; FavoriteThreads::count() > i; i++ ) {
+    for ( int i = 0; FavoriteThreads::count() > i; i++ ) {
         QString datURL = FavoriteThreads::getDatURL( i );
-        qDebug("FavoriteListView::update() datURL = %s", datURL.latin1());
+        qDebug( "FavoriteListView::update() datURL = %s", datURL.latin1() );
         QString boardURL = Kita::datToBoard( datURL );
         if ( boardList.contains( boardURL ) == 0 ) {
             boardList.append( boardURL );
@@ -181,10 +181,10 @@ void FavoriteListView::slotReloadButton()
     QValueList<QString>::const_iterator it2;
     for ( it2 = boardList.begin(); it2 != boardList.end(); ++it2 ) {
 
-       bool online = TRUE;
-       QPtrList<Kita::Thread> threadList;
-       QPtrList<Kita::Thread> tmpList;
-       Kita::BoardManager::getThreadList( ( *it2 ), FALSE, online, threadList, tmpList );
+        bool online = TRUE;
+        QPtrList<Kita::Thread> threadList;
+        QPtrList<Kita::Thread> tmpList;
+        Kita::BoardManager::getThreadList( ( *it2 ), FALSE, online, threadList, tmpList );
     }
 }
 
index ecf779b..b80ba14 100644 (file)
@@ -70,7 +70,7 @@ KitaMainWindow::KitaMainWindow()
         m_printer( 0 )
 {
     // FIXME: merge *.po
-    KGlobal::locale()->insertCatalogue( "kitapart" );
+    KGlobal::locale() ->insertCatalogue( "kitapart" );
 
     // accept dnd
     setAcceptDrops( true );
@@ -230,7 +230,7 @@ KitaMainWindow::~KitaMainWindow()
     saveFavoriteBoards();
 
     saveFavorites();
-    
+
     saveCache();
 
     saveMainWindowSettings( KGlobal::config(), "MainWindow" );
@@ -336,12 +336,12 @@ void KitaMainWindow::setupActions()
     KStdAction::configureToolbars( this, SLOT( optionsConfigureToolbars() ), actionCollection() );
     KStdAction::preferences( this, SLOT( optionsPreferences() ), actionCollection() );
 
-/*    new KAction( i18n( "Edit Favorites" ),
-                 0,
-                 this,
-                 SLOT( favoritesEdit() ),
-                 actionCollection(),
-                 "favorites_edit" );*/
+    /*    new KAction( i18n( "Edit Favorites" ),
+                     0,
+                     this,
+                     SLOT( favoritesEdit() ),
+                     actionCollection(),
+                     "favorites_edit" );*/
 
     new KAction( i18n( "Load board list" ),
                  0,
@@ -792,7 +792,7 @@ void KitaMainWindow::slotOpenURLRequestExt(
         QMessageBox::warning( this,
                               "Kita",
                               i18n( "be.2ch.net is currently not supported." ) );
-        return;
+        return ;
     }
 
     kdDebug() << QString( "Requested OpenURL: \"%1\"" ).arg( url.url() ) << endl;
@@ -831,63 +831,63 @@ void KitaMainWindow::slotOpenURLRequestExt(
     }
 
     /* open thread with new thread tab */
-    if ( Kita::DatManager::isThreadEnrolled( url ) ){
-       m_threadDock->slotShowThread( url, true );
-       return;
+    if ( Kita::DatManager::isThreadEnrolled( url ) ) {
+        m_threadDock->slotShowThread( url, true );
+        return ;
     }
 
-        /* bmp file */
-        if ( Kita::ImgManager::isBMP( url ) ) {
-            QMessageBox::warning( this,
-                                  "Kita",
-                                  i18n( "This is a BMP file. It might contain a Troy." ) );
-            return ;
-        }
+    /* bmp file */
+    if ( Kita::ImgManager::isBMP( url ) ) {
+        QMessageBox::warning( this,
+                              "Kita",
+                              i18n( "This is a BMP file. It might contain a Troy." ) );
+        return ;
+    }
 
 
-        /* open with image viewer */
-        /* if usr1 == 0, image viewer is hidden. */
-        /* usrUrl1 is datURL.                    */
-        if ( KitaConfig::useImageViewer() ) {
-            if ( Kita::ImgManager::isImgFile( url, FALSE ) ) {
+    /* open with image viewer */
+    /* if usr1 == 0, image viewer is hidden. */
+    /* usrUrl1 is datURL.                    */
+    if ( KitaConfig::useImageViewer() ) {
+        if ( Kita::ImgManager::isImgFile( url, FALSE ) ) {
 
-                if ( !usr1 ) m_imgDock->slotHideDock();
-                m_imgDock->slotOpenURL( url, usrUrl1, usr1 );
-                return ;
-            }
+            if ( !usr1 ) m_imgDock->slotHideDock();
+            m_imgDock->slotOpenURL( url, usrUrl1, usr1 );
+            return ;
         }
+    }
 
-        if ( mimetype == QString::null ) {
+    if ( mimetype == QString::null ) {
 #if KDE_IS_VERSION( 3, 2, 0 )
-            mimetype = KIO::NetAccess::mimetype( url , this );
+        mimetype = KIO::NetAccess::mimetype( url , this );
 #else
-            mimetype = KIO::NetAccess::mimetype( url );
+        mimetype = KIO::NetAccess::mimetype( url );
 #endif
 
-        }
-        kdDebug() << QString( "queried MIME type: \"%1\"" ).arg( mimetype ) << endl;
-
-        /* open with kpart */
-        if ( KitaConfig::usePart() ) {
-            if ( KitaConfig::partMimeList().find( mimetype ) != KitaConfig::partMimeList().end() ) {
-                KService::Ptr service = KServiceTypeProfile::preferredService( mimetype, "KParts/ReadOnlyPart" );
-                if ( service ) {
-                    QString libName = QFile::encodeName( service->library() );
-
-                    if ( !KitaConfig::useKitaNavi() ) m_threadDock->slotShowPart( url, libName, mimetype );
-                    else m_naviDock ->slotShowPart( url, libName, mimetype );
-                    return ;
-                }
+    }
+    kdDebug() << QString( "queried MIME type: \"%1\"" ).arg( mimetype ) << endl;
+
+    /* open with kpart */
+    if ( KitaConfig::usePart() ) {
+        if ( KitaConfig::partMimeList().find( mimetype ) != KitaConfig::partMimeList().end() ) {
+            KService::Ptr service = KServiceTypeProfile::preferredService( mimetype, "KParts/ReadOnlyPart" );
+            if ( service ) {
+                QString libName = QFile::encodeName( service->library() );
+
+                if ( !KitaConfig::useKitaNavi() ) m_threadDock->slotShowPart( url, libName, mimetype );
+                else m_naviDock ->slotShowPart( url, libName, mimetype );
+                return ;
             }
         }
+    }
 
-        if ( KitaConfig::copyOnClick() ) {
-            QClipboard * clipboard = QApplication::clipboard();
-            clipboard->setText( url.prettyURL(), QClipboard::Clipboard );
-            clipboard->setText( url.prettyURL(), QClipboard::Selection );
-        } else {
-            KRun::runURL( url, mimetype );
-        }
+    if ( KitaConfig::copyOnClick() ) {
+        QClipboard * clipboard = QApplication::clipboard();
+        clipboard->setText( url.prettyURL(), QClipboard::Clipboard );
+        clipboard->setText( url.prettyURL(), QClipboard::Selection );
+    } else {
+        KRun::runURL( url, mimetype );
+    }
 }
 
 
@@ -1210,7 +1210,7 @@ void KitaMainWindow::login()
 
 void KitaMainWindow::favoritesEdit()
 {
-    FavoritesWindow* window = new FavoritesWindow( this );
+    FavoritesWindow * window = new FavoritesWindow( this );
     window->show();
 }
 
index 244f271..d07df18 100644 (file)
@@ -1,21 +1,21 @@
 /***************************************************************************
- *   Copyright (C) 2003 by Hideki Ikemoto                                  *
- *   ikemo@users.sourceforge.jp                                            *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2003 by Hideki Ikemoto                                  *
+*   ikemo@users.sourceforge.jp                                            *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 
 #include <kapplication.h>
 #include <dcopclient.h>
 #include <qdatastream.h>
 #include <qstring.h>
 
-int main(int argc, char **argv)
+int main( int argc, char **argv )
 {
-    KApplication app(argc, argv, "kita_client", false);
+    KApplication app( argc, argv, "kita_client", false );
 
     // get our DCOP client and attach so that we may use it
     DCOPClient *client = app.dcopClient();
@@ -23,12 +23,12 @@ int main(int argc, char **argv)
 
     // do a 'send' for now
     QByteArray data;
-    QDataStream ds(data, IO_WriteOnly);
-    if (argc > 1)
-        ds << QString(argv[1]);
+    QDataStream ds( data, IO_WriteOnly );
+    if ( argc > 1 )
+        ds << QString( argv[ 1 ] );
     else
-        ds << QString("http://www.kde.org");
-    client->send("kita", "KitaIface", "openURL(QString)", data);
+        ds << QString( "http://www.kde.org" );
+    client->send( "kita", "KitaIface", "openURL(QString)", data );
 
     return app.exec();
 }
index 10b1c70..3973e45 100644 (file)
@@ -62,10 +62,10 @@ KitaBoardView::KitaBoardView( QWidget *parent, const char *name )
     m_boardList->header() ->setClickEnabled( FALSE );
 
     /* default colors */
-    QColorGroup colors = m_boardList->viewport()->colorGroup();
+    QColorGroup colors = m_boardList->viewport() ->colorGroup();
     m_textColor = colors.text();
     m_baseColor = colors.base();
-    m_backColor = m_boardList->viewport()->paletteBackgroundColor();
+    m_backColor = m_boardList->viewport() ->paletteBackgroundColor();
     m_altColor = m_boardList->alternateBackground();
 
     Kita::SignalCollection* signalCollection = Kita::SignalCollection::getInstance();
@@ -132,11 +132,11 @@ bool KitaBoardView::downloadBoardList()
     QString url = KitaConfig::boardListURL();
     if ( !
 #if KDE_IS_VERSION( 3, 2, 0 )
-        KIO::NetAccess::download( url, tmpFile, NULL )
+            KIO::NetAccess::download( url, tmpFile, NULL )
 #else
-        KIO::NetAccess::download( url, tmpFile )
-#endif  
-       ) {
+            KIO::NetAccess::download( url, tmpFile )
+#endif
+       ) {
         return FALSE;
     }
 
@@ -156,7 +156,7 @@ bool KitaBoardView::downloadBoardList()
     QValueList<Kita::Category>::iterator it;
 
     /* Are there new boards or moved boards ? */
-    QString newBoards = QString::null;    
+    QString newBoards = QString::null;
     QString oldBoards = QString::null;
     for ( it = categoryList.begin(); it != categoryList.end(); ++it ) {
         Kita::Category category = ( *it );
@@ -165,16 +165,16 @@ bool KitaBoardView::downloadBoardList()
 
         int count = 0;
         for ( QValueList<QString>::iterator it2 = board_url_list.begin();
-             it2 != board_url_list.end(); ++it2 ) {
-           
+                it2 != board_url_list.end(); ++it2 ) {
+
             QString boardURL = *it2;
             QString boardName = category.boardNameList[ count ];
             QString oldURL;
             int ret = Kita::BoardManager::enrollBoard( boardURL, boardName, oldURL, Kita::Board_Unknown,
-                                                      TRUE /* test only */
-               );
-            if( ret == Kita::Board_enrollNew ) newBoards += boardName + "  ( " + category.category_name + " )  " + boardURL + "\n";
-            if( ret == Kita::Board_enrollMoved ) oldBoards += boardName + "  ( " + category.category_name + " )  " + oldURL + "  ->  " + boardURL + "\n";
+                      TRUE /* test only */
+                                                     );
+            if ( ret == Kita::Board_enrollNew ) newBoards += boardName + "  ( " + category.category_name + " )  " + boardURL + "\n";
+            if ( ret == Kita::Board_enrollMoved ) oldBoards += boardName + "  ( " + category.category_name + " )  " + oldURL + "  ->  " + boardURL + "\n";
             count++;
         }
     }
@@ -182,26 +182,26 @@ bool KitaBoardView::downloadBoardList()
     const int maxNewBoard = 64;
 
     /* show new board names */
-    if( newBoards != QString::null && newBoards.contains( "\n" ) < maxNewBoard ){
+    if ( newBoards != QString::null && newBoards.contains( "\n" ) < maxNewBoard ) {
 
-        QStringList boardList = QStringList::split( "\n", newBoards);
+        QStringList boardList = QStringList::split( "\n", newBoards );
         KMessageBox::informationList( this,
                                       i18n( "New boards:\n\n" ),
                                       boardList, "Kita" );
     }
 
-    /* show moved board names */    
-    if( oldBoards != QString::null ){
+    /* show moved board names */
+    if ( oldBoards != QString::null ) {
 
-        QStringList boardList = QStringList::split( "\n", oldBoards);
+        QStringList boardList = QStringList::split( "\n", oldBoards );
         KMessageBox::informationList( this,
                                       i18n( "These boards were moved:\n\n" )
                                       + i18n( "\nPlease create the backup of those caches.\n" ),
                                       boardList, "Kita" );
     }
 
-    if( ( newBoards != QString::null && newBoards.contains( "\n" ) < maxNewBoard )
-       || oldBoards != QString::null ){
+    if ( ( newBoards != QString::null && newBoards.contains( "\n" ) < maxNewBoard )
+            || oldBoards != QString::null ) {
 
         QMessageBox mb( "kita", i18n( "Do you really want to update board list?" ),
                         QMessageBox::Information,
@@ -212,23 +212,22 @@ bool KitaBoardView::downloadBoardList()
         mb.setButtonText( QMessageBox::No, i18n( "Copy" ) );
 
         int ret;
-        while( ( ret = mb.exec() ) == QMessageBox::No ){
+        while ( ( ret = mb.exec() ) == QMessageBox::No ) {
             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 );
+                          + i18n( "These boards were moved:\n\n" ) + oldBoards;
+            QApplication::clipboard() ->setText( str , QClipboard::Clipboard );
+            QApplication::clipboard() ->setText( str , QClipboard::Selection );
         }
 
-        if( ret == QMessageBox::Cancel ) return FALSE;
-    }
-    else if( newBoards == QString::null && oldBoards == QString::null ){
-       
-       QMessageBox::information( this, "Kita", i18n( "no new boards" ) );
-       return FALSE;
+        if ( ret == QMessageBox::Cancel ) return FALSE;
+    } else if ( newBoards == QString::null && oldBoards == QString::null ) {
+
+        QMessageBox::information( this, "Kita", i18n( "no new boards" ) );
+        return FALSE;
     }
 
     /*------------------------------------------------*/
-    
+
     /* save config */
     QString configPath = locateLocal( "appdata", "board_list" );
     KSimpleConfig config( configPath );
@@ -246,7 +245,7 @@ bool KitaBoardView::downloadBoardList()
         QValueList<QString>::iterator it2;
         int count = 0;
         for ( it2 = board_url_list.begin(); it2 != board_url_list.end(); ++it2 ) {
-            QString key = QString( "item%1").arg( count );
+            QString key = QString( "item%1" ).arg( count );
             QString boardURL = *it2;
             QString boardName = category.boardNameList[ count ];
             QStringList tmpList;
@@ -280,24 +279,24 @@ bool KitaBoardView::downloadBoardList()
 
 void KitaBoardView::updateBoardList()
 {
-    if( downloadBoardList() ) showBoardList();
+    if ( downloadBoardList() ) showBoardList();
 }
 
 void KitaBoardView::showBoardList()
 {
     /* color setting */
-/*
-    m_textColor = QColor( "white" );
-    m_baseColor = QColor( "red" );
-    m_backColor = QColor( "yellow" );
-    m_altColor = QColor( "blue" );    
-*/
+    /*
+        m_textColor = QColor( "white" );
+        m_baseColor = QColor( "red" );
+        m_backColor = QColor( "yellow" );
+        m_altColor = QColor( "blue" );    
+    */
     /*-------------------------------------------------*/
 
     /* set background color */
-    m_boardList->viewport()->setPaletteBackgroundColor( m_backColor );
+    m_boardList->viewport() ->setPaletteBackgroundColor( m_backColor );
     m_boardList->setAlternateBackground( m_altColor );
-    
+
     // clear list
     m_boardList->clear();
     m_favorites = NULL;
@@ -322,8 +321,8 @@ void KitaBoardView::showBoardList()
             if ( value.count() != 2 ) {
                 break;
             }
-            QString boardURL = value[0];
-            QString boardName = value[1];
+            QString boardURL = value[ 0 ];
+            QString boardName = value[ 1 ];
             QString oldURL;
             Kita::BoardManager::enrollBoard( boardURL, boardName, oldURL );
             Kita::BoardManager::loadBBSHistory( boardURL );
@@ -369,11 +368,11 @@ void KitaBoardView::loadExtBoard()
                     QString board_url = list[ 1 ];
 
                     Kita::ListViewItem* tmpitem = new Kita::ListViewItem( categoryItem, board_title, board_url );
-                       tmpitem->setColor( m_textColor, m_baseColor );
+                    tmpitem->setColor( m_textColor, m_baseColor );
                     QString oldURL;
                     int type = Kita::Board_Unknown;
-                    if( list.size() == 3 ) type = list[ 2 ].toInt();
-                    Kita::BoardManager::enrollBoard( board_url, board_title, oldURL, type );       
+                    if ( list.size() == 3 ) type = list[ 2 ].toInt();
+                    Kita::BoardManager::enrollBoard( board_url, board_title, oldURL, type );
                 }
             }
         }
@@ -393,7 +392,7 @@ QValueList<Kita::Category> KitaBoardView::getCategoryList( const QString& html )
     Kita::Category current_category;
     current_category.category_name = QString::null;
     current_category.boardNameList.clear();
-    current_category.boardURLList.clear();   
+    current_category.boardURLList.clear();
     for ( it = lines.begin(); it != lines.end(); ++it ) {
         QString category_name = getCategory( *it );
         if ( category_name != QString::null ) {
@@ -402,17 +401,17 @@ QValueList<Kita::Category> KitaBoardView::getCategoryList( const QString& html )
             }
             current_category.category_name = category_name;
             current_category.boardNameList.clear();
-            current_category.boardURLList.clear();   
+            current_category.boardURLList.clear();
         } else {
-           QRegExp regexp( "<A HREF=([^ ]*).*>(.*)</A>", false );
-           if ( regexp.search( ( *it ) ) != -1 ) {
-               QString url = regexp.cap( 1 );
-               QString title = regexp.cap( 2 );
-               if( isBoardURL( url ) && current_category.category_name != QString::null ){
-                   current_category.boardNameList.append( title );
-                   current_category.boardURLList.append( url );
-               }
-           }
+            QRegExp regexp( "<A HREF=([^ ]*).*>(.*)</A>", false );
+            if ( regexp.search( ( *it ) ) != -1 ) {
+                QString url = regexp.cap( 1 );
+                QString title = regexp.cap( 2 );
+                if ( isBoardURL( url ) && current_category.category_name != QString::null ) {
+                    current_category.boardNameList.append( title );
+                    current_category.boardURLList.append( url );
+                }
+            }
         }
     }
     return result;
@@ -423,7 +422,7 @@ void KitaBoardView::refreshFavoriteBoards()
     if ( ! m_favorites ) {
         m_favorites = new Kita::ListViewItem( m_boardList, 0, i18n( "Favorites" ) );
     }
-    m_favorites->setColor( m_textColor, m_baseColor );     
+    m_favorites->setColor( m_textColor, m_baseColor );
 
     do {
         QListViewItem* child = m_favorites->firstChild();
@@ -515,7 +514,7 @@ void KitaBoardView::slotContextMenuRequested( QListViewItem* item, const QPoint&
         break;
     case Menu_CopyTitleAndURL:
         clipboard->setText( boardName + "\n" + boardURL.prettyURL(), QClipboard::Clipboard );
-        clipboard->setText( boardName + "\n" + boardURL.prettyURL(), QClipboard::Selection );  
+        clipboard->setText( boardName + "\n" + boardURL.prettyURL(), QClipboard::Selection );
         break;
     case Menu_AddToFavorites:
         Kita::FavoriteBoards::append( boardURL );
index d864e46..477afd3 100644 (file)
@@ -42,7 +42,7 @@ class KitaBoardView : public KitaBoardViewBase
     QColor m_baseColor;
     QColor m_backColor;
     QColor m_altColor;
-    
+
     QString getCategory( const QString& line ) const;
     QString getBoardURL( const QString& line ) const;
     bool isBoardURL( const QString& url ) const;
index af86ed6..ba36e30 100644 (file)
@@ -1,12 +1,12 @@
 /***************************************************************************
- *   Copyright (C) 2003 by Hideki Ikemoto                                  *
- *   ikemo@users.sourceforge.jp                                            *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2003 by Hideki Ikemoto                                  *
+*   ikemo@users.sourceforge.jp                                            *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 
 #ifndef _KITAIFACE_H_
 #define _KITAIFACE_H_
 
 class KitaIface : virtual public DCOPObject
 {
-  K_DCOP
+    K_DCOP
 public:
 
 k_dcop:
-  virtual void openURL(QString url) = 0;
+    virtual void openURL( QString url ) = 0;
 };
 
 #endif // _KITAIFACE_H_
index f1a56b1..414c0c9 100644 (file)
@@ -343,7 +343,7 @@ void KitaImgTabWidget::setupActions()
 
     QStringList selectlist;
     selectlist << "20%" << "25%" << "50%" << "75%" << "100%" << "125%"
-               << "150%" << "175%" << "200%" << "300%" << "400%" << "500%" ;
+    << "150%" << "175%" << "200%" << "300%" << "400%" << "500%" ;
     m_sizeaction->setItems( selectlist );
 }
 
index 0eeeb6e..450a892 100644 (file)
@@ -25,7 +25,7 @@ class KitaImgTabWidget : public KitaTabWidgetBase
     Q_OBJECT
 
     KSelectAction* m_sizeaction;
-    
+
 public:
     KitaImgTabWidget( QWidget* parent, const char* name = 0, WFlags fl = 0 );
     ~KitaImgTabWidget();
index 6881a86..0097a5f 100644 (file)
@@ -54,7 +54,7 @@ void KitaSubjectTabWidget::loadBoard( const KURL& boardURL, bool withNewTab )
             if ( !isSubjectView( w ) ) w = page( count() - 2 );
 
             view = static_cast< KitaSubjectView *>( w );
-            view->init();          
+            view->init();
             setTabLabel( view, boardName );
         }
     }
@@ -150,7 +150,7 @@ void KitaSubjectTabWidget::setupActions()
                  SLOT( slotShowOldLogs() ),
                  actionCollection(),
                  "subjectview_showoldlogs" );
-    
+
     new KAction( i18n( "Show Title Image" ),
                  0,
                  this,
@@ -185,8 +185,8 @@ void KitaSubjectTabWidget::slotNewThread()
 void KitaSubjectTabWidget::slotShowOldLogs( int idx )
 {
     KitaSubjectView * view;
-    if( idx == -1 ) view = isSubjectView( currentPage() );
-    else  view = isSubjectView( page( idx ) );
+    if ( idx == -1 ) view = isSubjectView( currentPage() );
+    else view = isSubjectView( page( idx ) );
     if ( view ) view->toggleShowOldLogs();
 }
 
@@ -194,13 +194,13 @@ void KitaSubjectTabWidget::slotShowOldLogs( int idx )
 void KitaSubjectTabWidget::slotShowTitleImg( int idx )
 {
     KitaSubjectView * view;
-    if( idx == -1 ) view = isSubjectView( currentPage() );
-    else  view = isSubjectView( page( idx ) );
-    if ( view ){
+    if ( idx == -1 ) view = isSubjectView( currentPage() );
+    else view = isSubjectView( page( idx ) );
+    if ( view ) {
         KURL imgURL = Kita::BoardManager::titleImgURL( view->boardURL() );
-       if( !imgURL.isEmpty() ) {
-           emit openURLRequestExt( imgURL, KParts::URLArgs(), QString::null, 1, 0, view->boardURL() );
-       }
+        if ( !imgURL.isEmpty() ) {
+            emit openURLRequestExt( imgURL, KParts::URLArgs(), QString::null, 1, 0, view->boardURL() );
+        }
     }
 }
 
@@ -256,7 +256,7 @@ void SubjectTabBar::showPopupMenu( int idx, QPoint global )
     popup->insertItem( i18n( "Open with Web Browser" ), MENU_OPENBROWSER );
     popup->insertItem( i18n( "Copy title and URL" ), MENU_COPYTITLE );
     popup->insertItem( i18n( "Show Title Image" ) , MENU_SHOWTITLEIMG );
-    
+
     popup->insertSeparator();
     collection->action( "tab_configkeys" ) ->plug( popup );
 
@@ -271,7 +271,7 @@ void SubjectTabBar::showPopupMenu( int idx, QPoint global )
     case MENU_CLOSEOTHER: tabwidget->slotCloseOtherTab( idx ); break;
     case MENU_CLOSERIGHT: tabwidget->slotCloseRightTab( idx ); break;
     case MENU_CLOSELEFT: tabwidget->slotCloseLeftTab( idx ); break;
-    case MENU_SHOWOLDLOGS: tabwidget->slotShowOldLogs( idx ); break;           
+    case MENU_SHOWOLDLOGS: tabwidget->slotShowOldLogs( idx ); break;
     case MENU_SHOWTITLEIMG: tabwidget->slotShowTitleImg( idx ); break;
     case MENU_OPENBROWSER:
         KRun::runURL( subjectView->boardURL(), "text/html" );
index 85d2eeb..f5cdf98 100644 (file)
@@ -38,7 +38,7 @@ private:
 protected:
     virtual void deleteWidget( QWidget* w );
 
-    
+
     /* tab actions */
 
 private:
@@ -49,7 +49,7 @@ public slots:
     void slotFocusSearchCombo();
     void slotNewThread();
     void slotShowOldLogs( int idx = -1 );
-    void slotShowTitleImg( int idx  = -1 );
+    void slotShowTitleImg( int idx = -1 );
 };
 
 /*--------------------------------------------------*/
index af49f04..61f2687 100644 (file)
@@ -93,9 +93,9 @@ KitaSubjectView::~KitaSubjectView()
 /* public */
 void KitaSubjectView::init()
 {
-    m_unreadNum =  0;
+    m_unreadNum = 0;
     m_readNum = 0;
-    m_newNum =  0;
+    m_newNum = 0;
     m_showOldLogs = FALSE;
     m_enableSizeChange = FALSE;
 }
@@ -135,7 +135,7 @@ void KitaSubjectView::loadThread( QListViewItem* item )
 
     if ( KitaConfig::alwaysUseTab() ) {
         emit openURLRequestExt( datURL.prettyURL(), KParts::URLArgs(), "kita_open_2chthread", 1 );
-    } else { 
+    } else {
         emit openURLRequestExt( datURL.prettyURL(), KParts::URLArgs(), "kita_open_2chthread", 0 );
     }
 }
@@ -186,14 +186,14 @@ void KitaSubjectView::loadBoard( const KURL& url, bool online )
 
     QDateTime current = QDateTime::currentDateTime();
     unsigned int countNew = threadList.count();
-    unsigned int countOld = oldLogList.count();    
+    unsigned int countOld = oldLogList.count();
     for ( unsigned i = 0; i < countNew + countOld; i++ ) {
 
         Kita::Thread* thread = i < countNew ? threadList.at( i ) : oldLogList.at( i - countNew );
         Kita::ThreadListViewItem* item = new Kita::ThreadListViewItem( subjectList );
-       int id = ( i < countNew ? i + 1 : 0 );
-       int order = i + 1;
-       updateListViewItem( item, thread, current, id, order );
+        int id = ( i < countNew ? i + 1 : 0 );
+        int order = i + 1;
+        updateListViewItem( item, thread, current, id, order );
     }
 
     if ( HideButton->isOn() ) {
@@ -274,15 +274,15 @@ void KitaSubjectView::slotUpdateSubject( const KURL& url )
             case ts_hasunread : m_unreadNum--; break;
             }
 
-           Kita::Thread* thread = Kita::Thread::getByURLNew( datURL );
-           if( thread == NULL ) return;
-           int id = item->text( Col_ID ).toInt();
-           int order = item->text( Col_IDOrder ).toInt();
-           updateListViewItem( item, thread, current, id, order );
+            Kita::Thread* thread = Kita::Thread::getByURLNew( datURL );
+            if ( thread == NULL ) return ;
+            int id = item->text( Col_ID ).toInt();
+            int order = item->text( Col_IDOrder ).toInt();
+            updateListViewItem( item, thread, current, id, order );
 
             UpdateKindLabel();
 
-           return;
+            return ;
         }
     }
 }
@@ -291,10 +291,10 @@ void KitaSubjectView::slotUpdateSubject( const KURL& url )
 
 /* if id == 0, this thread is old thread. */
 /* private */
-void KitaSubjectView::updateListViewItem( QListViewItem* item, Kita::Thread* thread, const QDateTime& current, int id, int order)
+void KitaSubjectView::updateListViewItem( QListViewItem* item, Kita::Thread* thread, const QDateTime& current, int id, int order )
 {
     KURL datURL = thread->datURL();
-    
+
     QDateTime since;
     since.setTime_t( Kita::datToSince( datURL ) );
     QString threadName = thread->threadName();
@@ -303,7 +303,7 @@ void KitaSubjectView::updateListViewItem( QListViewItem* item, Kita::Thread* thr
     int viewPos = thread->viewPos();
     double speed = resNum / ( since.secsTo( current ) / ( 60.0 * 60.0 * 24.0 ) );
 
-    if( id ) item->setText( Col_ID, QString().setNum( id ) );
+    if ( id ) item->setText( Col_ID, QString().setNum( id ) );
     item->setText( Col_IDOrder, QString().setNum( order ) );
     item->setText( Col_Subject, threadName );
     item->setText( Col_ResNum, QString( "%1" ).arg( resNum, 4 ) );
@@ -315,32 +315,31 @@ void KitaSubjectView::updateListViewItem( QListViewItem* item, Kita::Thread* thr
 
     /* set mark order */
 
-    if( !id ){ /* old thread */
+    if ( !id ) { /* old thread */
 
-       item->setText( Col_MarkOrder, QString::number( ts_old ) );
-    }
-    else if ( readNum > 0 && ( resNum > readNum || resNum > viewPos ) ) {  /* There are new responses. */
+        item->setText( Col_MarkOrder, QString::number( ts_old ) );
+    } else if ( readNum > 0 && ( resNum > readNum || resNum > viewPos ) ) {  /* There are new responses. */
 
-       item->setPixmap( Col_Mark, SmallIcon( "unread" ) );
-       m_unreadNum++;
-       item->setText( Col_MarkOrder, QString::number( ts_hasunread ) );
+        item->setPixmap( Col_Mark, SmallIcon( "unread" ) );
+        m_unreadNum++;
+        item->setText( Col_MarkOrder, QString::number( ts_hasunread ) );
 
     } else if ( readNum > 0 ) { /* Cache exists */
 
-       item->setPixmap( Col_Mark, SmallIcon( "read" ) );
-       m_readNum++;
-       item->setText( Col_MarkOrder, QString::number( ( viewPos > 1000 ) ? ts_readed : ts_read ) );
+        item->setPixmap( Col_Mark, SmallIcon( "read" ) );
+        m_readNum++;
+        item->setText( Col_MarkOrder, QString::number( ( viewPos > 1000 ) ? ts_readed : ts_read ) );
 
     } else if ( since.secsTo( current ) < 3600 * KitaConfig::MarkTime() ) { /* new thread */
 
-       item->setPixmap( Col_Mark, SmallIcon( "newthread" ) );
-       m_newNum++;
-       item->setText( Col_MarkOrder, QString::number( ts_new ) );
+        item->setPixmap( Col_Mark, SmallIcon( "newthread" ) );
+        m_newNum++;
+        item->setText( Col_MarkOrder, QString::number( ts_new ) );
 
     } else { /* normal */
 
-       item->setText( Col_MarkOrder, QString::number( ts_normal ) );
-       item->setPixmap( Col_Mark, NULL );
+        item->setText( Col_MarkOrder, QString::number( ts_normal ) );
+        item->setPixmap( Col_Mark, NULL );
     }
 
     // no effect: m_unreadNum, m_readNum, m_newNum, markOrder
@@ -381,11 +380,11 @@ void KitaSubjectView::slotContextMenuRequested( QListViewItem* item, const QPoin
         popup.insertItem( i18n( "Add to Favorites" ), Menu_Favorites );
     }
 
-    if( Kita::DatManager::getReadNum( datURL ) ){
-       popup.insertSeparator();
-       popup.insertItem( i18n( "Delete Log" ), Menu_DeleteLog );
+    if ( Kita::DatManager::getReadNum( datURL ) ) {
+        popup.insertSeparator();
+        popup.insertItem( i18n( "Delete Log" ), Menu_DeleteLog );
     }
-    
+
     popup.insertSeparator();
     popup.insertItem( i18n( "Property" ), Menu_Property );
 
@@ -403,9 +402,9 @@ void KitaSubjectView::slotContextMenuRequested( QListViewItem* item, const QPoin
         clipboard->setText( threadURL );
         break;
     case Menu_CopyTitleAndURL:
-       cliptxt = Kita::DatManager::threadName( datURL ) + "\n" + threadURL;
-       clipboard->setText( cliptxt , QClipboard::Clipboard );
-       clipboard->setText( cliptxt , QClipboard::Selection );
+        cliptxt = Kita::DatManager::threadName( datURL ) + "\n" + threadURL;
+        clipboard->setText( cliptxt , QClipboard::Clipboard );
+        clipboard->setText( cliptxt , QClipboard::Selection );
         break;
     case Menu_Favorites:
         if ( isFavorites ) {
@@ -417,8 +416,7 @@ void KitaSubjectView::slotContextMenuRequested( QListViewItem* item, const QPoin
     case Menu_DeleteLog:
         deleteLog( threadURL );
         break;
-    case Menu_Property:
-        {
+    case Menu_Property: {
             // FIXME: memory leak
             Kita::ThreadProperty* propertyWidget = new Kita::ThreadProperty( 0 );
             propertyWidget->threadURLLabel->setText( threadURL );
@@ -449,17 +447,17 @@ void KitaSubjectView::deleteLog( const KURL& url )
                                i18n( "Do you want to delete Log ?" ),
                                QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default )
             == QMessageBox::Ok ) {
-        if ( Kita::DatManager::deleteCache( url ) ){
-           emit closeThreadTab( url );
-           slotUpdateSubject( url );
-       }
+        if ( Kita::DatManager::deleteCache( url ) ) {
+            emit closeThreadTab( url );
+            slotUpdateSubject( url );
+        }
     }
 }
 
 void KitaSubjectView::slotSizeChange( int section, int oldSize, int newSize )
 {
-    if ( ! m_enableSizeChange ) return;
-    if ( autoResize() ) return;
+    if ( ! m_enableSizeChange ) return ;
+    if ( autoResize() ) return ;
     // FIXME: cache KConfig
     QString configPath = locateLocal( "appdata", "subjectview.conf" );
     KConfig config( configPath );
@@ -468,7 +466,7 @@ void KitaSubjectView::slotSizeChange( int section, int oldSize, int newSize )
 
 void KitaSubjectView::loadLayout()
 {
-    if ( autoResize() ) return;
+    if ( autoResize() ) return ;
     QString configPath = locateLocal( "appdata", "subjectview.conf" );
     KConfig config( configPath );
     subjectList->restoreLayout( &config, "Layout" );
@@ -477,12 +475,12 @@ void KitaSubjectView::loadLayout()
 bool KitaSubjectView::eventFilter( QObject* watched, QEvent* e )
 {
     if ( e->type() == QEvent::MouseButtonPress ) {
-        QMouseEvent* mouseEvent = static_cast<QMouseEvent *>( e );
+        QMouseEvent * mouseEvent = static_cast<QMouseEvent *>( e );
         if ( mouseEvent->button() == RightButton ) {
             KPopupMenu popup;
             popup.setCheckable( true );
 
-            for( int i = Col_Begin; i <= Col_End; i++ ) {
+            for ( int i = Col_Begin; i <= Col_End; i++ ) {
                 if ( i != Col_Subject && i != Col_MarkOrder && i != Col_IDOrder ) {
                     popup.insertItem( i18n( s_colAttr[ i ].itemName ), i );
                     popup.setItemChecked( i, subjectList->columnWidth( i ) != 0 );
@@ -502,17 +500,18 @@ bool KitaSubjectView::eventFilter( QObject* watched, QEvent* e )
             } else if ( popup.isItemChecked( id ) ) {
                 // hide
                 subjectList->setColumnWidthMode( id, QListView::Manual );
-                subjectList->header()->setResizeEnabled( false );
+                subjectList->header() ->setResizeEnabled( false );
                 subjectList->setColumnWidth( id, 0 );
             } else {
                 // show
                 subjectList->setColumnWidthMode( id, QListView::Manual );
-                subjectList->header()->setResizeEnabled( true );
+                subjectList->header() ->setResizeEnabled( true );
 #if QT_VERSION >= 0x030200
                 subjectList->adjustColumn( id );
 #else
                 subjectList->setColumnWidth( id, 30 );
 #endif
+
             }
             saveHeaderOnOff();
             return true;
@@ -520,7 +519,7 @@ bool KitaSubjectView::eventFilter( QObject* watched, QEvent* e )
             return false;
         }
     } else {
-        return subjectList->header()->eventFilter( watched, e );
+        return subjectList->header() ->eventFilter( watched, e );
     }
 }
 
@@ -532,9 +531,9 @@ void KitaSubjectView::saveHeaderOnOff()
     config.setGroup( "Column" );
     for ( int i = Col_Begin; i <= Col_End; i++ ) {
         if ( subjectList->columnWidth( i ) != 0 ) {
-            config.writeEntry( s_colAttr[i].keyName, true );
+            config.writeEntry( s_colAttr[ i ].keyName, true );
         } else {
-            config.writeEntry( s_colAttr[i].keyName, false );
+            config.writeEntry( s_colAttr[ i ].keyName, false );
         }
     }
 }
@@ -547,7 +546,7 @@ void KitaSubjectView::loadHeaderOnOff()
 
     config.setGroup( "Column" );
     for ( int i = Col_Begin; i <= Col_End; i++ ) {
-        bool isShown = config.readBoolEntry( s_colAttr[i].keyName, s_colAttr[i].showDefault );
+        bool isShown = config.readBoolEntry( s_colAttr[ i ].keyName, s_colAttr[ i ].showDefault );
         if ( isShown ) {
             subjectList->setColumnWidthMode( i, QListView::Maximum );
             header->setResizeEnabled( i, true );
@@ -556,6 +555,7 @@ void KitaSubjectView::loadHeaderOnOff()
 #else
             subjectList->setColumnWidth( i, 30 );
 #endif
+
         } else {
             subjectList->setColumnWidthMode( i, QListView::Manual );
             header->setResizeEnabled( i, false );
index 3cc6d51..a9a11df 100644 (file)
@@ -34,7 +34,7 @@ public:
 
 public slots:
     virtual void setFocus();
-    void slotFocusSearchCombo(); 
+    void slotFocusSearchCombo();
     void reloadSubject();
     void slotCreateNewThread();
     void loadBoard( const KURL& url, bool online = TRUE );
@@ -49,7 +49,7 @@ private:
     void UpdateKindLabel();
     void deleteLog( const KURL& url );
     void loadLayout();
-    void updateListViewItem( QListViewItem* item, Kita::Thread* thread, const QDateTime& current, int id, int order);
+    void updateListViewItem( QListViewItem* item, Kita::Thread* thread, const QDateTime& current, int id, int order );
     bool eventFilter( QObject* watched, QEvent* e );
     void saveHeaderOnOff();
     void loadHeaderOnOff();
@@ -65,7 +65,7 @@ private slots:
 signals:
     void loadBoardCompleted( const KURL& );
     void closeThreadTab( const KURL& );
-    void createNewThread( const KURL& , const QString&, const QString& );    
+    void createNewThread( const KURL& , const QString&, const QString& );
     void closeCurrentTab();
 };
 
index 8ca76fe..284fbd0 100644 (file)
@@ -555,8 +555,8 @@ void KitaTabBarBase::showPopupMenu( int idx, QPoint global )
     collection->action( "tab_closealltab" ) ->plug( popup );
 
     popup->insertSeparator();
-    collection->action( "tab_configkeys" )->plug( popup );       
-    
+    collection->action( "tab_configkeys" ) ->plug( popup );
+
     int ret = popup->exec( global );
     delete popup;
 
index cc30ada..9b6f2a3 100644 (file)
@@ -39,60 +39,59 @@ KitaThreadTabWidget::KitaThreadTabWidget( int mode, QWidget* parent, const char*
 {
     m_mode = mode;
 
-    switch( m_mode ){
+    switch ( m_mode ) {
     case TABMODE_THREADVIEW: setXMLFile( "kitathreadtabwidgetui.rc" ); break;
-    case TABMODE_KITANAVI:   setXMLFile( "kitanaviui.rc" ); break;
+    case TABMODE_KITANAVI: setXMLFile( "kitanaviui.rc" ); break;
     }
-    
+
     setTabBar( new KitaThreadTabBar( this ) );
 
     connectSignals();
     setupActions();
 
     /* default view */
-    if( m_mode == TABMODE_THREADVIEW ) createView( "thread" );
+    if ( m_mode == TABMODE_THREADVIEW ) createView( "thread" );
 }
 
 
-KitaThreadTabWidget::~KitaThreadTabWidget(){}
+KitaThreadTabWidget::~KitaThreadTabWidget() {}
 
 
 /* show "Main thread" view */  /* public slots */
 void KitaThreadTabWidget::slotShowMainThread( const KURL& url, bool withNewTab )
 {
     QString refstr;
-    KURL datURL = Kita::ParseMisc::parseURL( url, refstr);
+    KURL datURL = Kita::ParseMisc::parseURL( url, refstr );
     QString threadName = Kita::DatManager::threadName( datURL );
     int jumpNum = 0;
-    
+
     int viewMode = VIEWMODE_MAINVIEW;
     KitaThreadView* currentView = isThreadView( currentPage() );
-    if( currentView ) viewMode = currentView->getViewMode();
+    if ( currentView ) viewMode = currentView->getViewMode();
 
-    if( refstr != QString::null ){
-       int i = refstr.find( "-" );
-       if( i != -1 ) jumpNum = refstr.left( i ).toInt();
-       else jumpNum = refstr.toInt();
+    if ( refstr != QString::null ) {
+        int i = refstr.find( "-" );
+        if ( i != -1 ) jumpNum = refstr.left( i ).toInt();
+        else jumpNum = refstr.toInt();
     }
 
     KitaThreadView* view = findMainView( datURL );
 
     if ( view ) {
-       
+
         setCurrentPage( indexOf( view ) );
 
-       /* Show on the default view */
+        /* Show on the default view */
         if ( view->threadURL().isEmpty() ) view->showThread( datURL, jumpNum );
 
-       /* The view is already shown */
-       /* TODO: jump to jumpNum after reloading */
-       else  view->slotReloadButton( jumpNum );
-       
-    }
-    else if ( withNewTab
-             || currentView == NULL           /* Current page is not KitaThreadView. */
-             || viewMode != VIEWMODE_MAINVIEW /* Current page is KitaThreadView, but not Main View. */
-       ){
+        /* The view is already shown */
+        /* TODO: jump to jumpNum after reloading */
+        else view->slotReloadButton( jumpNum );
+
+    } else if ( withNewTab
+                || currentView == NULL           /* Current page is not KitaThreadView. */
+                || viewMode != VIEWMODE_MAINVIEW /* Current page is KitaThreadView, but not Main View. */
+              ) {
 
         KitaThreadView * newView = createView( threadName );
 
@@ -100,8 +99,7 @@ void KitaThreadTabWidget::slotShowMainThread( const KURL& url, bool withNewTab )
             newView->showThread( datURL, jumpNum );
             showPage( newView );
         }
-    }
-    else static_cast<KitaThreadView *>( currentPage() )->showThread( datURL, jumpNum );
+    } else static_cast<KitaThreadView *>( currentPage() ) ->showThread( datURL, jumpNum );
 
     slotUpdateThreadTab( datURL );
 }
@@ -109,175 +107,174 @@ void KitaThreadTabWidget::slotShowMainThread( const KURL& url, bool withNewTab )
 
 
 /* show "KitaNavi" view  */  /* public slot */
-void KitaThreadTabWidget::slotShowKitaNavi(int mode,
-                     const KURL& datURL,
-                     const QString& query,
-                     int startnum,
-                     int endnum)
+void KitaThreadTabWidget::slotShowKitaNavi( int mode,
+        const KURL& datURL,
+        const QString& query,
+        int startnum,
+        int endnum )
 {
     const int margin = 5;
-    int count = 0,totalNum = 0;
+    int count = 0, totalNum = 0;
     QString headstr = QString::null;
     QString footstr = QString::null;
     QString anchor = QString::null;
     QString cmbstr = QString::null;
     QString str, urlstr;
     QStringList queries;
-    QRegExp qrx(" +");
+    QRegExp qrx( " +" );
     bool ext_OR;
     QString labelstr = QString::null;
-    QString tabstr = QString::null;    
-                         
+    QString tabstr = QString::null;
+
     /* set title and label */
-    switch(mode){
+    switch ( mode ) {
 
     case KITANAVI_SHOWRES:
-       
-       if( startnum == endnum ) tabstr = QString().setNum( startnum );
-       else tabstr = QString( "%1-%2" ).arg(startnum).arg( endnum );
-       break;
-       
+
+        if ( startnum == endnum ) tabstr = QString().setNum( startnum );
+        else tabstr = QString( "%1-%2" ).arg( startnum ).arg( endnum );
+        break;
+
     case KITANAVI_EXTBYID:
-       tabstr = "ID";
-       break;
+        tabstr = "ID";
+        break;
     case KITANAVI_EXTBYWORD:
-       tabstr = Kita::ParseMisc::utf8ToUnicode( KITAUTF8_EXTRACT );
-       break;
+        tabstr = Kita::ParseMisc::utf8ToUnicode( KITAUTF8_EXTRACT );
+        break;
     case KITANAVI_EXTBYNAME:
-       tabstr = "Name";
-       break;
+        tabstr = "Name";
+        break;
 
     case KITANAVI_SHOWRESTREE:
-    case KITANAVI_SHOWREVRESTREE:      
-       tabstr = "Tree";
-       break;
+    case KITANAVI_SHOWREVRESTREE:
+        tabstr = "Tree";
+        break;
 
     }
 
     /* create KitaThreadView and setup it */
     KitaThreadView *view = createView( tabstr );
-    if( view == NULL) return;
+    if ( view == NULL ) return ;
+
+    QString toolstr = tabstr + " : " + QString( "[%1] %2" )
+                      .arg( Kita::BoardManager::boardName( datURL ) )
+                      .arg( Kita::DatManager::threadName( datURL ) );
 
-    QString toolstr = tabstr + " : "+QString( "[%1] %2" )
-       .arg( Kita::BoardManager::boardName( datURL ) )
-       .arg( Kita::DatManager::threadName( datURL ) ); 
-    
     view->setup( datURL, VIEWMODE_KITANAVI );
     setTabToolTip( view , toolstr );
     totalNum = Kita::DatManager::getResNum( datURL );
 
     labelstr = Kita::DatManager::threadName( datURL ) + " : " + tabstr;
-    
-    /*---------------------------------------------*/    
+
+    /*---------------------------------------------*/
     /* copy data from DatManager to KitaThreadView */
 
-    switch(mode){
+    switch ( mode ) {
 
     case KITANAVI_SHOWRES:
 
-       for(int i = QMAX(1,startnum-margin); i <= QMIN(totalNum,endnum+margin); i++){
-           if(i == startnum) view->domAppendBelt("belt1");
-           str = Kita::DatManager::getDat( datURL ,i);
-           view->domAppendData(str,i,i);
-           if(i == endnum) view->domAppendBelt("belt2");
-       }
-       if(startnum == endnum) headstr = QString("No. %1").arg(startnum);
-       else headstr = QString("No. %1 - %2").arg(startnum).arg(endnum);
-       footstr = headstr;
-
-       anchor = QString().setNum(startnum);
-       
-       break;
-       
-       /*--------------------------------*/
-       
+        for ( int i = QMAX( 1, startnum - margin ); i <= QMIN( totalNum, endnum + margin ); i++ ) {
+            if ( i == startnum ) view->domAppendBelt( "belt1" );
+            str = Kita::DatManager::getDat( datURL , i );
+            view->domAppendData( str, i, i );
+            if ( i == endnum ) view->domAppendBelt( "belt2" );
+        }
+        if ( startnum == endnum ) headstr = QString( "No. %1" ).arg( startnum );
+        else headstr = QString( "No. %1 - %2" ).arg( startnum ).arg( endnum );
+        footstr = headstr;
+
+        anchor = QString().setNum( startnum );
+
+        break;
+
+        /*--------------------------------*/
+
     case KITANAVI_EXTBYID:
 
-       for(int i = 1; i<= totalNum; i++){
-           if(Kita::DatManager::checkID( datURL, query, i )){
-               str = Kita::DatManager::getDat( datURL, i );
-               view->domAppendData(str,i,i);
-               count++;
-           }
-       }
-       headstr = QString("ID:%1 : [%2]").arg(query).arg(count);
-       footstr = headstr;
-       anchor = "header";
-       break;
-
-       /*--------------------------------*/
-       
+        for ( int i = 1; i <= totalNum; i++ ) {
+            if ( Kita::DatManager::checkID( datURL, query, i ) ) {
+                str = Kita::DatManager::getDat( datURL, i );
+                view->domAppendData( str, i, i );
+                count++;
+            }
+        }
+        headstr = QString( "ID:%1 : [%2]" ).arg( query ).arg( count );
+        footstr = headstr;
+        anchor = "header";
+        break;
+
+        /*--------------------------------*/
+
     case KITANAVI_EXTBYNAME:
 
-       for(int i = 1; i<= totalNum; i++){
-           if( Kita::DatManager::getPlainName( datURL, i ) == query ){
-               str = Kita::DatManager::getDat( datURL, i );
-               view->domAppendData( str, i, i );
-               count++;
-           }
-       }
-       headstr = Kita::ParseMisc::utf8ToUnicode(KITAUTF8_EXTRACT)
-           +QString(": %1 : [%2]").arg( query ).arg( count );
-       footstr = headstr;
-       anchor = "header";
-       break;
-       
-       /*--------------------------------*/
+        for ( int i = 1; i <= totalNum; i++ ) {
+            if ( Kita::DatManager::getPlainName( datURL, i ) == query ) {
+                str = Kita::DatManager::getDat( datURL, i );
+                view->domAppendData( str, i, i );
+                count++;
+            }
+        }
+        headstr = Kita::ParseMisc::utf8ToUnicode( KITAUTF8_EXTRACT )
+                  + QString( ": %1 : [%2]" ).arg( query ).arg( count );
+        footstr = headstr;
+        anchor = "header";
+        break;
+
+        /*--------------------------------*/
 
     case KITANAVI_EXTBYWORD:
 
-       if(query.at(0) == '|'){ /* OR */
-           ext_OR = TRUE;
-           str = query.mid(1);
-       }
-       else{ /* AND */
-           ext_OR = FALSE;
-           str = query;
-       }
-       str.replace(Kita::ParseMisc::utf8ToUnicode(KITAUTF8_ZENSPACE)," ");
-       str.replace(qrx," "); /* pack space */
-       queries  = QStringList::split(" ", str);
-
-       for(int i = 1; i<= totalNum; i++){
-           if(Kita::DatManager::checkWord( datURL, queries, i, ext_OR )){
-               str = Kita::DatManager::getDat( datURL, i );
-               view->domAppendData(str,i,i);
-               count++;
-           }
-       }
-       headstr = Kita::ParseMisc::utf8ToUnicode(KITAUTF8_EXTRACT)
-           +QString(": %1 : [%2]").arg(query).arg(count);
-       footstr = headstr;
-       anchor = "header";
-       cmbstr = ":?"+query;
-       break;
-
-       /*--------------------------------*/
-       
+        if ( query.at( 0 ) == '|' ) { /* OR */
+            ext_OR = TRUE;
+            str = query.mid( 1 );
+        } else { /* AND */
+            ext_OR = FALSE;
+            str = query;
+        }
+        str.replace( Kita::ParseMisc::utf8ToUnicode( KITAUTF8_ZENSPACE ), " " );
+        str.replace( qrx, " " ); /* pack space */
+        queries = QStringList::split( " ", str );
+
+        for ( int i = 1; i <= totalNum; i++ ) {
+            if ( Kita::DatManager::checkWord( datURL, queries, i, ext_OR ) ) {
+                str = Kita::DatManager::getDat( datURL, i );
+                view->domAppendData( str, i, i );
+                count++;
+            }
+        }
+        headstr = Kita::ParseMisc::utf8ToUnicode( KITAUTF8_EXTRACT )
+                  + QString( ": %1 : [%2]" ).arg( query ).arg( count );
+        footstr = headstr;
+        anchor = "header";
+        cmbstr = ":?" + query;
+        break;
+
+        /*--------------------------------*/
+
     case KITANAVI_SHOWRESTREE:
-    case KITANAVI_SHOWREVRESTREE:      
-
-       str = QString("[%1] %2 : No.%3 [%4]<br>")
-           .arg( Kita::BoardManager::boardName( datURL ) )
-           .arg( Kita::DatManager::threadName( datURL ) )
-           .arg(startnum ).arg( endnum );
-       urlstr = Kita::DatManager::threadURL( datURL ) + QString().setNum( startnum );
-       str += "<a href=\""+urlstr+"\">"+urlstr+"</a><br>";
-       str += Kita::DatManager::getHtml( datURL, startnum, startnum );
-       if( endnum ){
-       str += "<div style=\"background-color: #CCCCCC; text-align: center\"><br></div>";
-       str += query;
-       }
-       view->domSetInnerHTML(str);
-       
-       break;
+    case KITANAVI_SHOWREVRESTREE:
+
+        str = QString( "[%1] %2 : No.%3 [%4]<br>" )
+              .arg( Kita::BoardManager::boardName( datURL ) )
+              .arg( Kita::DatManager::threadName( datURL ) )
+              .arg( startnum ).arg( endnum );
+        urlstr = Kita::DatManager::threadURL( datURL ) + QString().setNum( startnum );
+        str += "<a href=\"" + urlstr + "\">" + urlstr + "</a><br>";
+        str += Kita::DatManager::getHtml( datURL, startnum, startnum );
+        if ( endnum ) {
+            str += "<div style=\"background-color: #CCCCCC; text-align: center\"><br></div>";
+            str += query;
+        }
+        view->domSetInnerHTML( str );
+
+        break;
 
     default:
-       break;
+        break;
     }
-    
-    showPage(view);
-    view->domApplyChange(labelstr,headstr,footstr,anchor,cmbstr);
+
+    showPage( view );
+    view->domApplyChange( labelstr, headstr, footstr, anchor, cmbstr );
 }
 
 
@@ -285,20 +282,20 @@ void KitaThreadTabWidget::slotShowKitaNavi(int mode,
 void KitaThreadTabWidget::slotCloseThreadTab( const KURL& url )
 {
     int max = count();
-    if( max == 0 ) return;
+    if ( max == 0 ) return ;
     KURL datURL = Kita::ParseMisc::parseURLonly( url );
-    
+
     int i, i2;
     i = i2 = 0;
-    while( i < max ){
-       KitaThreadView* view = isThreadView( page ( i ) );
-       if( view ){
-           if( view->datURL() == datURL ){
-               slotCloseTab( i2 );
-               i2--;
-           }
-       }
-       i++; i2++;
+    while ( i < max ) {
+        KitaThreadView * view = isThreadView( page ( i ) );
+        if ( view ) {
+            if ( view->datURL() == datURL ) {
+                slotCloseTab( i2 );
+                i2--;
+            }
+        }
+        i++; i2++;
     }
 }
 
@@ -307,12 +304,12 @@ void KitaThreadTabWidget::slotCloseThreadTab( const KURL& url )
 /* create KitaThreadView */   /* private */
 KitaThreadView* KitaThreadTabWidget::createView( QString label )
 {
-    KitaThreadView* view = new KitaThreadView( this );
-    if( view ){
-       addTab( view, label );
-       connect( view, SIGNAL( closeCurrentTab() ), SLOT( slotCloseCurrentTab() ) );
+    KitaThreadView * view = new KitaThreadView( this );
+    if ( view ) {
+        addTab( view, label );
+        connect( view, SIGNAL( closeCurrentTab() ), SLOT( slotCloseCurrentTab() ) );
     }
-    
+
     return view;
 }
 
@@ -320,12 +317,12 @@ KitaThreadView* KitaThreadTabWidget::createView( QString label )
 /* private */
 void KitaThreadTabWidget::connectSignals()
 {
-    Kita::SignalCollection* signalCollection = Kita::SignalCollection::getInstance();
+    Kita::SignalCollection * signalCollection = Kita::SignalCollection::getInstance();
 
     connect( signalCollection, SIGNAL( updateThreadTab( const KURL& ) ),
              this, SLOT( slotUpdateThreadTab( const KURL& ) ) );
     connect( signalCollection, SIGNAL( closeThreadTab( const KURL& ) ),
-             SLOT( slotCloseThreadTab( const KURL& )));
+             SLOT( slotCloseThreadTab( const KURL& ) ) );
 }
 
 
@@ -335,20 +332,20 @@ KitaThreadView* KitaThreadTabWidget::findMainView( const KURL& url )
     KURL datURL = Kita::ParseMisc::parseURLonly( url );
 
     int max = count();
-    if( max == 0 ) return NULL;
+    if ( max == 0 ) return NULL;
     int i = 0;
 
-    while( i < max ){
-       KitaThreadView* view = isThreadView( page ( i ) );
-       if( view ){
-           if( view->getViewMode() == VIEWMODE_MAINVIEW ){
-               
-               if ( view->datURL() == datURL
-                    || view->datURL().isEmpty() /* default view */
-                   ) return view;
-           }
-       }
-       i++;
+    while ( i < max ) {
+        KitaThreadView * view = isThreadView( page ( i ) );
+        if ( view ) {
+            if ( view->getViewMode() == VIEWMODE_MAINVIEW ) {
+
+                if ( view->datURL() == datURL
+                        || view->datURL().isEmpty()  /* default view */
+                   ) return view;
+            }
+        }
+        i++;
     }
 
     return NULL;
@@ -358,9 +355,9 @@ KitaThreadView* KitaThreadTabWidget::findMainView( const KURL& url )
 /* private */
 KitaThreadView* KitaThreadTabWidget::isThreadView( QWidget* w )
 {
-    KitaThreadView* view = NULL;
-    if( w ){
-       if( w->isA( "KitaThreadView" ) ) view = static_cast< KitaThreadView* >( w );
+    KitaThreadView * view = NULL;
+    if ( w ) {
+        if ( w->isA( "KitaThreadView" ) ) view = static_cast< KitaThreadView* >( w );
     }
 
     return view;
@@ -373,11 +370,11 @@ void KitaThreadTabWidget::slotUpdateThreadTab( const KURL& url )
     KURL datURL = Kita::ParseMisc::parseURLonly( url );
 
     KitaThreadView * view = findMainView( datURL );
-    if ( view ){
-       QString threadName = Kita::DatManager::threadName( datURL );
+    if ( view ) {
+        QString threadName = Kita::DatManager::threadName( datURL );
 
-       setTabLabel( view, threadName );
-       setTabToolTip( view, threadName );
+        setTabLabel( view, threadName );
+        setTabToolTip( view, threadName );
     }
 }
 
@@ -387,26 +384,25 @@ void KitaThreadTabWidget::slotUpdateThreadTab( const KURL& url )
 void KitaThreadTabWidget::deleteWidget( QWidget* w )
 {
     KitaTabWidgetBase::deleteWidget( w );
-    
-    if ( count() == 0 ){
-
-       if( m_mode == TABMODE_THREADVIEW ){
-
-           emit setMainCaption( QString::null );
-           emit setMainStatusbar( QString::null ); 
-           emit setMainURLLine( QString::null );
-           
-           /* default view */
-           KitaThreadView * threadView = createView( "thread" );
-
-           if ( threadView ) {
-               showPage( threadView );
-               emit switchToSubject();
-           }
-       }
-       else if( m_mode == TABMODE_KITANAVI ){
-               static_cast< KitaDockWidgetBase* >( parentWidget() )->slotHideDock();
-       }
+
+    if ( count() == 0 ) {
+
+        if ( m_mode == TABMODE_THREADVIEW ) {
+
+            emit setMainCaption( QString::null );
+            emit setMainStatusbar( QString::null );
+            emit setMainURLLine( QString::null );
+
+            /* default view */
+            KitaThreadView * threadView = createView( "thread" );
+
+            if ( threadView ) {
+                showPage( threadView );
+                emit switchToSubject();
+            }
+        } else if ( m_mode == TABMODE_KITANAVI ) {
+            static_cast< KitaDockWidgetBase* >( parentWidget() ) ->slotHideDock();
+        }
     }
 }
 
@@ -420,7 +416,7 @@ void KitaThreadTabWidget::deleteWidget( QWidget* w )
 void KitaThreadTabWidget::setupActions()
 {
     KStdAction::copy( this, SLOT( slotCopyText() ), actionCollection() );
-    
+
     new KAction( i18n( "Open with Web Browser" ),
                  0,
                  this,
@@ -431,17 +427,17 @@ void KitaThreadTabWidget::setupActions()
     new KAction( i18n( "copy URL" ),
                  0,
                  this,
-                SLOT( slotCopyURL() ),
+                 SLOT( slotCopyURL() ),
                  actionCollection(),
-                 "threadview_copyurl" );   
-    
+                 "threadview_copyurl" );
+
     new KAction( i18n( "Copy title and URL" ),
                  0,
                  this,
-                SLOT( slotCopyTitleURL() ),
+                 SLOT( slotCopyTitleURL() ),
                  actionCollection(),
-                 "threadview_copytitleurl" );   
-    
+                 "threadview_copytitleurl" );
+
     new KAction( i18n( "Find" ),
                  "find",
                  KStdAccel::find(),
@@ -449,40 +445,40 @@ void KitaThreadTabWidget::setupActions()
                  SLOT( slotFocusSearchCombo() ),
                  actionCollection(),
                  "threadview_find" );
-    
+
     KStdAction::findNext( this,
-                     SLOT( slotSearchNext() ),
-                     actionCollection(),
-                     "threadview_findnext");
+                          SLOT( slotSearchNext() ),
+                          actionCollection(),
+                          "threadview_findnext" );
 
     KStdAction::findPrev( this,
-                     SLOT( slotSearchPrev() ),
-                     actionCollection(),
-                     "threadview_findprev");
+                          SLOT( slotSearchPrev() ),
+                          actionCollection(),
+                          "threadview_findprev" );
 
     new KAction( i18n( "go back anchor" ),
-                "2leftarrow",
-                Key_Backspace,
-                this,
-                SLOT( slotGobackAnchor() ),
-                actionCollection(),
-                "threadview_goback" );
+                 "2leftarrow",
+                 Key_Backspace,
+                 this,
+                 SLOT( slotGobackAnchor() ),
+                 actionCollection(),
+                 "threadview_goback" );
 
     new KAction( i18n( "Start" ),
-                "up",
-                Key_Home,
-                this,
-                SLOT( slotGotoHeader() ),
-                actionCollection(),
-                "threadview_gotoheader" );    
-    
+                 "up",
+                 Key_Home,
+                 this,
+                 SLOT( slotGotoHeader() ),
+                 actionCollection(),
+                 "threadview_gotoheader" );
+
     new KAction( i18n( "End" ),
-                "down",
-                Key_End,
-                this,
-                SLOT( slotGotoFooter() ),
-                actionCollection(),
-                "threadview_gotofooter" );    
+                 "down",
+                 Key_End,
+                 this,
+                 SLOT( slotGotoFooter() ),
+                 actionCollection(),
+                 "threadview_gotofooter" );
 
     new KAction( i18n( "Reload" ),
                  "reload",
@@ -492,21 +488,21 @@ void KitaThreadTabWidget::setupActions()
                  actionCollection(),
                  "threadview_reload" );
 
-    new KAction(i18n("Stop"),
-                "stop",
-                Key_Escape,
-                this,
-                SLOT(slotStopLoading()),
-                actionCollection(),
-                "threadview_stop");
+    new KAction( i18n( "Stop" ),
+                 "stop",
+                 Key_Escape,
+                 this,
+                 SLOT( slotStopLoading() ),
+                 actionCollection(),
+                 "threadview_stop" );
 
-    new KAction(i18n("Delete"),
-                "edittrash",
-                Key_Delete,
-                this,
-                SLOT(slotDeleteButtonClicked()),
-                actionCollection(),
-                "threadview_delete");
+    new KAction( i18n( "Delete" ),
+                 "edittrash",
+                 Key_Delete,
+                 this,
+                 SLOT( slotDeleteButtonClicked() ),
+                 actionCollection(),
+                 "threadview_delete" );
 }
 
 
@@ -516,36 +512,36 @@ void KitaThreadTabWidget::setupActions()
 /* copy selected text (Ctrl+C) */ /* public slot */
 void KitaThreadTabWidget::slotCopyText()
 {
-    QWidget* w = currentPage();
+    QWidget * w = currentPage();
     KitaThreadView * view = isThreadView( w );
-    if( view ){
-       QClipboard * clipboard = QApplication::clipboard();
-       QString text = view->selectedText();
-       clipboard->setText( text, QClipboard::Clipboard );
+    if ( view ) {
+        QClipboard * clipboard = QApplication::clipboard();
+        QString text = view->selectedText();
+        clipboard->setText( text, QClipboard::Clipboard );
     }
 }
 
 /* public slot */
 void KitaThreadTabWidget::slotOpenBrowser( int idx )
 {
-    QWidget* w = currentPage();
-    if( idx != -1 ) w = page( idx );
+    QWidget * w = currentPage();
+    if ( idx != -1 ) w = page( idx );
     KURL url;
-    
-    if( w ){
-
-       KitaThreadView * view = isThreadView( w );
-       if( view ){
-           new KRun( view->threadURL() );
-           return;
-       }
-
-       KParts::Part* part = findPartFromWidget( w );
-       if( part && part->inherits( "KParts::ReadOnlyPart" ) ){
-           url = static_cast<KParts::ReadOnlyPart*>( part )->url();
-           new KRun( url );
-           return;
-       }
+
+    if ( w ) {
+
+        KitaThreadView * view = isThreadView( w );
+        if ( view ) {
+            new KRun( view->threadURL() );
+            return ;
+        }
+
+        KParts::Part* part = findPartFromWidget( w );
+        if ( part && part->inherits( "KParts::ReadOnlyPart" ) ) {
+            url = static_cast<KParts::ReadOnlyPart*>( part ) ->url();
+            new KRun( url );
+            return ;
+        }
     }
 }
 
@@ -553,18 +549,18 @@ void KitaThreadTabWidget::slotOpenBrowser( int idx )
 /* public slot */
 void KitaThreadTabWidget::slotCopyURL( int idx )
 {
-    QWidget* w = currentPage();
-    if( idx != -1 ) w = page( idx );
-    
+    QWidget * w = currentPage();
+    if ( idx != -1 ) w = page( idx );
+
     QClipboard* clipboard = QApplication::clipboard();
 
-    KitaThreadView * view = isThreadView( w );    
-    if( view ){
-       KURL datURL = view->datURL();
-    
-       QString cliptxt = Kita::DatManager::threadURL( datURL );
-       clipboard->setText( cliptxt , QClipboard::Clipboard );
-       clipboard->setText( cliptxt , QClipboard::Selection );
+    KitaThreadView * view = isThreadView( w );
+    if ( view ) {
+        KURL datURL = view->datURL();
+
+        QString cliptxt = Kita::DatManager::threadURL( datURL );
+        clipboard->setText( cliptxt , QClipboard::Clipboard );
+        clipboard->setText( cliptxt , QClipboard::Selection );
     }
 }
 
@@ -572,19 +568,19 @@ void KitaThreadTabWidget::slotCopyURL( int idx )
 /* public slot */
 void KitaThreadTabWidget::slotCopyTitleURL( int idx )
 {
-    QWidget* w = currentPage();
-    if( idx != -1 ) w = page( idx );
-    
+    QWidget * w = currentPage();
+    if ( idx != -1 ) w = page( idx );
+
     QClipboard* clipboard = QApplication::clipboard();
 
-    KitaThreadView * view = isThreadView( w );    
-    if( view ){
-       KURL datURL = view->datURL();
-    
-       QString cliptxt = Kita::DatManager::threadName( datURL )
-           + "\n" + Kita::DatManager::threadURL( datURL );
-       clipboard->setText( cliptxt , QClipboard::Clipboard );
-       clipboard->setText( cliptxt , QClipboard::Selection );
+    KitaThreadView * view = isThreadView( w );
+    if ( view ) {
+        KURL datURL = view->datURL();
+
+        QString cliptxt = Kita::DatManager::threadName( datURL )
+                          + "\n" + Kita::DatManager::threadURL( datURL );
+        clipboard->setText( cliptxt , QClipboard::Clipboard );
+        clipboard->setText( cliptxt , QClipboard::Selection );
     }
 }
 
@@ -592,72 +588,72 @@ void KitaThreadTabWidget::slotCopyTitleURL( int idx )
 /* public slot  */
 void KitaThreadTabWidget::slotFocusSearchCombo()
 {
-    KitaThreadView * view = isThreadView( currentPage() );    
-    if( view ) view->focusSearchCombo();
+    KitaThreadView * view = isThreadView( currentPage() );
+    if ( view ) view->focusSearchCombo();
 }
 
 
 /* public slot  */
 void KitaThreadTabWidget::slotSearchNext()
 {
-    KitaThreadView * view = isThreadView( currentPage() );    
-    if( view ) view->slotSearchNext();
+    KitaThreadView * view = isThreadView( currentPage() );
+    if ( view ) view->slotSearchNext();
 }
 
 
 /* public slot  */
 void KitaThreadTabWidget::slotSearchPrev()
 {
-    KitaThreadView * view = isThreadView( currentPage() );    
-    if( view ) view->slotSearchPrev();
+    KitaThreadView * view = isThreadView( currentPage() );
+    if ( view ) view->slotSearchPrev();
 }
 
 
 /* public slot  */
 void KitaThreadTabWidget::slotGobackAnchor()
 {
-    KitaThreadView * view = isThreadView( currentPage() );    
-    if( view ) view->slotGobackAnchor();
+    KitaThreadView * view = isThreadView( currentPage() );
+    if ( view ) view->slotGobackAnchor();
 }
 
 
 /* public slot  */
 void KitaThreadTabWidget::slotGotoHeader()
 {
-    KitaThreadView * view = isThreadView( currentPage() );    
-    if( view ) view->slotGotoHeader();
+    KitaThreadView * view = isThreadView( currentPage() );
+    if ( view ) view->slotGotoHeader();
 }
 
 
 /* public slot  */
 void KitaThreadTabWidget::slotGotoFooter()
 {
-    KitaThreadView * view = isThreadView( currentPage() );    
-    if( view ) view->slotGotoFooter();
+    KitaThreadView * view = isThreadView( currentPage() );
+    if ( view ) view->slotGotoFooter();
 }
 
 
 /* public slot  */
 void KitaThreadTabWidget::slotReloadButton()
 {
-    KitaThreadView * view = isThreadView( currentPage() );    
-    if( view ) view->slotReloadButton();
+    KitaThreadView * view = isThreadView( currentPage() );
+    if ( view ) view->slotReloadButton();
 }
 
 
 /* public slot  */
 void KitaThreadTabWidget::slotStopLoading()
 {
-    KitaThreadView * view = isThreadView( currentPage() );    
-    if( view ) view->slotStopLoading();
-}        
+    KitaThreadView * view = isThreadView( currentPage() );
+    if ( view ) view->slotStopLoading();
+}
 
 
 /* public slot  */
 void KitaThreadTabWidget::slotDeleteButtonClicked()
 {
-    KitaThreadView * view = isThreadView( currentPage() );    
-    if( view ) view->slotDeleteButtonClicked();
+    KitaThreadView * view = isThreadView( currentPage() );
+    if ( view ) view->slotDeleteButtonClicked();
 }
 
 
@@ -667,22 +663,22 @@ void KitaThreadTabWidget::slotDeleteButtonClicked()
 
 
 
-KitaThreadTabBar::KitaThreadTabBar( QWidget* parent, const char* name ) : KitaTabBarBase( parent, name ){}
+KitaThreadTabBar::KitaThreadTabBar( QWidget* parent, const char* name ) : KitaTabBarBase( parent, name ) {}
 
-KitaThreadTabBar::~KitaThreadTabBar(){}
+KitaThreadTabBar::~KitaThreadTabBar() {}
 
 
 /* private */ /* virtual */
 void KitaThreadTabBar::showPopupMenu( int idx, QPoint global )
 {
     enum{
-         MENU_CLOSE,
+        MENU_CLOSE,
         MENU_CLOSEOTHER,
         MENU_CLOSELEFT,
-        MENU_CLOSERIGHT,             
+        MENU_CLOSERIGHT,
         MENU_OPENBROWSER,
         MENU_COPYURL,
-        MENU_COPYTITLE       
+        MENU_COPYTITLE
     };
 
     KitaThreadTabWidget* tabwidget = static_cast<KitaThreadTabWidget*>( parentWidget() );
@@ -690,38 +686,38 @@ void KitaThreadTabBar::showPopupMenu( int idx, QPoint global )
 
     KPopupMenu* popup = new KPopupMenu( this );
     popup->clear();
-    
+
     popup->insertItem( i18n( "Close this tab" ) , MENU_CLOSE );
-    collection->action( "tab_prevtab" )->plug( popup );
-    collection->action( "tab_nexttab" )->plug( popup );
+    collection->action( "tab_prevtab" ) ->plug( popup );
+    collection->action( "tab_nexttab" ) ->plug( popup );
     popup->insertSeparator();
 
-    popup->insertItem( i18n( "Close Other Tabs" ) , MENU_CLOSEOTHER );    
+    popup->insertItem( i18n( "Close Other Tabs" ) , MENU_CLOSEOTHER );
     popup->insertItem( i18n( "Close right tabs" ) , MENU_CLOSERIGHT );
     popup->insertItem( i18n( "Close left tabs" ) , MENU_CLOSELEFT );
-    collection->action( "tab_closealltab" )->plug( popup );        
+    collection->action( "tab_closealltab" ) ->plug( popup );
 
     popup->insertSeparator();
-    
+
     popup->insertItem( i18n( "Open with Web Browser" ) , MENU_OPENBROWSER );
     popup->insertItem( i18n( "Copy URL" ) , MENU_COPYURL );
     popup->insertItem( i18n( "Copy title and URL" ) , MENU_COPYTITLE );
-    
+
     popup->insertSeparator();
-    collection->action( "tab_configkeys" )->plug( popup );       
+    collection->action( "tab_configkeys" ) ->plug( popup );
+
 
-    
     int ret = popup->exec( global );
     delete popup;
-    
-    switch( ret ){
+
+    switch ( ret ) {
     case MENU_CLOSE: tabwidget->slotCloseTab( idx ); break;
     case MENU_CLOSEOTHER: tabwidget->slotCloseOtherTab( idx ); break;
     case MENU_CLOSERIGHT: tabwidget->slotCloseRightTab( idx ); break;
     case MENU_CLOSELEFT: tabwidget->slotCloseLeftTab( idx ); break;
     case MENU_OPENBROWSER: tabwidget->slotOpenBrowser( idx ); break;
     case MENU_COPYURL: tabwidget->slotCopyURL( idx ); break;
-    case MENU_COPYTITLE: tabwidget->slotCopyTitleURL( idx ); break;    
+    case MENU_COPYTITLE: tabwidget->slotCopyTitleURL( idx ); break;
     }
 
 }
@@ -735,16 +731,16 @@ void KitaThreadTabBar::showPopupMenu( int idx, QPoint global )
 
 /* Don't forget to call setup later ! */
 KitaThreadDock::KitaThreadDock( KDockManager* dockManager,
-                   const char* name,
-                   const QPixmap &pixmap,
-                   QWidget* parent,
-                   const QString& strCaption,
-                   const QString& strTabPageLabel,
-                   WFlags f )
-    :KitaDockWidgetBase( dockManager, name, pixmap, parent, strCaption, strTabPageLabel, f ){}
+                                const char* name,
+                                const QPixmap &pixmap,
+                                QWidget* parent,
+                                const QString& strCaption,
+                                const QString& strTabPageLabel,
+                                WFlags f )
+    : KitaDockWidgetBase( dockManager, name, pixmap, parent, strCaption, strTabPageLabel, f ) {}
 
 
-KitaThreadDock::~KitaThreadDock(){}
+KitaThreadDock::~KitaThreadDock() {}
 
 
 /*-----------------------------*/
@@ -758,8 +754,8 @@ KitaThreadTabWidget* KitaThreadDock::setupAsMainView()
 
     Kita::SignalCollection* signalCollection = Kita::SignalCollection::getInstance();
     connect( signalCollection, SIGNAL( switchToThread() ),
-            SLOT( slotShowThreadDock() ) );
-    
+             SLOT( slotShowThreadDock() ) );
+
     return m_threadTab;
 }
 
@@ -768,7 +764,7 @@ void KitaThreadDock::slotShowThread( const KURL& url, bool withNewTab )
 {
     showDock();
 
-    if( m_threadTab ) m_threadTab->slotShowMainThread( url, withNewTab );
+    if ( m_threadTab ) m_threadTab->slotShowMainThread( url, withNewTab );
 }
 
 
@@ -780,13 +776,13 @@ void KitaThreadDock::slotShowThread( const KURL& url, bool withNewTab )
 KitaThreadTabWidget* KitaThreadDock::setupAsKitaNavi()
 {
     /* create KitaNaviTabWidget */
-    m_threadTab = new KitaThreadTabWidget( TABMODE_KITANAVI, this, "Kita Navi");
+    m_threadTab = new KitaThreadTabWidget( TABMODE_KITANAVI, this, "Kita Navi" );
     setWidget( m_threadTab );
 
     Kita::SignalCollection* signalCollection = Kita::SignalCollection::getInstance();
     connect( signalCollection, SIGNAL( switchToKitanavi() ),
-            SLOT( slotShowThreadDock() ) );
-    
+             SLOT( slotShowThreadDock() ) );
+
     return m_threadTab;
 }
 
@@ -794,27 +790,27 @@ KitaThreadTabWidget* KitaThreadDock::setupAsKitaNavi()
 /* public */
 void KitaThreadDock::connectNaviSignals()
 {
-    Kita::SignalCollection* signalCollection = Kita::SignalCollection::getInstance();
+    Kita::SignalCollection * signalCollection = Kita::SignalCollection::getInstance();
 
-    connect( signalCollection, SIGNAL( showKitaNavi( const KURL& , int , int )),
-            SLOT( slotShowKitaNavi( const KURL& , int ,  int )));
-    connect( signalCollection, SIGNAL( showKitaNaviByID( const KURL& , QString )),
-            SLOT( slotShowKitaNaviByID( const KURL& , QString )));          
-    connect( signalCollection, SIGNAL( showKitaNaviByWord( const KURL& , QString)),
-            SLOT( slotShowKitaNaviByWord( const KURL& , QString)));
-    connect( signalCollection, SIGNAL( showKitaNaviByName( const KURL& , QString)),
-            SLOT( slotShowKitaNaviByName( const KURL& , QString)));
-    connect( signalCollection, SIGNAL( showKitaNaviResTree( const KURL&,  int )),
-            SLOT( slotShowKitaNaviResTree( const KURL&,  int )));
-    connect( signalCollection, SIGNAL( showKitaNaviRevResTree( const KURL&,  int )),
-            SLOT( slotShowKitaNaviRevResTree( const KURL&,  int )));
+    connect( signalCollection, SIGNAL( showKitaNavi( const KURL& , int , int ) ),
+             SLOT( slotShowKitaNavi( const KURL& , int , int ) ) );
+    connect( signalCollection, SIGNAL( showKitaNaviByID( const KURL& , QString ) ),
+             SLOT( slotShowKitaNaviByID( const KURL& , QString ) ) );
+    connect( signalCollection, SIGNAL( showKitaNaviByWord( const KURL& , QString ) ),
+             SLOT( slotShowKitaNaviByWord( const KURL& , QString ) ) );
+    connect( signalCollection, SIGNAL( showKitaNaviByName( const KURL& , QString ) ),
+             SLOT( slotShowKitaNaviByName( const KURL& , QString ) ) );
+    connect( signalCollection, SIGNAL( showKitaNaviResTree( const KURL&, int ) ),
+             SLOT( slotShowKitaNaviResTree( const KURL&, int ) ) );
+    connect( signalCollection, SIGNAL( showKitaNaviRevResTree( const KURL&, int ) ),
+             SLOT( slotShowKitaNaviRevResTree( const KURL&, int ) ) );
 }
 
 
 /* show Thread Dock */ /* private slot */
 void KitaThreadDock::slotShowThreadDock()
 {
-    QWidget* topWidget = topLevelWidget();
+    QWidget * topWidget = topLevelWidget();
     if ( topWidget->isMinimized() ) topWidget->showNormal();
     topWidget->raise();
     topWidget->setActiveWindow();
@@ -826,7 +822,7 @@ void KitaThreadDock::slotShowThreadDock()
 void KitaThreadDock::slotShowKitaNavi( const KURL& datURL, int startnum, int endnum )
 {
     showDock();
-       
+
     KURL parsedURL = Kita::ParseMisc::parseURLonly( datURL );
     m_threadTab->slotShowKitaNavi( KITANAVI_SHOWRES, parsedURL, QString::null, startnum, endnum );
 }
@@ -836,7 +832,7 @@ void KitaThreadDock::slotShowKitaNavi( const KURL& datURL, int startnum, int end
 void KitaThreadDock::slotShowKitaNaviByID( const KURL& datURL, QString strid )
 {
     showDock();
-    
+
     KURL parsedURL = Kita::ParseMisc::parseURLonly( datURL );
     m_threadTab->slotShowKitaNavi( KITANAVI_EXTBYID, parsedURL, strid, 0, 0 );
 }
@@ -847,9 +843,9 @@ void KitaThreadDock::slotShowKitaNaviByID( const KURL& datURL, QString strid )
 void KitaThreadDock::slotShowKitaNaviByWord( const KURL& datURL, QString query )
 {
     showDock();
-    
+
     KURL parsedURL = Kita::ParseMisc::parseURLonly( datURL );
-    m_threadTab->slotShowKitaNavi( KITANAVI_EXTBYWORD, parsedURL, query, 0, 0 );    
+    m_threadTab->slotShowKitaNavi( KITANAVI_EXTBYWORD, parsedURL, query, 0, 0 );
 }
 
 
@@ -857,9 +853,9 @@ void KitaThreadDock::slotShowKitaNaviByWord( const KURL& datURL, QString query )
 void KitaThreadDock::slotShowKitaNaviByName( const KURL& datURL, QString query )
 {
     showDock();
-    
+
     KURL parsedURL = Kita::ParseMisc::parseURLonly( datURL );
-    m_threadTab->slotShowKitaNavi( KITANAVI_EXTBYNAME, parsedURL, query, 0, 0 );    
+    m_threadTab->slotShowKitaNavi( KITANAVI_EXTBYNAME, parsedURL, query, 0, 0 );
 }
 
 
@@ -868,11 +864,11 @@ void KitaThreadDock::slotShowKitaNaviByName( const KURL& datURL, QString query )
 void KitaThreadDock::slotShowKitaNaviResTree( const KURL& datURL, int resNum )
 {
     showDock();
-    
+
     int num;
     KURL parsedURL = Kita::ParseMisc::parseURLonly( datURL );
-    QString htmlstr = Kita::DatManager::getTreeByRes( parsedURL, resNum, num);
-    m_threadTab->slotShowKitaNavi( KITANAVI_SHOWRESTREE, parsedURL, htmlstr, resNum, num);
+    QString htmlstr = Kita::DatManager::getTreeByRes( parsedURL, resNum, num );
+    m_threadTab->slotShowKitaNavi( KITANAVI_SHOWRESTREE, parsedURL, htmlstr, resNum, num );
 }
 
 
index 98e1993..f7e63be 100644 (file)
@@ -28,14 +28,14 @@ enum {
     KITANAVI_SHOWRES,
     KITANAVI_EXTBYID,
     KITANAVI_EXTBYWORD,
-    KITANAVI_EXTBYNAME,    
+    KITANAVI_EXTBYNAME,
     KITANAVI_SHOWRESTREE,
-    KITANAVI_SHOWREVRESTREE,    
-    KITANAVI_TITLE    
+    KITANAVI_SHOWREVRESTREE,
+    KITANAVI_TITLE
 };
 
 
-/*-----------------------------------------------*/    
+/*-----------------------------------------------*/
 
 
 class KitaThreadTabWidget : public KitaTabWidgetBase
@@ -43,41 +43,41 @@ class KitaThreadTabWidget : public KitaTabWidgetBase
     Q_OBJECT
 
     int m_mode;
-       
+
 public:
     KitaThreadTabWidget( int mode, QWidget* parent = 0, const char* name = 0, WFlags f = 0 );
     ~KitaThreadTabWidget();
-    
+
 public slots:
     void slotShowMainThread( const KURL& datURL, bool withNewTab );
     void slotShowKitaNavi( int mode, const KURL& datURL, const QString& query, int startnum, int endnum );
-    void slotCloseThreadTab( const KURL& url );    
+    void slotCloseThreadTab( const KURL& url );
 
 private:
     KitaThreadView* createView( QString label );
     void connectSignals();
     KitaThreadView* findMainView( const KURL& url );
     KitaThreadView* isThreadView( QWidget* w );
-    
+
 private slots:
     void slotUpdateThreadTab( const KURL& url );
 
-    
+
 protected:
     virtual void deleteWidget( QWidget* w );
 
-    
+
     /*------------------------------------*/
     /* KitaThreadView actions */
 
 private:
     void setupActions();
-    
+
 public slots:
     void slotCopyText();
     void slotOpenBrowser( int idx = -1 );
     void slotCopyURL( int idx = -1 );
-    void slotCopyTitleURL( int idx = -1 );    
+    void slotCopyTitleURL( int idx = -1 );
     void slotFocusSearchCombo();
     void slotSearchNext();
     void slotSearchPrev();
@@ -85,8 +85,8 @@ public slots:
     void slotGotoHeader();
     void slotGotoFooter();
     void slotReloadButton();
-    void slotStopLoading();        
-    void slotDeleteButtonClicked();    
+    void slotStopLoading();
+    void slotDeleteButtonClicked();
 };
 
 
@@ -109,45 +109,46 @@ private:
 /*------------------------------------------------------------*/
 
 
-class KitaThreadDock : public KitaDockWidgetBase{
+class KitaThreadDock : public KitaDockWidgetBase
+{
 
     Q_OBJECT
-       KitaThreadTabWidget* m_threadTab;
-       
+    KitaThreadTabWidget* m_threadTab;
+
 public:
     KitaThreadDock( KDockManager* dockManager,
-           const char* name,
-           const QPixmap &pixmap,
-           QWidget* parent = 0L,
-           const QString& strCaption = QString::null,
-           const QString& strTabPageLabel = QString::fromLatin1( " " ),
-           WFlags f = 0);
+                    const char* name,
+                    const QPixmap &pixmap,
+                    QWidget* parent = 0L,
+                    const QString& strCaption = QString::null,
+                    const QString& strTabPageLabel = QString::fromLatin1( " " ),
+                    WFlags f = 0 );
     ~KitaThreadDock();
 
     /* Main Thread view */
-    
-public: 
+
+public:
     KitaThreadTabWidget* setupAsMainView();
 
 public slots:
     void slotShowThread( const KURL& datURL, bool withNewTab );
 
-    /* Kita Navi */ 
+
+    /* Kita Navi */
+
 public:
     KitaThreadTabWidget* setupAsKitaNavi();
-    void  connectNaviSignals();
+    void connectNaviSignals();
 
 private slots:
     void slotShowThreadDock();
-    
-    void slotShowKitaNavi( const KURL& datURL, int startnum, int endnum);
-    void slotShowKitaNaviByID( const KURL& datURL, QString strid);
-    void slotShowKitaNaviByWord( const KURL& datURL, QString query);
-    void slotShowKitaNaviByName( const KURL& datURL, QString query );    
-    void slotShowKitaNaviResTree( const KURL& datURL, int resNum);
-    void slotShowKitaNaviRevResTree( const KURL& datURL, int resNum );    
+
+    void slotShowKitaNavi( const KURL& datURL, int startnum, int endnum );
+    void slotShowKitaNaviByID( const KURL& datURL, QString strid );
+    void slotShowKitaNaviByWord( const KURL& datURL, QString query );
+    void slotShowKitaNaviByName( const KURL& datURL, QString query );
+    void slotShowKitaNaviResTree( const KURL& datURL, int resNum );
+    void slotShowKitaNaviRevResTree( const KURL& datURL, int resNum );
 };
 
 
index 48f7861..d364da9 100644 (file)
@@ -113,7 +113,7 @@ void KitaWriteTabWidget::openWriteView( int mode, const KURL& url,
 /* close view which URL is url. */ /* public slot */
 void KitaWriteTabWidget::slotCloseWriteTab( const KURL& url )
 {
-    KitaWriteView* view = findWriteView( url );
+    KitaWriteView * view = findWriteView( url );
     if ( view ) slotCloseTab( indexOf( view ) );
 }
 
@@ -134,7 +134,7 @@ void KitaWriteTabWidget::connectSignals()
 KitaWriteView* KitaWriteTabWidget::findWriteView( const KURL& url )
 {
     KURL datURL = Kita::getDatURL( url );
-    if( datURL.isEmpty() ) return NULL;
+    if ( datURL.isEmpty() ) return NULL;
 
     int max = count();
     if ( max == 0 ) return NULL;
index be49526..10a6418 100644 (file)
 
 class KitaWriteView;
 
-/*-----------------------------------------------*/    
+/*-----------------------------------------------*/
 
 
 class KitaWriteTabWidget : public KitaTabWidgetBase
 {
     Q_OBJECT
-       
+
 public:
     KitaWriteTabWidget( QWidget* parent = 0, const char* name = 0, WFlags f = 0 );
     ~KitaWriteTabWidget();
 
 public slots:
     void slotShowWriteView( const KURL& url, const QString& resStr );
-    void slotCreateNewThread( const KURL& url, const QString& resStr, const QString& subject);
-    void slotCloseWriteTab( const KURL& url ); 
-    
+    void slotCreateNewThread( const KURL& url, const QString& resStr, const QString& subject );
+    void slotCloseWriteTab( const KURL& url );
+
 private:
     void openWriteView( int mode, const KURL& url, const QString& resStr, const QString& subject );
-    void connectSignals(); 
+    void connectSignals();
     KitaWriteView* findWriteView( const KURL& url );
     KitaWriteView* isWriteView( QWidget* w );
 
 private slots:
     void slotChangeWriteTab( const KURL& url );
-    
+
 protected:
     virtual void deleteWidget( QWidget* w );
 
 
     /*------------------------------------*/
     /* KitaWriteTabWidget actions */
-    
-private:    
+
+private:
     void setupActions();
-    
+
 public slots:
     void slotQuoteClipboard();
 };
@@ -71,26 +71,27 @@ public:
 /*------------------------------------------------------------*/
 
 
-class KitaWriteDock : public KitaDockWidgetBase{
+class KitaWriteDock : public KitaDockWidgetBase
+{
 
     Q_OBJECT
-       KitaWriteTabWidget* m_writeTab;
-       
+    KitaWriteTabWidget* m_writeTab;
+
 public:
     KitaWriteDock( KDockManager* dockManager,
-           const char* name,
-           const QPixmap &pixmap,
-           QWidget* parent = 0L,
-           const QString& strCaption = QString::null,
-           const QString& strTabPageLabel = QString::fromLatin1( " " ),
-           WFlags f = 0);
+                   const char* name,
+                   const QPixmap &pixmap,
+                   QWidget* parent = 0L,
+                   const QString& strCaption = QString::null,
+                   const QString& strTabPageLabel = QString::fromLatin1( " " ),
+                   WFlags f = 0 );
     ~KitaWriteDock();
 
     KitaWriteTabWidget* setup();
 
 public slots:
     void slotShowWriteView( const KURL& url, const QString& resStr );
-    void slotCreateNewThread( const KURL& url, const QString& resStr, const QString& subject);
+    void slotCreateNewThread( const KURL& url, const QString& resStr, const QString& subject );
 };
 
 
index 8944097..5784aa7 100644 (file)
@@ -46,7 +46,7 @@ void Access::getcache()
 {
     QString orgData;
     init();
-    
+
     QString cachePath = Kita::Cache::getPath( m_datURL );
 
     if ( cachePath != QString::null ) {
@@ -57,24 +57,24 @@ void Access::getcache()
         }
     }
 
-    if( orgData == QString::null ) return;
+    if ( orgData == QString::null ) return ;
     m_dataSize = orgData.length();
 
-    switch( m_bbstype ){
+    switch ( m_bbstype ) {
 
     case Board_2ch:
-    case Board_MachiBBS: /* Machi BBS's data is already parsed as 2ch dat. */
+    case Board_MachiBBS:  /* Machi BBS's data is already parsed as 2ch dat. */
 
-    {
-       QString tmpData = Kita::qcpToUnicode( orgData );
-       QStringList tmpList = QStringList::split( "\n", tmpData );
-       emit receiveData( tmpList );
-    }
-       break;
+        {
+            QString tmpData = Kita::qcpToUnicode( orgData );
+            QStringList tmpList = QStringList::split( "\n", tmpData );
+            emit receiveData( tmpList );
+        }
+        break;
 
     default:
-       emitDatLineList( orgData );
-       break;
+        emitDatLineList( orgData );
+        break;
     }
 }
 
@@ -107,33 +107,33 @@ bool Access::getupdate( int readNum )
     m_threadData = QString::null;
     m_firstReceive = FALSE;
     m_invalidDataReceived = FALSE;
-    m_lastLine = QString::null;       
+    m_lastLine = QString::null;
 
     /* set URL of data */
     QString getURL;
-    switch( m_bbstype ){
+    switch ( m_bbstype ) {
 
     case Board_MachiBBS:
-       getURL = Kita::getThreadURL( m_datURL );
-       if( m_readNum > 0 ) getURL += "&START=" + QString().setNum( m_readNum +1 );
-       Kita::InitParseMachiBBS();
-       break;
+        getURL = Kita::getThreadURL( m_datURL );
+        if ( m_readNum > 0 ) getURL += "&START=" + QString().setNum( m_readNum + 1 );
+        Kita::InitParseMachiBBS();
+        break;
 
     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 ) + "-";
-       break;
+        getURL = Kita::getThreadURL( m_datURL );
+        getURL.replace( "read.cgi", "rawmode.cgi" );  /* adhoc... */
+        if ( m_readNum > 0 ) getURL += "/" + QString().setNum( m_readNum + 1 ) + "-";
+        break;
 
     default:
-       getURL = m_datURL.prettyURL();
+        getURL = m_datURL.prettyURL();
     }
-    
+
     /* set UserAgent */
     const QString useragent = QString( "Monazilla/1.00 (Kita/%1)" ).arg( VERSION );
     KIO::SlaveConfig::self() ->setConfigData( "http",
-                                             KURL( getURL ).host(),
-                                             "UserAgent", useragent );
+            KURL( getURL ).host(),
+            "UserAgent", useragent );
 
     /* create new job */
     KIO::TransferJob* job = KIO::get( getURL, true, false );
@@ -148,8 +148,8 @@ bool Access::getupdate( int readNum )
 
     /* resume */
     if ( m_bbstype != Board_MachiBBS
-         && m_bbstype != Board_JBBS
-         && m_dataSize > 0 ) {
+            && m_bbstype != Board_JBBS
+            && m_dataSize > 0 ) {
         m_firstReceive = TRUE; /* remove first char (i.e. \n). see also slotReceiveThreadData() */
         job->addMetaData( "resume", QString::number( m_dataSize - 1 ) );
         job->addMetaData( "AllowCompressedPage", "false" );
@@ -175,13 +175,13 @@ void Access::slotReceiveThreadData( KIO::Job*, const QByteArray& data )
 {
     QString cstr( data );
 
-    if( m_bbstype == Board_MachiBBS
-       || m_bbstype == Board_JBBS ){
-       
-       emitDatLineList( cstr );
-       return;
+    if ( m_bbstype == Board_MachiBBS
+            || m_bbstype == Board_JBBS ) {
+
+        emitDatLineList( cstr );
+        return ;
     }
-    
+
     /* check if received data is invalid ( or broken ). */
     if ( ( m_dataSize > 0 && responseCode() != 206 )
             || ( m_firstReceive && cstr[ 0 ] != '\n' )
@@ -206,7 +206,7 @@ void Access::emitDatLineList( const QString& dataStream )
 {
     QStringList lineList;
     QStringList datLineList;
-    if( dataStream == QString::null ) return;
+    if ( dataStream == QString::null ) return ;
 
     bool endIsLF = FALSE;
     if ( dataStream.at( dataStream.length() - 1 ) == '\n' ) endIsLF = TRUE;
@@ -214,75 +214,75 @@ void Access::emitDatLineList( const QString& dataStream )
     /* split the stream */
     m_lastLine += dataStream;
     lineList = QStringList::split( "\n", m_lastLine );
-    m_lastLine = QString::null;    
+    m_lastLine = QString::null;
 
     /* save the last line */
-    if( !endIsLF ){
+    if ( !endIsLF ) {
+
+        QStringList::iterator lastit = lineList.end();
+        lastit--;
+        if ( lastit != lineList.end() ) {
 
-       QStringList::iterator lastit = lineList.end();
-      lastit--;
-       if ( lastit != lineList.end() ) {
-           
             m_lastLine = ( *lastit );
             lineList.remove( lastit );
         }
     }
 
     /* filtering */
-    
+
     /* convert lines into 2ch dat */
     int count = lineList.count();
-    for ( int i = 0; i < count ; ++i ){
+    for ( int i = 0; i < count ; ++i ) {
 
         if ( lineList[ i ] != QString::null ) {
-           
-           QString line;
-           int nextNum = m_readNum +1;
-
-           /* convert line */
-           switch( m_bbstype ){
-
-           case Board_MachiBBS:
-               line = Kita::ParseMachiBBSOneLine( lineList[ i ] , nextNum );
-               break;
-               
-           case Board_JBBS:
-               line = Kita::ParseJBBSOneLine( lineList[ i ] , nextNum );
-               break;
-
-           case Board_FlashCGI:
-               line = Kita::ParseFlashCGIOneLine( lineList[ i ] );
-               break;
-
-           default:
-               line = lineList[ i ];
-           }
-
-           if( line == QString::null ) continue;
-
-           /* add abone lines */
-           const QString aboneStr = "abone<><><>abone<>";
-           while( nextNum > m_readNum +1 ){
-               datLineList += aboneStr;
-               m_threadData += aboneStr +"\n";
-               ++m_readNum;
-           }
-
-           /* save line */
-           if( m_bbstype == Board_MachiBBS ) m_threadData += line + "\n";
-           else m_threadData += lineList[ i ] + "\n";
-           ++m_readNum;
-
-           /* encode line */
-           switch( m_bbstype ){
-
-           case Board_JBBS:
-               datLineList += Kita::ecuToUnicode( line );
-               break;
-
-           default:
-               datLineList += Kita::qcpToUnicode( line );
-           }
+
+            QString line;
+            int nextNum = m_readNum + 1;
+
+            /* convert line */
+            switch ( m_bbstype ) {
+
+            case Board_MachiBBS:
+                line = Kita::ParseMachiBBSOneLine( lineList[ i ] , nextNum );
+                break;
+
+            case Board_JBBS:
+                line = Kita::ParseJBBSOneLine( lineList[ i ] , nextNum );
+                break;
+
+            case Board_FlashCGI:
+                line = Kita::ParseFlashCGIOneLine( lineList[ i ] );
+                break;
+
+            default:
+                line = lineList[ i ];
+            }
+
+            if ( line == QString::null ) continue;
+
+            /* add abone lines */
+            const QString aboneStr = "abone<><><>abone<>";
+            while ( nextNum > m_readNum + 1 ) {
+                datLineList += aboneStr;
+                m_threadData += aboneStr + "\n";
+                ++m_readNum;
+            }
+
+            /* save line */
+            if ( m_bbstype == Board_MachiBBS ) m_threadData += line + "\n";
+            else m_threadData += lineList[ i ] + "\n";
+            ++m_readNum;
+
+            /* encode line */
+            switch ( m_bbstype ) {
+
+            case Board_JBBS:
+                datLineList += Kita::ecuToUnicode( line );
+                break;
+
+            default:
+                datLineList += Kita::qcpToUnicode( line );
+            }
         }
     }
 
@@ -410,7 +410,7 @@ void OfflawAccess::slotReceiveThreadData( KIO::Job*, const QByteArray& data )
     if ( m_invalidDataReceived ) return ;
 
     // "+OK ....../1024K\tLocation:temp/\n"
-    if ( m_threadData.isEmpty() && cstr[0] == '+' ) {
+    if ( m_threadData.isEmpty() && cstr[ 0 ] == '+' ) {
         // skip first line.
         int index = cstr.find( '\n' );
         cstr = cstr.mid( index + 1 );
index c9f54cd..676eb95 100644 (file)
@@ -34,7 +34,7 @@ namespace Kita
         Access( const KURL& datURL );
         virtual ~Access() {};
 
-       void init();
+        void init();
         QString get();
         void killJob();
         void stopJob();
@@ -47,7 +47,7 @@ namespace Kita
 
     protected:
         void writeCacheData();
-        void emitDatLineList( const QString& dataStream );     
+        void emitDatLineList( const QString& dataStream );
 
         const KURL m_datURL;
         KIO::Job* m_currentJob;
@@ -56,7 +56,7 @@ namespace Kita
         int m_dataSize;
         bool m_firstReceive;
         bool m_invalidDataReceived;
-        int m_bbstype; 
+        int m_bbstype;
         int m_readNum;
         QString m_lastLine;
 
index 3239273..217c8f8 100644 (file)
@@ -1,12 +1,12 @@
 /***************************************************************************
- *   Copyright (C) 2004 by Kita Developers                                 *
- *   ikemo@users.sourceforge.jp                                            *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2004 by Kita Developers                                 *
+*   ikemo@users.sourceforge.jp                                            *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 #include "account.h"
 
 #include <config.h>
@@ -42,7 +42,7 @@ Account::~Account()
 
 bool Account::login( const QString& userID, const QString& password )
 {
-    return getInstance()->loginInternal( userID, password );
+    return getInstance() ->loginInternal( userID, password );
 }
 
 bool Account::loginInternal( const QString& userID, const QString& password )
@@ -50,7 +50,7 @@ bool Account::loginInternal( const QString& userID, const QString& password )
     m_data.resize( 0 );
 
     KURL url( "https://2chv.tora3.net/futen.cgi" );
-    QString postData = QString("ID=") + userID + QString("&PW=") + password;
+    QString postData = QString( "ID=" ) + userID + QString( "&PW=" ) + password;
 
     KIO::SlaveConfig::self() ->setConfigData( "https",
             url.host(),
@@ -80,30 +80,23 @@ void Account::slotReceiveData( KIO::Job*, const QByteArray& data )
 void Account::slotResult( KIO::Job* job )
 {
     m_job = 0;
-    if ( job->error() )
-    {
+    if ( job->error() ) {
         job->showErrorDialog();
     }
 
     QString str( m_data );
     QRegExp regexp( "SESSION-ID=(.*)" );
-    if ( regexp.search( str ) == -1 )
-    {
+    if ( regexp.search( str ) == -1 ) {
         m_sessionID = QString::null;
         m_isLogged = false;
-    }
-    else
-    {
+    } else {
         QString value = regexp.cap( 1 );
 
         QRegExp error( "^ERROR:p+$" );
-        if ( error.search( value ) == -1 )
-        {
+        if ( error.search( value ) == -1 ) {
             m_isLogged = true;
             m_sessionID = value;
-        }
-        else
-        {
+        } else {
             m_isLogged = false;
             m_sessionID = QString::null;
         }
index 361b130..d054003 100644 (file)
@@ -1,12 +1,12 @@
 /***************************************************************************
- *   Copyright (C) 2004 by Kita Developers                                 *
- *   ikemo@users.sourceforge.jp                                            *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2004 by Kita Developers                                 *
+*   ikemo@users.sourceforge.jp                                            *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 #ifndef KITAACCOUNT_H
 #define KITAACCOUNT_H
 
@@ -42,8 +42,8 @@ namespace Kita
         void slotReceiveData( KIO::Job* job, const QByteArray& data );
         void slotResult( KIO::Job* job );
     public:
-        static const QString& getSessionID() { return getInstance()->m_sessionID; }
-        static bool isLogged() { return getInstance()->m_isLogged; }
+        static const QString& getSessionID() { return getInstance() ->m_sessionID; }
+        static bool isLogged() { return getInstance() ->m_isLogged; }
         static bool login( const QString& userID, const QString& password );
     };
 
index 5d00618..759496b 100644 (file)
@@ -41,12 +41,12 @@ using namespace Kita;
 /* BoardData */
 
 BoardData::BoardData( const QString& boardName,
-                     const QString& hostname,
-                     const QString& rootPath,
-                     const QString& delimiter,
-                     const QString& bbsPath,
-                     const QString& ext,
-                     int boardtype )
+                      const QString& hostname,
+                      const QString& rootPath,
+                      const QString& delimiter,
+                      const QString& bbsPath,
+                      const QString& ext,
+                      int boardtype )
 {
     m_readIdx = FALSE;
     m_boardName = boardName;
@@ -60,7 +60,7 @@ BoardData::BoardData( const QString& boardName,
     setHostName( hostname );
 
     /* create default key */
-    QStringList keyHosts = m_hostname;    
+    QStringList keyHosts = m_hostname;
     createKeys( keyHosts );
 
     /* reset SETTING.TXT */
@@ -79,16 +79,16 @@ void BoardData::setHostName( const QString& hostName )
     /* m_basePath = (hostname)/(rootPath)/(bbsPath)/ */
     m_basePath = m_hostname + m_rootPath + m_bbsPath + "/";
 
-    switch( m_type ){
+    switch ( m_type ) {
 
-    case Board_MachiBBS: /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)?BBS=(bbsPath) */
-       m_cgiBasePath = m_hostname + m_rootPath + m_delimiter + "?BBS=" + m_bbsPath.mid( 1 );
-       break;
+    case Board_MachiBBS:  /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)?BBS=(bbsPath) */
+        m_cgiBasePath = m_hostname + m_rootPath + m_delimiter + "?BBS=" + m_bbsPath.mid( 1 );
+        break;
 
-    /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ */
+        /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ */
     default:
-       m_cgiBasePath = m_hostname +  m_rootPath + m_delimiter + m_bbsPath + "/";       
-       break;
+        m_cgiBasePath = m_hostname + m_rootPath + m_delimiter + m_bbsPath + "/";
+        break;
     }
 }
 
@@ -206,12 +206,12 @@ const KURL& BoardData::titleImgURL() const
 void BoardData::setSettingLoaded( bool set )
 {
     m_settingLoaded = set;
-    if( ! set ){
-       m_defaultName = QString::null;
-       m_linenum = 0;
-       m_msgCount = 0;
-       m_titleImgURL = QString::null; 
-    }
+    if ( ! set ) {
+            m_defaultName = QString::null;
+            m_linenum = 0;
+            m_msgCount = 0;
+            m_titleImgURL = QString::null;
+        }
 }
 
 /* public */
@@ -249,28 +249,28 @@ void BoardData::createKeys( const QStringList& keyHostList )
     m_keyBasePathList.clear();
     m_keyCgiBasePathList.clear();
     m_keyHostList.clear();
-   
+
     m_keyHostList = keyHostList;
 
-    /* m_basePath = (hostname)/(rootPath)/(bbsPath)/ */    
-    for( unsigned int i = 0; i < m_keyHostList.count(); ++i ){
-       if( m_keyHostList[i].length() > 0 )
-           m_keyBasePathList += m_keyHostList[i] + m_rootPath + m_bbsPath + "/";
+    /* m_basePath = (hostname)/(rootPath)/(bbsPath)/ */
+    for ( unsigned int i = 0; i < m_keyHostList.count(); ++i ) {
+        if ( m_keyHostList[ i ].length() > 0 )
+            m_keyBasePathList += m_keyHostList[ i ] + m_rootPath + m_bbsPath + "/";
     }
 
-    switch( m_type ){
+    switch ( m_type ) {
 
-    case Board_MachiBBS: /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)?BBS=(bbsPath) */
-       for( unsigned int i = 0; i < m_keyHostList.count(); ++i )
-           m_keyCgiBasePathList += m_keyHostList[i] + m_rootPath + m_delimiter
-               + "?BBS=" + m_bbsPath.mid( 1 );
-       break;
+    case Board_MachiBBS:  /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)?BBS=(bbsPath) */
+        for ( unsigned int i = 0; i < m_keyHostList.count(); ++i )
+            m_keyCgiBasePathList += m_keyHostList[ i ] + m_rootPath + m_delimiter
+                                    + "?BBS=" + m_bbsPath.mid( 1 );
+        break;
 
-    /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ */
+        /* m_cgiBasePath = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ */
     default:
-       for( unsigned int i = 0; i < m_keyHostList.count(); ++i )
-           m_keyCgiBasePathList += m_keyHostList[i] +  m_rootPath + m_delimiter + m_bbsPath + "/";
-       break;
+        for ( unsigned int i = 0; i < m_keyHostList.count(); ++i )
+            m_keyCgiBasePathList += m_keyHostList[ i ] + m_rootPath + m_delimiter + m_bbsPath + "/";
+        break;
     }
 }
 
@@ -322,8 +322,8 @@ BoardManager::~BoardManager()
 /* (hostname)/(rootPath)/(bbsPath)/ */ /* public */ /* static */
 const QString BoardManager::boardURL( const KURL& url )
 {
-    BoardData* bdata = getBoardData( url );
-    if( bdata == NULL ) return QString::null;
+    BoardData * bdata = getBoardData( url );
+    if ( bdata == NULL ) return QString::null;
 
     return bdata->basePath();
 }
@@ -335,25 +335,25 @@ const QStringList BoardManager::allBoardURLList()
     urlList.clear();
 
     for ( BoardDataList::Iterator it = m_boardDataList.begin(); it != m_boardDataList.end(); ++it )
-       urlList += (*it)->basePath();
-    
+        urlList += ( *it ) ->basePath();
+
     return urlList;
 }
 
 /* (hostname)/(rootPath) */ /* public */ /* static */
 const QString BoardManager::boardRoot( const KURL& url )
 {
-    BoardData* bdata = getBoardData( url );
-    if( bdata == NULL ) return QString::null;
+    BoardData * bdata = getBoardData( url );
+    if ( bdata == NULL ) return QString::null;
 
-    return bdata->hostName() + bdata->rootPath(); 
+    return bdata->hostName() + bdata->rootPath();
 }
 
 /* (bbspath) */ /* public */ /* static */
 const QString BoardManager::boardPath( const KURL& url )
 {
-    BoardData* bdata = getBoardData( url );
-    if( bdata == NULL ) return QString::null;
+    BoardData * bdata = getBoardData( url );
+    if ( bdata == NULL ) return QString::null;
 
     return bdata->bbsPath();
 }
@@ -361,8 +361,8 @@ const QString BoardManager::boardPath( const KURL& url )
 /* (ext) */ /* public */ /* static */
 const QString BoardManager::ext( const KURL& url )
 {
-    BoardData* bdata = getBoardData( url );
-    if( bdata == NULL ) return QString::null;
+    BoardData * bdata = getBoardData( url );
+    if ( bdata == NULL ) return QString::null;
 
     return bdata->ext();
 }
@@ -370,8 +370,8 @@ const QString BoardManager::ext( const KURL& url )
 /* ID of board for writing */ /* public */ /* static */
 const QString BoardManager::boardID( const KURL& url )
 {
-    BoardData* bdata = getBoardData( url );
-    if( bdata == NULL ) return QString::null;
+    BoardData * bdata = getBoardData( url );
+    if ( bdata == NULL ) return QString::null;
 
     return bdata->bbsPath().mid( 1 ); /* remove "/" */
 }
@@ -380,8 +380,8 @@ const QString BoardManager::boardID( const KURL& url )
 /* (hostname)/(rootPath)/(bbsPath)/subject.txt */ /* public */ /* static */
 const QString BoardManager::subjectURL( const KURL& url )
 {
-    BoardData* bdata = getBoardData( url );
-    if( bdata == NULL ) return QString::null;
+    BoardData * bdata = getBoardData( url );
+    if ( bdata == NULL ) return QString::null;
 
     return bdata->basePath() + "subject.txt";
 }
@@ -390,8 +390,8 @@ const QString BoardManager::subjectURL( const KURL& url )
 /* public */ /* static */
 const QString BoardManager::boardName( const KURL& url )
 {
-    BoardData* bdata = getBoardData( url );
-    if( bdata == NULL ) return QString::null;
+    BoardData * bdata = getBoardData( url );
+    if ( bdata == NULL ) return QString::null;
 
     return bdata->boardName();
 }
@@ -400,8 +400,8 @@ const QString BoardManager::boardName( const KURL& url )
 /* public */ /* static */
 const int BoardManager::type( const KURL& url )
 {
-    BoardData* bdata = getBoardData( url );
-    if( bdata == NULL ) return Board_Unknown;
+    BoardData * bdata = getBoardData( url );
+    if ( bdata == NULL ) return Board_Unknown;
 
     return bdata->type();
 }
@@ -414,16 +414,16 @@ const int BoardManager::type( const KURL& url )
 /*  get list of pointers of Thread classes.     */
 /*
   Input:
-
   url:  URL of board.
   oldLogs: If TRUE, search cache and get list of pointer of old threads.
   online: online or offline mode.
-
   Output:
-
   threadList: list of pointers of Thread classes.
   oldLogList: list of pointers of old threads.
-
                                                  */ /* public */ /* static */
 void BoardManager::getThreadList(
 
@@ -431,7 +431,7 @@ void BoardManager::getThreadList(
     const KURL& url,
     bool oldLogs,
     bool online,
-    
+
     /* output */
     QPtrList< Thread >& threadList,
     QPtrList< Thread >& oldLogList )
@@ -442,58 +442,58 @@ void BoardManager::getThreadList(
     /* get all obtained threads list from cache */
     if ( url.prettyURL() == "http://virtual/obtained/" ) {
 
-       QStringList bbslist = allBoardURLList();
+        QStringList bbslist = allBoardURLList();
 
-       /* search all cache dirs */
+        /* search all cache dirs */
         for ( QStringList::iterator it = bbslist.begin() ; it != bbslist.end(); ++it ) {
 
-           getCachedThreadList( ( *it ), threadList );
+            getCachedThreadList( ( *it ), threadList );
         }
 
-        return;
+        return ;
     }
 
     /*-------------------------*/
 
     BoardData* bdata = getBoardData( url );
-    if( bdata == NULL ) return;
-    
+    if ( bdata == NULL ) return ;
+
     /* download subject.txt */
-    if( online ){
-
-       /* make directory */
-       QString cacheDir = Cache::baseDir() + Cache::serverDir( url ) + Cache::boardDir( url );
-       if( !Kita::mkdir( cacheDir ) ) return;
-       
-       KIO::SlaveConfig::self() ->setConfigData( "http",
-                                                 url.host() ,
-                                                 "UserAgent",
-                                                 QString( "Monazilla/1.00 (Kita/%1)" ).arg( VERSION ) );
-       QString subjectPath = Cache::getSubjectPath( url );
+    if ( online ) {
+
+        /* make directory */
+        QString cacheDir = Cache::baseDir() + Cache::serverDir( url ) + Cache::boardDir( url );
+        if ( !Kita::mkdir( cacheDir ) ) return ;
+
+        KIO::SlaveConfig::self() ->setConfigData( "http",
+                url.host() ,
+                "UserAgent",
+                QString( "Monazilla/1.00 (Kita/%1)" ).arg( VERSION ) );
+        QString subjectPath = Cache::getSubjectPath( url );
 #if KDE_IS_VERSION( 3, 2, 0 )
-       KIO::NetAccess::download( subjectURL( url ), subjectPath, NULL );
+        KIO::NetAccess::download( subjectURL( url ), subjectPath, NULL );
 #else
-       KIO::NetAccess::download( subjectURL( url ), subjectPath );
+        KIO::NetAccess::download( subjectURL( url ), subjectPath );
 #endif
 
-       /* download SETTING.TXT */
-       loadBBSSetting( url );
+        /* download SETTING.TXT */
+        loadBBSSetting( url );
     }
 
     /* open and read subject.txt */
     readSubjectTxt( bdata, url, threadList );
-    
+
     /* get old logs */
-    if( oldLogs ){
-           
-       QPtrList< Thread > tmpList;
-       tmpList.clear();
-       getCachedThreadList( url, tmpList );
-
-       for ( unsigned i = 0; i < tmpList.count(); i++ ) {
-               
-           if( threadList.contains( tmpList.at( i ) ) == 0 ) oldLogList.append( tmpList.at( i ) );
-       }
+    if ( oldLogs ) {
+
+        QPtrList< Thread > tmpList;
+        tmpList.clear();
+        getCachedThreadList( url, tmpList );
+
+        for ( unsigned i = 0; i < tmpList.count(); i++ ) {
+
+            if ( threadList.contains( tmpList.at( i ) ) == 0 ) oldLogList.append( tmpList.at( i ) );
+        }
     }
 }
 
@@ -502,63 +502,63 @@ void BoardManager::getThreadList(
 void BoardManager::getCachedThreadList( const KURL& url, QPtrList< Thread >& threadList )
 {
     QString cacheDir = Cache::baseDir() + Cache::serverDir( url ) + Cache::boardDir( url );
-    QDir d( cacheDir );    
+    QDir d( cacheDir );
     if ( d.exists() ) {
-    
-       /* get all file names */
-       QString ext = BoardManager::getBoardData( url )->ext();
-       QString boardURL = BoardManager::getBoardData( url )->basePath();
-       QStringList flist = d.entryList( "*" + ext );
-               
-       for ( QStringList::iterator it = flist.begin(); it != flist.end(); ++it ) {
-           if ( ( *it ) == QString::null ) continue;
-
-           QString datURL = boardURL + "dat/" + ( *it );
-
-           /* read idx file */
-           Kita::Thread* thread = Kita::Thread::getByURLNew( datURL );
-           if( thread == NULL ){
-
-               thread = Kita::Thread::getByURL( datURL );
-               if( thread == NULL ) continue;
-               ThreadIndex::loadIndex( thread, datURL, FALSE );
-           }
-
-           if( thread != NULL ) threadList.append( thread );
-       }
+
+        /* get all file names */
+        QString ext = BoardManager::getBoardData( url ) ->ext();
+        QString boardURL = BoardManager::getBoardData( url ) ->basePath();
+        QStringList flist = d.entryList( "*" + ext );
+
+        for ( QStringList::iterator it = flist.begin(); it != flist.end(); ++it ) {
+            if ( ( *it ) == QString::null ) continue;
+
+            QString datURL = boardURL + "dat/" + ( *it );
+
+            /* read idx file */
+            Kita::Thread* thread = Kita::Thread::getByURLNew( datURL );
+            if ( thread == NULL ) {
+
+                thread = Kita::Thread::getByURL( datURL );
+                if ( thread == NULL ) continue;
+                ThreadIndex::loadIndex( thread, datURL, FALSE );
+            }
+
+            if ( thread != NULL ) threadList.append( thread );
+        }
     }
 }
 
 
 
-/* open subject.txt and get list of Thread classes */ /* private */ /* static */ 
+/* open subject.txt and get list of Thread classes */ /* private */ /* static */
 bool BoardManager::readSubjectTxt( BoardData* bdata, const KURL& url, QPtrList< Thread >& threadList )
 {
     /* get all names of cached files to read idx.  */
     QStringList cacheList;
-    if( !bdata->readIdx() ){
-       
-       QString cacheDir = Cache::baseDir() + Cache::serverDir( url ) + Cache::boardDir( url );
-       QDir d( cacheDir );    
-       if ( d.exists() ) {
-           QString ext = BoardManager::getBoardData( url )->ext();
-           cacheList = d.entryList( "*" + ext );
-       }
+    if ( !bdata->readIdx() ) {
+
+        QString cacheDir = Cache::baseDir() + Cache::serverDir( url ) + Cache::boardDir( url );
+        QDir d( cacheDir );
+        if ( d.exists() ) {
+            QString ext = BoardManager::getBoardData( url ) ->ext();
+            cacheList = d.entryList( "*" + ext );
+        }
     }
 
     /* open subject.txt */
     QString subjectPath = Cache::getSubjectPath( url );
     QIODevice * device = KFilterDev::deviceForFile( subjectPath, "application/x-gzip" );
-    if( !device->open( IO_ReadOnly ) ) return FALSE;
+    if ( !device->open( IO_ReadOnly ) ) return FALSE;
 
     QTextStream stream( device );
 
     if ( BoardManager::type( url ) == Board_JBBS ) {
-       if ( !m_eucJpCodec ) m_eucJpCodec = new QEucJpCodec();  
-       stream.setCodec( m_eucJpCodec );
+        if ( !m_eucJpCodec ) m_eucJpCodec = new QEucJpCodec();
+        stream.setCodec( m_eucJpCodec );
     } else {
-       if ( !m_cp932Codec ) m_cp932Codec = new QCp932Codec();  
-       stream.setCodec( m_cp932Codec );
+        if ( !m_cp932Codec ) m_cp932Codec = new QCp932Codec();
+        stream.setCodec( m_cp932Codec );
     }
 
     // parse subject.txt(only one format...)
@@ -568,49 +568,49 @@ bool BoardManager::readSubjectTxt( BoardData* bdata, const KURL& url, QPtrList<
 
     case Board_MachiBBS:
     case Board_JBBS:
-       regexp.setPattern( "(\\d+\\.cgi),(.*)\\((\\d+)\\)" );
-       break;
+        regexp.setPattern( "(\\d+\\.cgi),(.*)\\((\\d+)\\)" );
+        break;
 
     default:
-       regexp.setPattern( "(\\d+\\.dat)<>(.*)\\((\\d+)\\)" );
-       break;
+        regexp.setPattern( "(\\d+\\.dat)<>(.*)\\((\\d+)\\)" );
+        break;
     }
     QString line;
 
     while ( ( line = stream.readLine() ) != QString::null ) {
-       int pos = regexp.search( line );
-       if ( pos != -1 ) {
-           QString fname = regexp.cap( 1 );
-           QString subject = regexp.cap( 2 );
-           QString num = regexp.cap( 3 );
-
-           /* get pointer of Thread class */
-           QString datURL = boardURL( url ) + "dat/" + fname;
-           Kita::Thread* thread = Kita::Thread::getByURL( datURL );
+        int pos = regexp.search( line );
+        if ( pos != -1 ) {
+            QString fname = regexp.cap( 1 );
+            QString subject = regexp.cap( 2 );
+            QString num = regexp.cap( 3 );
+
+            /* get pointer of Thread class */
+            QString datURL = boardURL( url ) + "dat/" + fname;
+            Kita::Thread* thread = Kita::Thread::getByURL( datURL );
             if ( threadList.find( thread ) == -1 ) {
-               threadList.append( thread );
+                threadList.append( thread );
             }
 
-           /* set thread name */           
-           thread->setThreadName( subject );
+            /* set thread name */
+            thread->setThreadName( subject );
 
-           /* load index file */
-           if( !bdata->readIdx() ){
+            /* load index file */
+            if ( !bdata->readIdx() ) {
 
-               if( cacheList.contains( fname ) ) ThreadIndex::loadIndex( thread, datURL, FALSE );
-           }
+                if ( cacheList.contains( fname ) ) ThreadIndex::loadIndex( thread, datURL, FALSE );
+            }
 
-           /* update res num */
-           int newNum = num.toInt();
-           if( thread->readNum() ){ /* cache exists */
-               int oldNum = thread->resNum();
+            /* update res num */
+            int newNum = num.toInt();
+            if ( thread->readNum() ) { /* cache exists */
+                int oldNum = thread->resNum();
 
-               if( newNum > oldNum ){
-                   Kita::ThreadIndex::setResNum( datURL, newNum );
-               }
-           }
-           thread->setResNum( newNum );
-       }
+                if ( newNum > oldNum ) {
+                    Kita::ThreadIndex::setResNum( datURL, newNum );
+                }
+            }
+            thread->setResNum( newNum );
+        }
     }
 
     device->close();
@@ -623,10 +623,10 @@ bool BoardManager::readSubjectTxt( BoardData* bdata, const KURL& url, QPtrList<
 /* BoardData */
 
 /* reset all BoardData */ /* public */ /* static */
-void  BoardManager::clearBoardData()
+void BoardManager::clearBoardData()
 {
     for ( BoardDataList::Iterator it = m_boardDataList.begin(); it != m_boardDataList.end(); ++it )
-       delete( *it );
+        delete( *it );
 
     m_boardDataList.clear();
     m_previousBoardData = NULL;
@@ -637,20 +637,20 @@ void  BoardManager::clearBoardData()
 
 /* Input: board, boardName, type, test
    Output: oldURL
-
    return: 
    If board is already enrolled, return Board_enrollEnrolled and oldURL is QString::null.
    If board is new board, return Board_enrollNew and oldURL is QString::null.
    If board is moved, return Board_enrollMoved, and oldURL is old URL.
-
    Note that board is NOT enrolled when board is moved.
    To enroll new URL, call BoardManager::moveBoard(). 
-
    "int type" is type of board. It could be "Kita::Board_Unknown". See also parseBoardURL().
    
    If "bool test" is TRUE, this function just checks if the board is enrolled (never enroll board).
-
-*/
+*/ 
 /* public */ /* static */
 int BoardManager::enrollBoard( const KURL& url, const QString& boardName, QString& oldURL, int type, bool test )
 {
@@ -662,29 +662,28 @@ int BoardManager::enrollBoard( const KURL& url, const QString& boardName, QStrin
     type = parseBoardURL( url, type, hostname, rootPath, delimiter, bbsPath, ext );
     oldURL = QString::null;
 
-    if( type == Board_Unknown ) return Board_enrollFailed;
-    
+    if ( type == Board_Unknown ) return Board_enrollFailed;
+
     /* check if the board is enrolled or moved. */
-    for ( BoardDataList::Iterator it = m_boardDataList.begin(); it != m_boardDataList.end(); ++it ){
-       
-       if( ( *it )->boardName() == boardName
-           && ( *it )->type() == type
-           && ( *it )->bbsPath() == bbsPath ){
-           
-           if( ( *it )->hostName() ==  hostname 
-               && ( *it )->rootPath() == rootPath ){ /* enrolled */
-               return Board_enrollEnrolled;
-           }
-           else{ /* moved */
-               oldURL = ( *it )->basePath();
-               return Board_enrollMoved;
-           }
-       }
+    for ( BoardDataList::Iterator it = m_boardDataList.begin(); it != m_boardDataList.end(); ++it ) {
+
+        if ( ( *it ) ->boardName() == boardName
+                && ( *it ) ->type() == type
+                && ( *it ) ->bbsPath() == bbsPath ) {
+
+            if ( ( *it ) ->hostName() == hostname
+                    && ( *it ) ->rootPath() == rootPath ) { /* enrolled */
+                return Board_enrollEnrolled;
+            } else { /* moved */
+                oldURL = ( *it ) ->basePath();
+                return Board_enrollMoved;
+            }
+        }
     }
 
     /* test only */
-    if( test ) return Board_enrollNew;
-    
+    if ( test ) return Board_enrollNew;
+
     /* enroll new board */
     BoardData* bdata = new BoardData( boardName, hostname, rootPath, delimiter, bbsPath, ext, type );
     m_boardDataList.append( bdata );
@@ -699,7 +698,7 @@ int BoardManager::parseBoardURL(
 
     /* input */
     const KURL& url,
-    int type,  /* If type = Board_Unknown, type will be decided according to url. */
+    int type,   /* If type = Board_Unknown, type will be decided according to url. */
 
     /* output */
     QString& hostname,
@@ -715,57 +714,57 @@ int BoardManager::parseBoardURL(
     ext = QString::null;
 
     /* decide type */
-    if( type == Board_Unknown ){
-       
-       if( url.host().contains( "machi.to" ) ) type = Board_MachiBBS;  
-       else if( url.host().contains( "jbbs.livedoor.jp" ) ) type = Board_JBBS;
-       else type = Board_2ch;
+    if ( type == Board_Unknown ) {
+
+        if ( url.host().contains( "machi.to" ) ) type = Board_MachiBBS;
+        else if ( url.host().contains( "jbbs.livedoor.jp" ) ) type = Board_JBBS;
+        else type = Board_2ch;
     }
 
     /* parse */
-    switch( type ){
-
-    case Board_MachiBBS:    /* MACHI : http:// *.machi.to/(bbsPath)/ */
-       
-       delimiter = "/bbs/read.pl";
-       bbsPath = url.filename();
-       ext = ".cgi";
-       break;
-
-    case Board_JBBS:  /* JBBS : http://jbbs.livedoor.jp/(bbsPath)/ */
-       
-       delimiter = "/bbs/read.cgi";
-       bbsPath = url.prettyURL().remove( hostname );
-       type = Board_JBBS;
-       ext = ".cgi";
-       break;
-
-    case Board_FlashCGI: /* test for Flash CGI/Mini Thread  */
-       
-       delimiter = "/test/read.cgi";
-       bbsPath = url.filename();
-       rootPath = url.prettyURL().remove( hostname + "/" ).remove( bbsPath + "/" );
-       if( rootPath.length() == 0 ) rootPath = QString::null;
-       ext = ".dat";
-       break;
-
-    default:  /* 2ch : http://(hostname)/(rootPath)/(bbsPath)/ */
-       
-       delimiter = "/test/read.cgi";
-       bbsPath = url.filename();
-       rootPath = url.prettyURL().remove( hostname + "/" ).remove( bbsPath + "/" );
-       if( rootPath.length() == 0 ) rootPath = QString::null;
-       ext = ".dat";
-       type = Board_2ch;
-       break;
+    switch ( type ) {
+
+    case Board_MachiBBS:     /* MACHI : http:// *.machi.to/(bbsPath)/ */
+
+        delimiter = "/bbs/read.pl";
+        bbsPath = url.filename();
+        ext = ".cgi";
+        break;
+
+    case Board_JBBS:   /* JBBS : http://jbbs.livedoor.jp/(bbsPath)/ */
+
+        delimiter = "/bbs/read.cgi";
+        bbsPath = url.prettyURL().remove( hostname );
+        type = Board_JBBS;
+        ext = ".cgi";
+        break;
+
+    case Board_FlashCGI:  /* test for Flash CGI/Mini Thread  */
+
+        delimiter = "/test/read.cgi";
+        bbsPath = url.filename();
+        rootPath = url.prettyURL().remove( hostname + "/" ).remove( bbsPath + "/" );
+        if ( rootPath.length() == 0 ) rootPath = QString::null;
+        ext = ".dat";
+        break;
+
+    default:   /* 2ch : http://(hostname)/(rootPath)/(bbsPath)/ */
+
+        delimiter = "/test/read.cgi";
+        bbsPath = url.filename();
+        rootPath = url.prettyURL().remove( hostname + "/" ).remove( bbsPath + "/" );
+        if ( rootPath.length() == 0 ) rootPath = QString::null;
+        ext = ".dat";
+        type = Board_2ch;
+        break;
     }
 
     /* For example, if bbsPath = "linux/", then m_bbsPath = "/linux" */
     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;
 }
@@ -774,7 +773,7 @@ int BoardManager::parseBoardURL(
 /* public */ /* static */
 bool BoardManager::isEnrolled( const KURL& url )
 {
-    if( getBoardData( url ) == NULL ) return FALSE;
+    if ( getBoardData( url ) == NULL ) return FALSE;
     return TRUE;
 }
 
@@ -782,28 +781,28 @@ bool BoardManager::isEnrolled( const KURL& url )
 /* public */ /* static */
 BoardData* BoardManager::getBoardData( const KURL& url )
 {
-    if( url.isEmpty() ) return NULL;
+    if ( url.isEmpty() ) return NULL;
     QString urlstr = url.prettyURL();
 
     /* cache */
-    if( m_previousBoardData != NULL && m_previousBoardURL == urlstr ) return m_previousBoardData;
-    
-    for ( BoardDataList::Iterator it = m_boardDataList.begin(); it != m_boardDataList.end(); ++it ){
-
-       int count = (*it)->keyBasePathList().count();
-       for( int i = 0; i < count ; ++i ){
-           if( urlstr.contains( (*it)->keyBasePathList()[i] )
-               || urlstr.contains( (*it)->keyCgiBasePathList()[i] ) ){
-
-            /* cache */
-           m_previousBoardData = (*it);
-           m_previousBoardURL = urlstr;
-           
-           return (*it);
-           }
-       }
+    if ( m_previousBoardData != NULL && m_previousBoardURL == urlstr ) return m_previousBoardData;
+
+    for ( BoardDataList::Iterator it = m_boardDataList.begin(); it != m_boardDataList.end(); ++it ) {
+
+        int count = ( *it ) ->keyBasePathList().count();
+        for ( int i = 0; i < count ; ++i ) {
+            if ( urlstr.contains( ( *it ) ->keyBasePathList() [ i ] )
+                    || urlstr.contains( ( *it ) ->keyCgiBasePathList() [ i ] ) ) {
+
+                /* cache */
+                m_previousBoardData = ( *it );
+                m_previousBoardURL = urlstr;
+
+                return ( *it );
+            }
+        }
     }
-    
+
     return NULL;
 }
 
@@ -814,42 +813,42 @@ BoardData* BoardManager::getBoardData( const KURL& url )
 
 
 /* load the bbs history file ( BBSHISTORY ), and create keys of Data Base.  */
-/* Before calling this, enroll the board by enrollBoard().                  */ 
+/* Before calling this, enroll the board by enrollBoard().                  */
 /*
     ex) If the host of board moved like :
-
     http:://aaa.com -> http://bbb.com -> http://ccc.com -> http://ddd.com
     
     then, BBSHISTORY is
-
     http://ccc.com
     http://bbb.com
     http://aaa.com
-
 */ /* public */ /* static */
 bool BoardManager::loadBBSHistory( const KURL& url )
 {
-    BoardData* bdata = getBoardData( url );
-    if( bdata == NULL ) return FALSE;
+    BoardData * bdata = getBoardData( url );
+    if ( bdata == NULL ) return FALSE;
+
+    QStringList keyHosts = bdata->hostName();
 
-    QStringList keyHosts = bdata->hostName();  
-    
     QFile file( Cache::getBBSHistoryPath( url ) );
-    if ( file.open( IO_ReadOnly ) ){
+    if ( file.open( IO_ReadOnly ) ) {
 
-       QTextStream ts( &file );
+        QTextStream ts( &file );
 
-       QString line;
-       while( !ts.eof() ){
+        QString line;
+        while ( !ts.eof() ) {
 
-           line = ts.readLine();
-           keyHosts += line;
-       }
+            line = ts.readLine();
+            keyHosts += line;
+        }
 
-       bdata->createKeys( keyHosts );
-       file.close();
+        bdata->createKeys( keyHosts );
+        file.close();
 
-       return TRUE;
+        return TRUE;
     }
 
     return FALSE;
@@ -859,7 +858,7 @@ bool BoardManager::loadBBSHistory( const KURL& url )
 /* public */ /* static */
 bool BoardManager::moveBoard( const KURL& fromURL, const KURL& toURL )
 {
-    QString oldhost = fromURL.protocol() + "://" + fromURL.host();    
+    QString oldhost = fromURL.protocol() + "://" + fromURL.host();
     QString newhost = toURL.protocol() + "://" + toURL.host();
 
     const QRegExp exp( "/$" );
@@ -869,16 +868,16 @@ bool BoardManager::moveBoard( const KURL& fromURL, const KURL& toURL )
     newURL.remove( exp );
     oldURL += "/";
     newURL += "/";
-    
-    if( oldURL == newURL ) return FALSE;
-    
+
+    if ( oldURL == newURL ) return FALSE;
+
     /* Is oldURL enrolled? */
-    BoardData* bdata = getBoardData( oldURL ); 
-    if( bdata == NULL ){
+    BoardData* bdata = getBoardData( oldURL );
+    if ( bdata == NULL ) {
 
-       /* Is newURL enrolled? */
-       bdata = getBoardData( newURL ); 
-       if( bdata == NULL ) return FALSE;
+        /* Is newURL enrolled? */
+        bdata = getBoardData( newURL );
+        if ( bdata == NULL ) return FALSE;
     }
 
 
@@ -890,13 +889,13 @@ bool BoardManager::moveBoard( const KURL& fromURL, const KURL& toURL )
     QStringList keyHosts = bdata->keyHostList();
     keyHosts.remove( oldhost );
     keyHosts.prepend( oldhost );
-    bdata->createKeys( keyHosts );    
+    bdata->createKeys( keyHosts );
     QString oldCachePath = Cache::baseDir() + Cache::serverDir( bdata->basePath() )
-       + Cache::boardDir( bdata->basePath() );
+                           + Cache::boardDir( bdata->basePath() );
 
     /* update URL */
     bdata->setHostName( newhost );
-    
+
     /* update keys */
     /* The order of keyHosts will be like this:
        
@@ -917,31 +916,30 @@ bool BoardManager::moveBoard( const KURL& fromURL, const KURL& toURL )
     bdata->setReadIdx( FALSE );
     bdata->setSettingLoaded( FALSE );
 
-    
+
     /*---------------------------*/
     /* move cache dir */
-    
+
     QDir qdir;
-    if( ! qdir.exists( oldCachePath ) ) return TRUE;
-    
+    if ( ! qdir.exists( oldCachePath ) ) return TRUE;
+
     /* mkdir new server dir */
-    QString newCachePath = Cache::baseDir() + Cache::serverDir( bdata->basePath() );    
+    QString newCachePath = Cache::baseDir() + Cache::serverDir( bdata->basePath() );
     Kita::mkdir( newCachePath );
-    
+
     /* backup old dir */
-    newCachePath += Cache::boardDir( bdata->basePath() );    
-    if( qdir.exists ( newCachePath ) ){
-       QString bkupPath = newCachePath;
-       bkupPath.truncate( bkupPath.length() -1 ); /* remove '/' */
-       bkupPath += "." + QString().setNum( QDateTime::currentDateTime().toTime_t() );
-       qdir.rename( newCachePath, bkupPath  );
+    newCachePath += Cache::boardDir( bdata->basePath() );
+    if ( qdir.exists ( newCachePath ) ) {
+        QString bkupPath = newCachePath;
+        bkupPath.truncate( bkupPath.length() - 1 ); /* remove '/' */
+        bkupPath += "." + QString().setNum( QDateTime::currentDateTime().toTime_t() );
+        qdir.rename( newCachePath, bkupPath );
     }
 
     /* move cache dir */
-    if( qdir.exists( oldCachePath ) ){
-       qdir.rename( oldCachePath, newCachePath );
-    }
-    else Kita::mkdir( newCachePath );
+    if ( qdir.exists( oldCachePath ) ) {
+        qdir.rename( oldCachePath, newCachePath );
+    } else Kita::mkdir( newCachePath );
 
     /* make old dir */
     if ( ! qdir.exists( oldCachePath ) ) {
@@ -958,21 +956,21 @@ bool BoardManager::moveBoard( const KURL& fromURL, const KURL& toURL )
 
     /*---------------------------*/
     /* update BBSHISTRY */
-    
+
     QFile file( Cache::getBBSHistoryPath( bdata->basePath() ) );
-    if ( file.open( IO_WriteOnly ) ){
+    if ( file.open( IO_WriteOnly ) ) {
+
+        QTextStream ts( &file );
 
-       QTextStream ts( &file );
-       
-       keyHosts.remove( newhost );
-       for ( QStringList::iterator it = keyHosts.begin() ; it != keyHosts.end(); ++it ) {
-           ts << (*it) << endl;
-       }
+        keyHosts.remove( newhost );
+        for ( QStringList::iterator it = keyHosts.begin() ; it != keyHosts.end(); ++it ) {
+            ts << ( *it ) << endl;
+        }
 
-       file.close();
+        file.close();
     }
 
-    
+
     /*---------------------------*/
     /* update other information */
     FavoriteThreads::replace( oldURL, newURL );
@@ -992,26 +990,26 @@ bool BoardManager::moveBoard( const KURL& fromURL, const KURL& toURL )
 bool BoardManager::loadBBSSetting( const KURL& url, bool reload )
 {
     /* Is board enrolled ? */
-    BoardData* bdata = getBoardData( url );
-    if( bdata == NULL ) return FALSE;
-    if( bdata->type() != Board_2ch ) return FALSE;
-    
+    BoardData * bdata = getBoardData( url );
+    if ( bdata == NULL ) return FALSE;
+    if ( bdata->type() != Board_2ch ) return FALSE;
+
     KURL settingURL = bdata->settingURL();
     QString path = Cache::getSettingPath( url );
-    
+
     /* now loading */
-    if( DownloadManager::isLoadingNow( settingURL ) ) return FALSE;
+    if ( DownloadManager::isLoadingNow( settingURL ) ) return FALSE;
 
     /* already loaded */
-    if( bdata->settingLoaded() && !reload ) return TRUE;
+    if ( bdata->settingLoaded() && !reload ) return TRUE;
 
     /* reset names, linenum, etc. */
     bdata->setSettingLoaded( FALSE );
-    
+
     /* download SETTING.TXT.*/
     DownloadManager::download( settingURL, path );
     bdata->setSettingLoaded( TRUE );
-    
+
     return TRUE;
 }
 
@@ -1019,10 +1017,10 @@ bool BoardManager::loadBBSSetting( const KURL& url, bool reload )
 /* public */ /* static */
 QString BoardManager::getBBSDefaultName( const KURL& url )
 {
-    BoardData* bdata = openSettingTxt( url );
-    if( bdata == NULL ) bdata = getBoardData( url );
-    if( bdata == NULL ) return "(default name)";
-    if( bdata->defaultName() == QString::null ) return "(default name)";
+    BoardData * bdata = openSettingTxt( url );
+    if ( bdata == NULL ) bdata = getBoardData( url );
+    if ( bdata == NULL ) return "(default name)";
+    if ( bdata->defaultName() == QString::null ) return "(default name)";
     return bdata->defaultName();
 }
 
@@ -1030,18 +1028,18 @@ QString BoardManager::getBBSDefaultName( const KURL& url )
 /* public */ /* static */
 int BoardManager::getBBSMaxLine( const KURL& url )
 {
-    BoardData* bdata = openSettingTxt( url );
-    if( bdata == NULL ) bdata = getBoardData( url );
-    if( bdata == NULL ) return 0;
+    BoardData * bdata = openSettingTxt( url );
+    if ( bdata == NULL ) bdata = getBoardData( url );
+    if ( bdata == NULL ) return 0;
     return bdata->lineNum();
 }
 
 /* public */ /* static */
 int BoardManager::getBBSMsgCount( const KURL& url )
 {
-    BoardData* bdata = openSettingTxt( url );
-    if( bdata == NULL ) bdata = getBoardData( url );
-    if( bdata == NULL ) return 0;
+    BoardData * bdata = openSettingTxt( url );
+    if ( bdata == NULL ) bdata = getBoardData( url );
+    if ( bdata == NULL ) return 0;
     return bdata->msgCount();
 }
 
@@ -1049,62 +1047,62 @@ int BoardManager::getBBSMsgCount( const KURL& url )
 /* public */ /* static */
 const KURL BoardManager::titleImgURL( const KURL& url )
 {
-    BoardData* bdata = openSettingTxt( url );
-    if( bdata == NULL ) bdata = getBoardData( url );
-    if( bdata == NULL ) return QString::null;
+    BoardData * bdata = openSettingTxt( url );
+    if ( bdata == NULL ) bdata = getBoardData( url );
+    if ( bdata == NULL ) return QString::null;
     return bdata->titleImgURL();
 }
 
 /* open local SETTING.TXT, then get names, linenum, etc. */ /* private */ /* static */
 BoardData* BoardManager::openSettingTxt( const KURL& url )
 {
-    BoardData* bdata = getBoardData( url );
-    if( bdata == NULL ) return NULL;
-    if( !bdata->settingLoaded() ) return NULL;
-    if( DownloadManager::isLoadingNow( bdata->settingURL() ) ) return NULL;
-    if( bdata->defaultName() != QString::null ) return bdata;
-    
+    BoardData * bdata = getBoardData( url );
+    if ( bdata == NULL ) return NULL;
+    if ( !bdata->settingLoaded() ) return NULL;
+    if ( DownloadManager::isLoadingNow( bdata->settingURL() ) ) return NULL;
+    if ( bdata->defaultName() != QString::null ) return bdata;
+
     QFile file( Cache::getSettingPath( url ) );
-    if ( file.open( IO_ReadOnly ) ){
-
-       QTextStream ts( &file );
-       if( m_cp932Codec == NULL) m_cp932Codec = new QCp932Codec();
-       ts.setCodec( m_cp932Codec );
-
-       QString line;
-       while( !ts.eof() ){
-
-           line = ts.readLine();
-
-           /* default name */
-           QString key = "BBS_NONAME_NAME=";
-           if( line.find( key ) != -1 ) bdata->setDefaultName( line.remove( key ) );
-
-           /* 0ch type */
-           key = "NANASI_NAME=";
-           if( line.find( key ) != -1 ) bdata->setDefaultName( line.remove( key ) );
-
-           /* line number */
-           key = "BBS_LINE_NUMBER=";
-           if( line.find( key ) != -1 ) bdata->setLineNum( line.remove( key ).toInt() * 2 );
-
-           /* msg count */
-           key = "BBS_MESSAGE_COUNT=";
-           if( line.find( key ) != -1 ) bdata->setMsgCount( line.remove( key ).toInt() );
-           
-           /* title image */
-           key = "BBS_TITLE_PICTURE=";
-           if( line.find( key ) != -1 ){
-               QString path = line.remove( key );
-               KURL titleImgURL = KURL( bdata->basePath(), path );
-               bdata->setTitleImgURL( titleImgURL );
-           }
-       }
-           
-       file.close();
+    if ( file.open( IO_ReadOnly ) ) {
+
+        QTextStream ts( &file );
+        if ( m_cp932Codec == NULL ) m_cp932Codec = new QCp932Codec();
+        ts.setCodec( m_cp932Codec );
+
+        QString line;
+        while ( !ts.eof() ) {
+
+            line = ts.readLine();
+
+            /* default name */
+            QString key = "BBS_NONAME_NAME=";
+            if ( line.find( key ) != -1 ) bdata->setDefaultName( line.remove( key ) );
+
+            /* 0ch type */
+            key = "NANASI_NAME=";
+            if ( line.find( key ) != -1 ) bdata->setDefaultName( line.remove( key ) );
+
+            /* line number */
+            key = "BBS_LINE_NUMBER=";
+            if ( line.find( key ) != -1 ) bdata->setLineNum( line.remove( key ).toInt() * 2 );
+
+            /* msg count */
+            key = "BBS_MESSAGE_COUNT=";
+            if ( line.find( key ) != -1 ) bdata->setMsgCount( line.remove( key ).toInt() );
+
+            /* title image */
+            key = "BBS_TITLE_PICTURE=";
+            if ( line.find( key ) != -1 ) {
+                QString path = line.remove( key );
+                KURL titleImgURL = KURL( bdata->basePath(), path );
+                bdata->setTitleImgURL( titleImgURL );
+            }
+        }
+
+        file.close();
     }
 
-    if( bdata->defaultName() == QString::null ) bdata->setDefaultName( "(default name)" );
-    
+    if ( bdata->defaultName() == QString::null ) bdata->setDefaultName( "(default name)" );
+
     return bdata;
 }
index fb4f172..5b64147 100644 (file)
@@ -20,23 +20,23 @@ class QEucJpCodec;
 namespace Kita
 {
     class Thread;
-    
+
     /* type of board */
     enum {
         Board_MachiBBS,
         Board_JBBS,
         Board_2ch,
         Board_FlashCGI,
-       Board_Unknown
+        Board_Unknown
     };
 
 
     /* return value of BoardManager::enrollBoard */
     enum {
-      Board_enrollNew,
-      Board_enrollEnrolled,
-      Board_enrollMoved,
-      Board_enrollFailed
+        Board_enrollNew,
+        Board_enrollEnrolled,
+        Board_enrollMoved,
+        Board_enrollFailed
     };
 
     /*---------------------------------*/
@@ -44,140 +44,140 @@ namespace Kita
     /* Data Base of board */
     class BoardData
     {
-       QString m_boardName;
-       bool m_readIdx; /* If TRUE, idx file has been read. */
-
-       QString m_hostname;    /* latest host name */
-       QString m_rootPath;
-       QString m_delimiter;   /* "/test/read.cgi", "/bbs/read.pl", etc. */
-       QString m_bbsPath;
-       QString m_ext;         /* ".dat", ".cgi", etc.  */
-       int m_type;
-
-       QString m_basePath;  /* = (hostname)/(rootPath)/(bbsPath)/ */
-       QString m_cgiBasePath;  /* = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ */
-       
-       /* SETTING.TXT */
-       bool m_settingLoaded;
-       QString m_defaultName;
-       int m_linenum;
-       int m_msgCount;
-       KURL m_titleImgURL;
-       
-       /* keys */
-       QStringList m_keyHostList; /* list of host names. They are keys of DB. */               
-       QStringList m_keyBasePathList; 
-       QStringList m_keyCgiBasePathList;
-       
+        QString m_boardName;
+        bool m_readIdx; /* If TRUE, idx file has been read. */
+
+        QString m_hostname;    /* latest host name */
+        QString m_rootPath;
+        QString m_delimiter;   /* "/test/read.cgi", "/bbs/read.pl", etc. */
+        QString m_bbsPath;
+        QString m_ext;         /* ".dat", ".cgi", etc.  */
+        int m_type;
+
+        QString m_basePath;  /* = (hostname)/(rootPath)/(bbsPath)/ */
+        QString m_cgiBasePath;  /* = (hostname)/(rootPath)/(delimiter)/(bbsPath)/ */
+
+        /* SETTING.TXT */
+        bool m_settingLoaded;
+        QString m_defaultName;
+        int m_linenum;
+        int m_msgCount;
+        KURL m_titleImgURL;
+
+        /* keys */
+        QStringList m_keyHostList; /* list of host names. They are keys of DB. */
+        QStringList m_keyBasePathList;
+        QStringList m_keyCgiBasePathList;
+
     public:
-       BoardData( const QString& boardName, const QString& hostname,
-                  const QString& rootPath, const QString& delimiter,
-                  const QString& bbsPath, const QString& ext, int boardtype );
-       ~BoardData();
-
-       void setHostName( const QString& hostname );
-       
-       /* information */
-       const bool readIdx() const;
-       void setReadIdx( bool idx );    
-       const QString& boardName() const;
-       const QString& hostName() const;                
-       const QString& rootPath() const;
-       const QString& delimiter() const;
-       const QString& bbsPath() const;
-       const QString& ext() const;     
-       const int type() const;
-
-       const QString& basePath() const;
-       const QString& cgiBasePath() const;
-
-       /* SETTING.TXT */
-       const QString settingURL() const;
-       const bool settingLoaded() const;
-       const QString& defaultName() const;
-       const int lineNum() const;
-       const int msgCount() const;
-       const KURL& titleImgURL() const;
-       void setSettingLoaded( bool set );
-       void setDefaultName( const QString& newName );
-       void setLineNum( int newLine );
-       void setMsgCount( int msgCount );
-       void setTitleImgURL( const KURL& url );
-
-       /* keys */
-       void createKeys( const QStringList& keyHostList );
-       const QStringList& keyHostList() const; 
-       const QStringList& keyBasePathList() const;
-       const QStringList& keyCgiBasePathList() const;
+        BoardData( const QString& boardName, const QString& hostname,
+                   const QString& rootPath, const QString& delimiter,
+                   const QString& bbsPath, const QString& ext, int boardtype );
+        ~BoardData();
+
+        void setHostName( const QString& hostname );
+
+        /* information */
+        const bool readIdx() const;
+        void setReadIdx( bool idx );
+        const QString& boardName() const;
+        const QString& hostName() const;
+        const QString& rootPath() const;
+        const QString& delimiter() const;
+        const QString& bbsPath() const;
+        const QString& ext() const;
+        const int type() const;
+
+        const QString& basePath() const;
+        const QString& cgiBasePath() const;
+
+        /* SETTING.TXT */
+        const QString settingURL() const;
+        const bool settingLoaded() const;
+        const QString& defaultName() const;
+        const int lineNum() const;
+        const int msgCount() const;
+        const KURL& titleImgURL() const;
+        void setSettingLoaded( bool set );
+        void setDefaultName( const QString& newName );
+        void setLineNum( int newLine );
+        void setMsgCount( int msgCount );
+        void setTitleImgURL( const KURL& url );
+
+        /* keys */
+        void createKeys( const QStringList& keyHostList );
+        const QStringList& keyHostList() const;
+        const QStringList& keyBasePathList() const;
+        const QStringList& keyCgiBasePathList() const;
     };
 
 
     /*--------------------------------------*/
-    
+
     typedef QValueList< BoardData* > BoardDataList;
-    
+
     /**
     @author Hideki Ikemoto
     */
     class BoardManager
     {
-      static BoardDataList m_boardDataList;
-      static BoardData* m_previousBoardData; /* used in getBoardData() */
-      static QString m_previousBoardURL; /* used in getBoardData() */      
-      static QCp932Codec* m_cp932Codec;
-      static QEucJpCodec* m_eucJpCodec;
-       
+        static BoardDataList m_boardDataList;
+        static BoardData* m_previousBoardData; /* used in getBoardData() */
+        static QString m_previousBoardURL; /* used in getBoardData() */
+        static QCp932Codec* m_cp932Codec;
+        static QEucJpCodec* m_eucJpCodec;
+
     public:
         BoardManager();
         ~BoardManager();
 
-      static const QString boardURL( const KURL& url );
-      static const QStringList allBoardURLList();
-      static const QString boardRoot( const KURL& url );      
-      static const QString boardPath( const KURL& url );
-      static const QString ext( const KURL& url );      
-      static const QString boardID( const KURL& url );      
-      static const QString subjectURL( const KURL& url );      
-      static const QString boardName( const KURL& url );
-      static const int type( const KURL& url );
-
-      /* ThreadList */
-      static void getThreadList( const KURL& url, bool oldLogs, bool online,
-                                QPtrList< Thread >& threadList, QPtrList< Thread >& oldLogList );
-      
-      /* BoardData */
-      static void clearBoardData();
-      static int enrollBoard( const KURL& url, const QString& boardName, QString& oldURL,
-                             int type = Board_Unknown, bool test = FALSE );
-      static bool isEnrolled( const KURL& url );
-      static BoardData* getBoardData( const KURL& url );
-      
-      /* BBSHISTORY */
-      static bool loadBBSHistory( const KURL& url );
-      static bool moveBoard( const KURL& fromURL, const KURL& toURL );
-
-      /* SETTING.TXT */
-      static bool loadBBSSetting( const KURL& url, bool reload = FALSE );
-      static QString getBBSDefaultName( const KURL& url );
-      static int getBBSMaxLine( const KURL& url );
-      static int getBBSMsgCount( const KURL& url );
-      static const KURL titleImgURL( const KURL& url );            
-
-      private:
-
-      /* BoardData */
-      static int parseBoardURL( const KURL& url,  int type, QString& hostname,
-                        QString& rootPath, QString& delimiter,
-                        QString& bbsPath,  QString& ext);
-
-
-      /* ThreadList */
-      static void getCachedThreadList( const KURL& url, QPtrList< Thread >& threadList );
-      static bool readSubjectTxt( BoardData* bdata, const KURL& url, QPtrList< Thread >& threadList );
-      
-      
-      /* SETTING.TXT */
-      static BoardData* openSettingTxt( const KURL& url );
+        static const QString boardURL( const KURL& url );
+        static const QStringList allBoardURLList();
+        static const QString boardRoot( const KURL& url );
+        static const QString boardPath( const KURL& url );
+        static const QString ext( const KURL& url );
+        static const QString boardID( const KURL& url );
+        static const QString subjectURL( const KURL& url );
+        static const QString boardName( const KURL& url );
+        static const int type( const KURL& url );
+
+        /* ThreadList */
+        static void getThreadList( const KURL& url, bool oldLogs, bool online,
+                                   QPtrList< Thread >& threadList, QPtrList< Thread >& oldLogList );
+
+        /* BoardData */
+        static void clearBoardData();
+        static int enrollBoard( const KURL& url, const QString& boardName, QString& oldURL,
+                                int type = Board_Unknown, bool test = FALSE );
+        static bool isEnrolled( const KURL& url );
+        static BoardData* getBoardData( const KURL& url );
+
+        /* BBSHISTORY */
+        static bool loadBBSHistory( const KURL& url );
+        static bool moveBoard( const KURL& fromURL, const KURL& toURL );
+
+        /* SETTING.TXT */
+        static bool loadBBSSetting( const KURL& url, bool reload = FALSE );
+        static QString getBBSDefaultName( const KURL& url );
+        static int getBBSMaxLine( const KURL& url );
+        static int getBBSMsgCount( const KURL& url );
+        static const KURL titleImgURL( const KURL& url );
+
+    private:
+
+        /* BoardData */
+        static int parseBoardURL( const KURL& url, int type, QString& hostname,
+                                  QString& rootPath, QString& delimiter,
+                                  QString& bbsPath, QString& ext );
+
+
+        /* ThreadList */
+        static void getCachedThreadList( const KURL& url, QPtrList< Thread >& threadList );
+        static bool readSubjectTxt( BoardData* bdata, const KURL& url, QPtrList< Thread >& threadList );
+
+
+        /* SETTING.TXT */
+        static BoardData* openSettingTxt( const KURL& url );
     };
 }
 
index ec1305b..7f6748f 100644 (file)
@@ -30,11 +30,11 @@ QString Cache::baseDir()
 QString Cache::serverDir( const KURL& url )
 {
     /* Is board enrolled ? */
-    BoardData* bdata = BoardManager::getBoardData( url );
-    if( bdata == NULL ) return QString::null;
-    
+    BoardData * bdata = BoardManager::getBoardData( url );
+    if ( bdata == NULL ) return QString::null;
+
     QString root = bdata->hostName() + bdata->rootPath();
-    
+
     return root.remove( "http://" ).replace( "/", "_" ) + "/";
 }
 
@@ -42,11 +42,11 @@ QString Cache::serverDir( const KURL& url )
 QString Cache::boardDir( const KURL& url )
 {
     /* Is board enrolled ? */
-    BoardData* bdata = BoardManager::getBoardData( url );
-    if( bdata == NULL ) return QString::null;
-    
+    BoardData * bdata = BoardManager::getBoardData( url );
+    if ( bdata == NULL ) return QString::null;
+
     QString bbs = bdata->bbsPath();
-    
+
     return bbs.mid( 1 ).replace( "/", "_" ) + "/";
 }
 
@@ -56,8 +56,8 @@ QString Cache::getPath( const KURL& url )
     QString path = baseDir() + serverDir( url ) + boardDir( url );
     if ( path == QString::null ) return QString::null;
 
-//    qDebug( "%s -> %s",url.prettyURL().ascii(),path.ascii());
-    
+    //    qDebug( "%s -> %s",url.prettyURL().ascii(),path.ascii());
+
     return path + url.fileName();
 }
 
@@ -81,7 +81,7 @@ QString Cache::getSettingPath( const KURL& url )
 {
     QString path = baseDir() + serverDir( url ) + boardDir( url );
     if ( path == QString::null ) return QString::null;
-    
+
     return path + "SETTING.TXT";
 }
 
@@ -90,7 +90,7 @@ QString Cache::getBBSHistoryPath( const KURL& url )
 {
     QString path = baseDir() + serverDir( url ) + boardDir( url );
     if ( path == QString::null ) return QString::null;
-    
+
     return path + "BBSHISTORY";
 }
 
@@ -99,7 +99,7 @@ QString Cache::getSubjectPath( const KURL& url )
 {
     QString path = baseDir() + serverDir( url ) + boardDir( url );
     if ( path == QString::null ) return QString::null;
-    
+
     return path + "subject.txt";
 }
 
index 142a0e6..2341894 100644 (file)
@@ -31,12 +31,12 @@ namespace Kita
         static QString baseDir();
         static QString serverDir( const KURL& url );
         static QString boardDir( const KURL& url );
-       
+
         static QString getPath( const KURL& url );
         static QString getIndexPath( const KURL& url );
         static QString getSettingPath( const KURL& url );
         static QString getBBSHistoryPath( const KURL& url );
-        static QString getSubjectPath( const KURL& url );              
+        static QString getSubjectPath( const KURL& url );
         static QString getImgPath( const KURL& url );
         static QString getImgIdxPath( const KURL& url );
     };
index 4a4b8bd..7e7a574 100644 (file)
@@ -41,18 +41,18 @@ DatInfo::DatInfo( const KURL& url ) : m_access ( 0 ), m_access2( 0 )
 
     /* get the pointer of Thread class */
     m_thread = Kita::Thread::getByURLNew( m_datURL );
-    if( m_thread == NULL ){
-
-       /* create Thread */
-       m_thread = Kita::Thread::getByURL( m_datURL );
-       if( m_thread == NULL ) return;
-       
-       /* read idx file */
-       ThreadIndex::loadIndex( m_thread, m_datURL );
+    if ( m_thread == NULL ) {
+
+        /* create Thread */
+        m_thread = Kita::Thread::getByURL( m_datURL );
+        if ( m_thread == NULL ) return ;
+
+        /* read idx file */
+        ThreadIndex::loadIndex( m_thread, m_datURL );
     }
 
     m_thread = Thread::getByURL( m_datURL );
-    
+
     /* japanese strings */
 #if KDE_IS_VERSION( 3, 3, 0 )
     m_spacestr = Kita::utf8ToUnicode( KITAUTF8_ZENSPACE );
@@ -65,11 +65,11 @@ DatInfo::DatInfo( const KURL& url ) : m_access ( 0 ), m_access2( 0 )
 
     /* make directory */
     QString cacheDir = Cache::baseDir() + Cache::serverDir( m_datURL ) + Cache::boardDir( m_datURL );
-    if( !Kita::mkdir( cacheDir ) ) return;
-    
+    if ( !Kita::mkdir( cacheDir ) ) return ;
+
     initPrivate(
-       TRUE /* load cache */
-       );
+        TRUE /* load cache */
+    );
 }
 
 DatInfo::~DatInfo()
@@ -118,13 +118,13 @@ void DatInfo::initPrivate( bool loadCache )
     connect( m_access, SIGNAL( receiveData( const QStringList& ) ),
              SLOT( slotReceiveData( const QStringList& ) ) );
     connect( m_access, SIGNAL( finishLoad() ), SLOT( slotFinishLoad() ) );
-    
-    if( !loadCache ) return;
+
+    if ( !loadCache ) return ;
 
     /* reset ReadNum before loading cache. */
     /* ReadNum & subject are updated by Access::getcache() */
-    m_thread->setReadNum( 0 ); 
-   
+    m_thread->setReadNum( 0 );
+
     /* get dat from cahce  */
     /* slotReceiveData() is called from Access::getcache() */
     m_access->getcache();
@@ -207,7 +207,7 @@ bool DatInfo::updateCache( const QObject* parent )
 
     connect( this, SIGNAL( finishLoad() ),
              parent, SLOT( slotFinishLoad() ) );
-    
+
     m_access->getupdate( m_thread->readNum() );
 
     return TRUE;
@@ -238,13 +238,13 @@ void DatInfo::slotReceiveData( const QStringList& lineList )
 bool DatInfo::copyOneLineToResDat( const QString& line )
 {
     if ( line == QString::null ) return FALSE;
-    
+
     /* update ReadNum */
-    const int num = m_thread->readNum() +1;
+    const int num = m_thread->readNum() + 1;
     m_thread->setReadNum( num );
-    
+
     /* If resdat vector is short, then resize the vector. */
-    while( ( int ) m_resDatVec.size() <= num ) increaseResDatVec( RESDAT_DELTA );
+    while ( ( int ) m_resDatVec.size() <= num ) increaseResDatVec( RESDAT_DELTA );
 
     /* reset ResDat */
     RESDAT& resdat = m_resDatVec[ num ];
@@ -254,13 +254,13 @@ bool DatInfo::copyOneLineToResDat( const QString& line )
     resdat.linestr = line;
 
     /* get subject */
-    if( num == 1 ) parseDat( num );
+    if ( num == 1 ) parseDat( num );
 
     /* search all responses which are responsed by this line. */
-    if( KitaConfig::checkResponsed() ){
+    if ( KitaConfig::checkResponsed() ) {
+
+        if ( parseDat( num ) && !checkAbonePrivate( num ) ) { /* parse line here to get AncList */
 
-        if ( parseDat( num ) && !checkAbonePrivate( num ) ){ /* parse line here to get AncList */
-            
             const int maxRange = 10;
 
             AncList& anclist = m_resDatVec[ num ].anclist;
@@ -268,16 +268,16 @@ bool DatInfo::copyOneLineToResDat( const QString& line )
 
                 int fromNum = ( *it ).from;
                 int toNum = QMIN( num - 1, ( *it ).to );
-                if( toNum - fromNum +1 > maxRange ) continue;
+                if ( toNum - fromNum + 1 > maxRange ) continue;
 
-                for( int i = fromNum; i <= toNum; ++i ){
-            
-                    if( !checkAbonePrivate( i ) )  m_resDatVec[ i ].isResponsed = TRUE;
+                for ( int i = fromNum; i <= toNum; ++i ) {
+
+                    if ( !checkAbonePrivate( i ) ) m_resDatVec[ i ].isResponsed = TRUE;
                 }
             }
         }
     }
-    
+
     return TRUE;
 }
 
@@ -295,10 +295,10 @@ void DatInfo::slotFinishLoad()
             initPrivate( TRUE );
             m_access2 = new OfflawAccess( m_datURL );
             connect( m_access2, SIGNAL( receiveData( const QStringList& ) ),
-                      SLOT( slotReceiveData( const QStringList& ) ) );
+                     SLOT( slotReceiveData( const QStringList& ) ) );
             connect( m_access2, SIGNAL( finishLoad() ), SLOT( slotFinishLoad() ) );
             m_access2->get();
-            return;
+            return ;
         }
     }
     /* finish loading session & emit signal to the parent object */
@@ -429,7 +429,7 @@ QString DatInfo::getPlainName( int num )
 {
     QMutexLocker locker( &m_mutex );
     if ( !parseDat( num ) ) return QString::null;
-    
+
     return m_resDatVec[ num ].name;
 }
 
@@ -445,7 +445,7 @@ QString DatInfo::getPlainTitle( int num )
 
     QString retStr;
     Kita::DatToText( titleHTML, retStr );
-    
+
     return retStr;
 }
 
@@ -458,7 +458,7 @@ QString DatInfo::getPlainBody( int num )
 
     QString retStr;
     Kita::DatToText( m_resDatVec[ num ].bodyHTML, retStr );
-    
+
     return retStr;
 }
 
@@ -468,7 +468,7 @@ QString DatInfo::getPlainBody( int num )
 
 
 /* get HTML strings of title & body.
-
    return values are defined in datinfo.h.  */ /* public */
 
 int DatInfo::getHTML( int num, bool checkAbone, QString& titleHTML, QString& bodyHTML )
@@ -485,29 +485,28 @@ int DatInfo::getHTMLPrivate( int num, bool checkAbone, QString& titleHTML, QStri
     bool abone = checkAbone & checkAbonePrivate( num );
     RESDAT& resdat = m_resDatVec[ num ];
 
-    if ( !resdat.broken && !abone ){
-       
-       createTitleHTML( resdat, titleHTML );
-       bodyHTML = resdat.bodyHTML;
-    }
-    else {
-       
-       /* "abone" */
-        if ( abone ){
-           titleHTML = QString().setNum( num ) + " " + i18n( "Abone" );
-           bodyHTML = "<a href=\"#abone" + QString().setNum( num ) + "\">";
-           bodyHTML += i18n( "Abone" ) + "</a>";
-
-           return KITA_HTML_ABONE;
-       }
-
-       /* "broken" */
+    if ( !resdat.broken && !abone ) {
+
+        createTitleHTML( resdat, titleHTML );
+        bodyHTML = resdat.bodyHTML;
+    } else {
+
+        /* "abone" */
+        if ( abone ) {
+            titleHTML = QString().setNum( num ) + " " + i18n( "Abone" );
+            bodyHTML = "<a href=\"#abone" + QString().setNum( num ) + "\">";
+            bodyHTML += i18n( "Abone" ) + "</a>";
+
+            return KITA_HTML_ABONE;
+        }
+
+        /* "broken" */
         else {
-           titleHTML = QString().setNum( num ) + " " + i18n( "Broken" );
-           bodyHTML = i18n( "Broken" );
+            titleHTML = QString().setNum( num ) + " " + i18n( "Broken" );
+            bodyHTML = i18n( "Broken" );
 
-           return KITA_HTML_BROKEN;
-       }
+            return KITA_HTML_BROKEN;
+        }
     }
 
     return KITA_HTML_NORMAL;
@@ -515,7 +514,7 @@ int DatInfo::getHTMLPrivate( int num, bool checkAbone, QString& titleHTML, QStri
 
 
 /* get HTML strings from startnum to endnum.
-
    return value is HTML strings               */  /* public */
 QString DatInfo::getHTMLString( int startnum, int endnum, bool checkAbone )
 {
@@ -525,9 +524,9 @@ QString DatInfo::getHTMLString( int startnum, int endnum, bool checkAbone )
 
     for ( int num = startnum; num <= endnum; num++ ) {
 
-       QString html;
-       getHTMLofOneRes( num, checkAbone, html );
-       retHTML += html;
+        QString html;
+        getHTMLofOneRes( num, checkAbone, html );
+        retHTML += html;
     }
 
     return retHTML;
@@ -549,9 +548,9 @@ QString DatInfo::getHtmlByID( const QString& strid, int &count )
         if ( m_resDatVec[ i ].id == strid ) {
             count ++;
 
-           QString html;
-           getHTMLofOneRes( i, TRUE, html );
-           retHTML += html;
+            QString html;
+            getHTMLofOneRes( i, TRUE, html );
+            retHTML += html;
         }
     }
 
@@ -564,9 +563,9 @@ void DatInfo::getHTMLofOneRes( int num, bool checkAbone, QString& html )
 {
     html = QString::null;
     QString titleHTML, bodyHTML;
-    if( getHTMLPrivate( num, checkAbone, titleHTML, bodyHTML ) == KITA_HTML_NOTPARSED ) return;
-    
-    if( m_resDatVec[ num ].isResponsed ) titleHTML.replace( "<a href=\"#write", "<a class=\"coloredLink\" href=\"#write" ); 
+    if ( getHTMLPrivate( num, checkAbone, titleHTML, bodyHTML ) == KITA_HTML_NOTPARSED ) return ;
+
+    if ( m_resDatVec[ num ].isResponsed ) titleHTML.replace( "<a href=\"#write", "<a class=\"coloredLink\" href=\"#write" );
     html += "<div class=\"pop_res_title\">" + titleHTML + "</div>";
     html += "<div class=\"pop_res_body\">" + bodyHTML + "</div>";
 }
@@ -611,7 +610,7 @@ QString DatInfo::getTreeByResReverse( const int rootnum, int& count )
 /* private */
 QString DatInfo::getTreeByResPrivate(
     const int rootnum,
-    bool reverse,   /* reverse search */
+    bool reverse,    /* reverse search */
     int& count )
 {
 
@@ -626,7 +625,7 @@ QString DatInfo::getTreeByResPrivate(
 /* private */
 QString DatInfo::getTreeByResCore(
     const int rootnum,
-    bool reverse,   /* reverse search */
+    bool reverse,    /* reverse search */
     int& count, QString prestr )
 {
     if ( !parseDat( rootnum ) ) return QString::null;
@@ -697,7 +696,7 @@ bool DatInfo::checkRes( const int num, const int target )
     AncList& anclist = m_resDatVec[ num ].anclist;
 
     for ( AncList::iterator it = anclist.begin(); it != anclist.end(); ++it ) {
-        if( ( *it ).to - ( *it ).from > range ) continue;
+        if ( ( *it ).to - ( *it ).from > range ) continue;
         if ( target >= ( *it ).from && target <= ( *it ).to ) return TRUE;
     }
 
@@ -813,7 +812,7 @@ bool DatInfo::checkID( const QString& strid, int num )
 
 
 /* Are keywords included ? */ /* public */
-bool DatInfo::checkWord( QStringList& stlist,  /* list of keywords */
+bool DatInfo::checkWord( QStringList& stlist,   /* list of keywords */
                          int num,
                          bool checkOR /* AND or OR search */
                        )
@@ -904,7 +903,7 @@ bool DatInfo::checkAbonePrivate( int num )
         checktmp = checkAboneCore( m_resDatVec[ num ].bodyHTML, KitaConfig::aboneWordList() );
 
     if ( !checktmp && m_aboneChain ) {
-        AncList& anclist = m_resDatVec[ num ].anclist;
+        AncList & anclist = m_resDatVec[ num ].anclist;
 
         for ( AncList::iterator it = anclist.begin();
                 it != anclist.end() && !checktmp ; ++it ) {
@@ -950,19 +949,19 @@ bool DatInfo::checkAboneCore( const QString& str, QStringList& strlist )
 
 
 
-/* parsing function for ResDat */ 
+/* parsing function for ResDat */
 /* This function parses the raw data by Kita::parseResDat() */ /* private */
 bool DatInfo::parseDat( int num )
 {
-   if( num <= 0 || m_thread->readNum() < num ) return FALSE;
-   if( m_resDatVec[ num ].parsed ) return TRUE;
+    if ( num <= 0 || m_thread->readNum() < num ) return FALSE;
+    if ( m_resDatVec[ num ].parsed ) return TRUE;
+
+    //   qDebug("parseDat %d",num);
 
-//   qDebug("parseDat %d",num);
-    
-   QString subject = QString::null;
-   Kita::parseResDat( m_resDatVec[ num ], subject );
-   if( num == 1 && subject != QString::null ) m_thread->setThreadName( subject );
-   if ( m_resDatVec[ num ].broken ) m_broken = TRUE;
+    QString subject = QString::null;
+    Kita::parseResDat( m_resDatVec[ num ], subject );
+    if ( num == 1 && subject != QString::null ) m_thread->setThreadName( subject );
+    if ( m_resDatVec[ num ].broken ) m_broken = TRUE;
 
-   return TRUE;
+    return TRUE;
 }
index 9584df9..800029c 100644 (file)
@@ -38,7 +38,7 @@ enum{
 
 
 /* Data Base of anchor
-
    For example, No.5 res has name = "foo", id "id1234", and anchors >>2-3 and >>4, then,
  
    m_resDatVec[5].name = "foo",
@@ -63,7 +63,7 @@ struct RESDAT
 {
     int num;         /* number */
     QString linestr; /* raw line data */
-    
+
     bool parsed;
     bool broken;
 
@@ -74,7 +74,7 @@ struct RESDAT
     QDateTime dateTime;
     QString id;
     QString host;
-    QString bodyHTML;    
+    QString bodyHTML;
 
     AncList anclist; /* anchor list. See above. */
 
@@ -102,8 +102,8 @@ namespace Kita
 
         QMutex m_mutex;
 
-       /* pointer of Thread class */
-       Thread* m_thread; 
+        /* pointer of Thread class */
+        Thread* m_thread;
 
         /* basic information */
         KURL m_datURL;
@@ -138,7 +138,7 @@ namespace Kita
         DatInfo( const KURL& url );
         ~DatInfo();
         void init();
-        void wait();   
+        void wait();
         const KURL& url();
 
         /* for caching */
@@ -157,7 +157,7 @@ namespace Kita
         /* string data */
         const QString& getDat( int num );
         const QString& getId( int num );
-        QString getPlainName( int num );       
+        QString getPlainName( int num );
         QString getPlainTitle( int num );
         QString getPlainBody( int num );
 
@@ -171,7 +171,7 @@ namespace Kita
         /* numerical data */
         int getResNum();
         int getReadNum();
-       int getViewPos();
+        int getViewPos();
         int getNumByID( const QString& strid );
         int getDatSize();
 
@@ -186,7 +186,7 @@ namespace Kita
         /* abone check */
         bool checkAbone( int num );
         void resetAbone();
-       
+
         /*-------------------------*/
 
     private:
@@ -198,10 +198,10 @@ namespace Kita
 
         /* copy data */
         bool copyOneLineToResDat( const QString& line );
-       
+
         /* HTML data */
         int getHTMLPrivate( int num, bool checkAbone, QString& titleHTML, QString& bodyHTML );
-       void getHTMLofOneRes( int num, bool checkAbone, QString& html );
+        void getHTMLofOneRes( int num, bool checkAbone, QString& html );
         QString getTreeByResPrivate( const int rootnum, bool reverse, int& count );
         QString getTreeByResCore( const int rootnum, bool reverse, int& count, QString prestr );
         bool checkRes( const int num, const int target );
index 836ee72..4101a35 100644 (file)
@@ -43,9 +43,9 @@ QMutex DatManager::m_mutex;
    if cache does not exist( i.e. ReadNum == 0 ). */ /* public */
 bool DatManager::createDatInfo( const KURL& url )
 {
-    if( getDatInfo( url,
-                   FALSE /* don't check the existence of cache */
-           ) == NULL ) return FALSE;
+    if ( getDatInfo( url,
+                     FALSE /* don't check the existence of cache */
+                   ) == NULL ) return FALSE;
     return TRUE;
 }
 
@@ -65,21 +65,21 @@ DatInfo * DatManager::getDatInfoPointer( const KURL& url )
 
 
 /* This function searches instance of DatInfo in m_datInfoList.
-
    If cache exists, create DatInfo and return its pointer.
-
    If checkCached == TRUE and cache does not exist, return NULL.
-
    If checkCached == FALSE and cache does not exist,
    create DatInfo and return its pointer anyway.
-
    see also DatManager::searchDatInfo() and DatManager::createDatInfo() */ /* private */
 
 DatInfo* DatManager::getDatInfo( const KURL& url, bool checkCached )
 {
     /* search */
-    DatInfo* datInfo = searchDatInfo( url );
-    if( datInfo != NULL ) return datInfo;
+    DatInfo * datInfo = searchDatInfo( url );
+    if ( datInfo != NULL ) return datInfo;
 
     /* create and enroll instance */
     return enrollDatInfo( url, checkCached );
@@ -91,7 +91,7 @@ DatInfo* DatManager::getDatInfo( const KURL& url, bool checkCached )
 DatInfo* DatManager::searchDatInfo( const KURL& url )
 {
     QMutexLocker locker( &m_mutex );
-    
+
     KURL datURL = Kita::getDatURL( url );
     if ( datURL.isEmpty() ) return NULL; /* This url is not enrolled in BoardManager. */
     if ( m_datInfoList.count() == 0 ) return NULL;
@@ -99,44 +99,44 @@ DatInfo* DatManager::searchDatInfo( const KURL& url )
     int i = 0;
     DatInfoList::Iterator it;
     DatInfo* datInfo;
-    
+
     for ( it = m_datInfoList.begin(); it != m_datInfoList.end(); ++it, i++ ) {
 
-       datInfo = ( *it );
+        datInfo = ( *it );
 
-       if ( datURL == datInfo->url() ) {
+        if ( datURL == datInfo->url() ) {
 
-           /* LRU */
-           if ( i ) {
-               m_datInfoList.remove( it );
-               m_datInfoList.prepend( datInfo );
-           }
+            /* LRU */
+            if ( i ) {
+                m_datInfoList.remove( it );
+                m_datInfoList.prepend( datInfo );
+            }
 
-           return datInfo;
-       }
+            return datInfo;
+        }
     }
 
     return NULL;
 }
 
 
-/* create and enroll the instance of DatInfo and delete old instances. 
+/* create and enroll the instance of DatInfo and delete old instances.
    Note that DatInfo::DatInfo() opens cached data and reads it. */  /* private */
 DatInfo* DatManager::enrollDatInfo( const KURL& url, bool checkCached )
 {
     QMutexLocker locker( &m_mutex );
-    
+
     KURL datURL = Kita::getDatURL( url );
-    if( datURL.isEmpty() ) return NULL; /* This url is not enrolled in BoardManager. */
+    if ( datURL.isEmpty() ) return NULL; /* This url is not enrolled in BoardManager. */
 
     /* create DatInfo & read cached data */
     DatInfo* datInfo = new DatInfo( datURL );
 
     /* Does cache exist ? */
     /* If cache does not exist, delete DatInfo here. */
-    if( checkCached && datInfo->getReadNum() == 0 ){
-       delete datInfo;
-       return NULL;
+    if ( checkCached && datInfo->getReadNum() == 0 ) {
+        delete datInfo;
+        return NULL;
     }
 
     m_datInfoList.prepend( datInfo );
@@ -144,19 +144,19 @@ DatInfo* DatManager::enrollDatInfo( const KURL& url, bool checkCached )
     /* delete the all old instances ( LRU algorithm )*/
     if ( m_datInfoList.count() > DMANAGER_MAXQUEUE ) {
 
-       DatInfoList::Iterator it;
-        for ( it = m_datInfoList.at( DMANAGER_MAXQUEUE ); it != m_datInfoList.end(); ++it ){
+        DatInfoList::Iterator it;
+        for ( it = m_datInfoList.at( DMANAGER_MAXQUEUE ); it != m_datInfoList.end(); ++it ) {
+
+            if ( ( *it ) == NULL ) continue;
+            DatInfo* deleteInfo = ( *it );
 
-           if( ( *it ) == NULL ) continue;
-           DatInfo* deleteInfo = ( *it );
-           
-            if ( ! deleteInfo->isLocked() ){
+            if ( ! deleteInfo->isLocked() ) {
                 m_datInfoList.remove( it );
                 --it;
                 deleteInfo->wait(); /* wait until DatInfo::m_mutex is released. */
                 delete deleteInfo;
-           }
-       }
+            }
+        }
     }
 
     return datInfo;
@@ -167,11 +167,11 @@ DatInfo* DatManager::enrollDatInfo( const KURL& url, bool checkCached )
 void DatManager::deleteAllDatInfo()
 {
     DatInfoList::Iterator it;
-    for ( it = m_datInfoList.begin(); it != m_datInfoList.end(); ++it ){
+    for ( it = m_datInfoList.begin(); it != m_datInfoList.end(); ++it ) {
 
-       if( ( *it ) == NULL ) continue;
-       ( *it )->wait();
-       delete ( *it );
+        if ( ( *it ) == NULL ) continue;
+        ( *it ) ->wait();
+        delete ( *it );
     }
 }
 
@@ -215,13 +215,13 @@ bool DatManager::deleteCache( const KURL& url )
 {
     KURL datURL = Kita::getDatURL( url );
     Kita::Thread* thread = Kita::Thread::getByURLNew( datURL );
-    if( thread == NULL ) return FALSE;
-    if( thread->readNum() == 0 ) return FALSE;
+    if ( thread == NULL ) return FALSE;
+    if ( thread->readNum() == 0 ) return FALSE;
 
     /* init DatInfo */
     DatInfo * datInfo = searchDatInfo( datURL );
-    if( datInfo ){
-       if( !datInfo->deleteCache() ) return FALSE;
+    if ( datInfo ) {
+        if ( !datInfo->deleteCache() ) return FALSE;
     }
 
     /* reset readNum & veiwPos */
@@ -265,10 +265,10 @@ void DatManager::stopLoading( const KURL& url )
 /* lock, unlock DatInfo */
 
 /* public */
-void DatManager::lock( const KURL& url )
+void DatManager::lock ( const KURL& url )
 {
     DatInfo * datInfo = getDatInfo( url );
-    if( datInfo == NULL ) return;
+    if ( datInfo == NULL ) return ;
 
     datInfo->lock ();
 }
@@ -343,7 +343,7 @@ const QString DatManager::threadName( const KURL& url )
 {
     KURL datURL = Kita::getDatURL( url );
     Kita::Thread* thread = Kita::Thread::getByURLNew( datURL );
-    if( thread != NULL ) return thread->threadName();
+    if ( thread != NULL ) return thread->threadName();
 
     return QString::null;
 }
@@ -384,7 +384,7 @@ QString DatManager::getHtml( const KURL& url, int startnum, int endnum, bool che
 /* public */
 QString DatManager::getHtmlByID( const KURL& url, const QString& strid, int &count )
 {
-    DatInfo* datInfo = getDatInfo( url );
+    DatInfo * datInfo = getDatInfo( url );
     if ( datInfo == NULL ) return QString::null;
 
     return datInfo->getHtmlByID( strid, count );
@@ -395,7 +395,7 @@ QString DatManager::getHtmlByID( const KURL& url, const QString& strid, int &cou
 /* Get HTML document of res tree.*/ /* public */
 QString DatManager::getTreeByRes( const KURL& url, const int rootnum, int &count )
 {
-    DatInfo* datInfo = getDatInfo( url );
+    DatInfo * datInfo = getDatInfo( url );
     if ( datInfo == NULL ) return QString::null;
 
     return datInfo->getTreeByRes( rootnum, count );
@@ -404,7 +404,7 @@ QString DatManager::getTreeByRes( const KURL& url, const int rootnum, int &count
 /* Get HTML document of reverse res tree.*/ /* public */
 QString DatManager::getTreeByResReverse( const KURL& url, const int rootnum, int &count )
 {
-    DatInfo* datInfo = getDatInfo( url );
+    DatInfo * datInfo = getDatInfo( url );
     if ( datInfo == NULL ) return QString::null;
 
     return datInfo->getTreeByResReverse( rootnum, count );
@@ -416,7 +416,7 @@ int DatManager::getResNum( const KURL& url )
 {
     KURL datURL = Kita::getDatURL( url );
     Kita::Thread* thread = Kita::Thread::getByURLNew( datURL );
-    if( thread != NULL ) return thread->resNum();
+    if ( thread != NULL ) return thread->resNum();
 
     return 0;
 }
@@ -427,7 +427,7 @@ int DatManager::getReadNum( const KURL& url )
 {
     KURL datURL = Kita::getDatURL( url );
     Kita::Thread* thread = Kita::Thread::getByURLNew( datURL );
-    if( thread != NULL ) return thread->readNum();
+    if ( thread != NULL ) return thread->readNum();
 
     return 0;
 }
@@ -438,7 +438,7 @@ int DatManager::getViewPos( const KURL& url )
 {
     KURL datURL = Kita::getDatURL( url );
     Kita::Thread* thread = Kita::Thread::getByURLNew( datURL );
-    if( thread != NULL ) return thread->viewPos();
+    if ( thread != NULL ) return thread->viewPos();
 
     return 0;
 }
@@ -449,7 +449,7 @@ void DatManager::setViewPos( const KURL& url , int num )
 {
     KURL datURL = Kita::getDatURL( url );
     Kita::Thread* thread = Kita::Thread::getByURLNew( datURL );
-    if( thread != NULL ) thread->setViewPos( num );
+    if ( thread != NULL ) thread->setViewPos( num );
 
     /* save idx */
     Kita::ThreadIndex::setViewPos( url, num );
@@ -481,7 +481,7 @@ int DatManager::getNumByID( const KURL& url, const QString& strid )
 /* public */
 bool DatManager::isThreadEnrolled( const KURL& url )
 {
-    if( Kita::getDatURL( url ).isEmpty() ) return FALSE;
+    if ( Kita::getDatURL( url ).isEmpty() ) return FALSE;
 
     return TRUE;
 }
@@ -490,15 +490,15 @@ bool DatManager::isThreadEnrolled( const KURL& url )
 /* public */
 bool DatManager::is2chThread( const KURL& url )
 {
-    if( BoardManager::type( url ) != Board_2ch ) return FALSE;
-    if( Kita::getDatURL( url ).isEmpty() ) return FALSE;
-    
+    if ( BoardManager::type( url ) != Board_2ch ) return FALSE;
+    if ( Kita::getDatURL( url ).isEmpty() ) return FALSE;
+
     QRegExp url_2ch( ".*\\.2ch\\.net" );
     QRegExp url_bbspink( ".*\\.bbspink\\.com" );
-    
+
     if ( url_2ch.search( url.host() ) != -1
-        || url_bbspink.search( url.host() ) != -1 ) return TRUE;
-    
+            || url_bbspink.search( url.host() ) != -1 ) return TRUE;
+
     return FALSE;
 }
 
@@ -536,7 +536,7 @@ bool DatManager::isResBroken( const KURL& url, int num )
 /* check if ID == strid  */ /* public */
 bool DatManager::checkID( const KURL& url, const QString& strid, int num )
 {
-    DatInfo* datInfo = getDatInfo( url );
+    DatInfo * datInfo = getDatInfo( url );
     if ( datInfo == NULL ) return FALSE;
 
     return datInfo->checkID( strid, num );
@@ -549,7 +549,7 @@ bool DatManager::checkWord( const KURL& url,
                             bool checkOR /* AND or OR search */
                           )
 {
-    DatInfo* datInfo = getDatInfo( url );
+    DatInfo * datInfo = getDatInfo( url );
     if ( datInfo == NULL ) return FALSE;
 
     return datInfo->checkWord( strlist, num, checkOR );
@@ -561,7 +561,7 @@ bool DatManager::isMarked( const KURL& url, int num )
 {
     KURL datURL = Kita::getDatURL( url );
     Kita::Thread* thread = Kita::Thread::getByURLNew( datURL );
-    if( thread == NULL ) return FALSE;
+    if ( thread == NULL ) return FALSE;
 
     return thread->isMarked( num );
 }
@@ -572,16 +572,16 @@ void DatManager::setMark( const KURL& url, int num, bool mark )
 {
     KURL datURL = Kita::getDatURL( url );
     Kita::Thread* thread = Kita::Thread::getByURLNew( datURL );
-    if( thread == NULL ) return;
+    if ( thread == NULL ) return ;
 
-    if( thread->setMark( num, mark ) ) Kita::ThreadIndex::setMarkList( url, thread->markList() );
+    if ( thread->setMark( num, mark ) ) Kita::ThreadIndex::setMarkList( url, thread->markList() );
 }
 
 
 /* public */
 bool DatManager::checkAbone( const KURL& url, int num )
 {
-    DatInfo* datInfo = getDatInfo( url );
+    DatInfo * datInfo = getDatInfo( url );
     if ( datInfo == NULL ) return FALSE;
 
     return datInfo->checkAbone( num );
@@ -591,7 +591,7 @@ bool DatManager::checkAbone( const KURL& url, int num )
 /* public */
 void DatManager::resetAbone( const KURL& url )
 {
-    DatInfo* datInfo = getDatInfo( url );
+    DatInfo * datInfo = getDatInfo( url );
     if ( datInfo == NULL ) return ;
 
     datInfo->resetAbone();
@@ -603,7 +603,7 @@ bool DatManager::isMainThreadOpened( const KURL& url )
 {
     KURL datURL = Kita::getDatURL( url ).prettyURL();
     Kita::Thread* thread = Kita::Thread::getByURLNew( datURL );
-    if( thread == NULL ) return FALSE;
+    if ( thread == NULL ) return FALSE;
 
     return thread->isOpened();
 }
@@ -612,7 +612,7 @@ void DatManager::setMainThreadOpened( const KURL& url, bool isOpened )
 {
     KURL datURL = Kita::getDatURL( url ).prettyURL();
     Kita::Thread* thread = Kita::Thread::getByURLNew( datURL );
-    if( thread != NULL ) thread->setIsOpened( isOpened );
+    if ( thread != NULL ) thread->setIsOpened( isOpened );
 }
 
 
index 69555aa..747af10 100644 (file)
@@ -74,8 +74,8 @@ namespace Kita
         static void setViewPos( const KURL& url, int num );
         static int getDatSize( const KURL& url );
         static int getNumByID( const KURL& url, const QString& strid );
-       
-       
+
+
         /* another information */
         static bool isThreadEnrolled( const KURL& url );
         static bool is2chThread( const KURL& url );
@@ -97,9 +97,9 @@ namespace Kita
         static void setMainThreadOpened( const KURL& url, bool isOpened );
 
         /* obsolete. Don't use them. */
-       
+
         static const QString threadURL( const KURL& url );
-       
+
     private:
 
         static DatInfo* getDatInfo( const KURL& url, bool checkCached = TRUE );
index b5c5a40..6a00d9e 100644 (file)
@@ -27,39 +27,39 @@ QMutex DownloadManager::m_mutex;
 
 /* Download file. Return value is pointer of FileLoader.
    If path = QString::null, DownloadManager does not open local file.
-
    ex.1 )
-
    If you just want to download "http://www.hoge.com/foo.jpg", then:
-
    Kita::DownloadManager::download( "http://www.hoge.com/foo.jpg", "/tmp/foo.jpg" );
-
    
    ex.2 )
-
    If you want to do someting when received the data and when done,
    then connect signals like this:
-
    FileLoader* loader = Kita::DownloadManager::download( "http://www.hoge.com/foo.jpg", "/tmp/foo.jpg" );
    connect( loader, SIGNAL( data( const Kita::LoaderData&, const QByteArray& ) ),
             SLOT( slotData( const Kita::LoaderData&, const QByteArray& ) ) );
    connect( loader, SIGNAL( result( const Kita::LoaderData& ) ),
             SLOT( slotResult( const Kita::LoaderData& ) ) );
-
    [ Notice ] DownloadManager deletes FileLoader when done.  Never delete it in slotResult().
               See also ImgManager::loadPrivate(), and ImgManager::slotResult().
-
 */ /* public */ /* static */
 FileLoader* DownloadManager::download( const KURL& url, const QString& path,
-                                    const LoaderOption& option /* option user data */
-    )
+                                       const LoaderOption& option /* option user data */
+                                     )
 {
     QMutexLocker locker( &m_mutex );
 
     /* to use SIGNAL & SLOT, create instance of DownloadManager here. */
     /* ( You CANNOT use SIGNAL & SLOT without instance. )             */
-    if( instance == NULL ) instance = new DownloadManager();
-    
+    if ( instance == NULL ) instance = new DownloadManager();
+
     return instance->downloadPrivate( url, path, option );
 }
 
@@ -69,14 +69,14 @@ void DownloadManager::stopLoading( const KURL& url )
 {
     QMutexLocker locker( &m_mutex );
 
-    if( instance ) instance->stopLoadingPrivate( url );
+    if ( instance ) instance->stopLoadingPrivate( url );
 }
 
 
 /* public */ /* static */
 bool DownloadManager::isLoadingNow( const KURL& url )
 {
-    if( instance == NULL ) return FALSE;
+    if ( instance == NULL ) return FALSE;
 
     return instance->isLoadingNowPrivate( url );
 }
@@ -105,7 +105,7 @@ DownloadManager::~DownloadManager()
 
 /* private */
 FileLoader* DownloadManager::downloadPrivate( const KURL& url, const QString& path,
-                                             const LoaderOption& option )
+        const LoaderOption& option )
 {
     if ( isLoadingNowPrivate( url ) ) return NULL;
 
@@ -113,15 +113,15 @@ FileLoader* DownloadManager::downloadPrivate( const KURL& url, const QString& pa
     loader = new FileLoader( url, path, option );
     m_loaderList.append( loader );
 
-    if( loader->get() ){
-       connect( loader, SIGNAL( result( const Kita::LoaderData& ) ),
+    if ( loader->get() ) {
+        connect( loader, SIGNAL( result( const Kita::LoaderData& ) ),
                  SLOT( slotResult( const Kita::LoaderData& ) ) );
     }
     else {
         deleteLoader( loader );
         return NULL;
     }
-    
+
     return loader;
 }
 
@@ -145,7 +145,7 @@ bool DownloadManager::isLoadingNowPrivate( const KURL& url )
 }
 
 
-/* private */    
+/* private */
 FileLoader* DownloadManager::getLoader( const KURL& url )
 {
     if ( m_loaderList.count() == 0 ) return NULL;
@@ -174,11 +174,11 @@ void DownloadManager::deleteLoader( FileLoader* loader )
 /* This slot is called when loading is done. */ /* private slot */
 void DownloadManager::slotResult( const LoaderData& data )
 {
-    FileLoader* loader = getLoader( data.url );
+    FileLoader * loader = getLoader( data.url );
 
-   /* Deleting the FileLoader here may crush kita,
-      because loader may be also used in the other classes.
-      So, delete it later.  See also customEvent().    */  
+    /* Deleting the FileLoader here may crush kita,
+       because loader may be also used in the other classes.
+       So, delete it later.  See also customEvent().    */
     DeleteLoaderEvent * e = new DeleteLoaderEvent( loader );
     QApplication::postEvent( this, e );  // Qt will delete it when done
 }
@@ -203,32 +203,32 @@ void DownloadManager::customEvent( QCustomEvent * e )
 
 
 /*
-
 url:     url of target
 path:    path of save file. It can be QString::null. Then data is not saved in HDD. 
 option:  user defined option. See also downloadmanager.h 
-
 Call get() to start. Call stopJob() to stop.
 SIGNAL data() is emitted when data is received.
 SIGNAL result() is emitted when done.
-
 The pointer of struct Kita::LoaderData is sent by SIGNAL data() and result().
 For example,  to get result code:
-
 void TmpClass::slotResult( const Kita::LoaderData& data )
 {
    int result_code = data.code;
 }
-
 See also ImgManager::slotResult() and ImgManager::slotData().
-
 */
 FileLoader::FileLoader( const KURL& url, const QString& path, const LoaderOption& option )
 {
     m_data.url = url;
     m_data.path = path;
     m_data.tmppath = path;
-    if( path != QString::null ) m_data.tmppath += ".tmp";
+    if ( path != QString::null ) m_data.tmppath += ".tmp";
     m_data.option = option;
 
     m_ds = NULL;
@@ -251,12 +251,12 @@ FileLoader::~FileLoader()
 void FileLoader::killJob()
 {
     /* now loading */
-    if ( m_currentJob ){
+    if ( m_currentJob ) {
 
-       m_currentJob->kill(); /* without emitting result SIGNAL */
-       m_currentJob = NULL;
-       m_data.code = 0;
-       closeFile();
+        m_currentJob->kill(); /* without emitting result SIGNAL */
+        m_currentJob = NULL;
+        m_data.code = 0;
+        closeFile();
     }
 }
 
@@ -276,9 +276,9 @@ bool FileLoader::get()
     if ( m_currentJob ) return FALSE;
 
     /* create directory */
-    if( m_data.tmppath != QString::null ){
-       QFileInfo qi( m_data.tmppath );
-       if( !Kita::mkdir( qi.dirPath( TRUE ) ) ) return FALSE;
+    if ( m_data.tmppath != QString::null ) {
+        QFileInfo qi( m_data.tmppath );
+        if ( !Kita::mkdir( qi.dirPath( TRUE ) ) ) return FALSE;
     }
 
     m_data.totalsize = 0;
@@ -288,17 +288,17 @@ bool FileLoader::get()
     m_data.redirection = FALSE;
     m_file = NULL;
     m_ds = NULL;
-    
+
     /* If path of file is not QString::null, open file here */
     /* Note that data is saved as "m_data.tmppath".
        This file will be renamed in FileLoader::slotResult(). */
-    if( m_data.tmppath != QString::null ){
-       m_file = new QFile( m_data.tmppath );
-       if ( m_file == NULL || ! m_file->open( IO_WriteOnly ) ) {
-           closeFile();
-           return FALSE;
-       }
-       m_ds = new QDataStream( m_file );
+    if ( m_data.tmppath != QString::null ) {
+        m_file = new QFile( m_data.tmppath );
+        if ( m_file == NULL || ! m_file->open( IO_WriteOnly ) ) {
+            closeFile();
+            return FALSE;
+        }
+        m_ds = new QDataStream( m_file );
     }
 
     /* create job */
@@ -337,7 +337,7 @@ const bool FileLoader::isRunning() const
 const LoaderData& FileLoader::getData() const
 {
     return m_data;
-} 
+}
 
 /* close file                        */
 /* if code != 200, then remove file. */ /* private */
@@ -351,9 +351,9 @@ void FileLoader::closeFile()
     m_file = NULL;
 
     /* If loading failed, remove file */
-    if ( m_data.code != 200 && m_data.tmppath != QString::null && QFile::exists( m_data.tmppath ) ){
+    if ( m_data.code != 200 && m_data.tmppath != QString::null && QFile::exists( m_data.tmppath ) ) {
 
-       QFile::remove( m_data.tmppath );
+        QFile::remove( m_data.tmppath );
     }
 }
 
@@ -380,7 +380,7 @@ void FileLoader::slotData( KIO::Job* job, const QByteArray& barray )
     if ( job->error() == 0 ) {
 
         m_data.size += barray.size();
-        if( m_ds ) m_ds->writeRawBytes( barray.data(), barray.size() );
+        if ( m_ds ) m_ds->writeRawBytes( barray.data(), barray.size() );
 
         emit data( m_data, barray );
     }
@@ -409,11 +409,11 @@ void FileLoader::slotResult( KIO::Job* job )
     closeFile();
 
     /* rename */
-    if( m_data.code == 200 && m_data.tmppath != QString::null ){
-       if ( QFile::exists( m_data.path ) ) QFile::remove( m_data.path );
-       QDir qdir;
-       qdir.rename( m_data.tmppath, m_data.path );
+    if ( m_data.code == 200 && m_data.tmppath != QString::null ) {
+        if ( QFile::exists( m_data.path ) ) QFile::remove( m_data.path );
+        QDir qdir;
+        qdir.rename( m_data.tmppath, m_data.path );
     }
-    
+
     emit result( m_data );
 }
index 9bf5e7d..81d192a 100644 (file)
@@ -26,41 +26,41 @@ namespace Kita
     /* user option */
     struct LoaderOption
     {
-       KURL usrurl;
-       QString usrstr;
-       QStringList userstrlist;
-       int usrnum;
+        KURL usrurl;
+        QString usrstr;
+        QStringList userstrlist;
+        int usrnum;
     };
 
-    
+
     /* data */
     struct LoaderData
     {
-       /* URL and path of target */
-       KURL url;
-       QString path;
-
-       /*  path of tmpfile */
-       QString tmppath;
-
-       /* redirection */
-       bool redirection;
-       KURL redirectURL; /* = new URL */
-       
-       /* file info */
-       int code;
-       QString header; 
-       KIO::filesize_t size;
-       KIO::filesize_t totalsize;
-
-       /* user option */
-       LoaderOption option;
+        /* URL and path of target */
+        KURL url;
+        QString path;
+
+        /*  path of tmpfile */
+        QString tmppath;
+
+        /* redirection */
+        bool redirection;
+        KURL redirectURL; /* = new URL */
+
+        /* file info */
+        int code;
+        QString header;
+        KIO::filesize_t size;
+        KIO::filesize_t totalsize;
+
+        /* user option */
+        LoaderOption option;
     };
 
-    
+
     /*-----------------------------------------*/
 
-    
+
     class DownloadManager : public QObject
     {
         Q_OBJECT
@@ -74,7 +74,7 @@ namespace Kita
         ~DownloadManager();
 
         static FileLoader* download( const KURL& url, const QString& path,
-                                    const LoaderOption& option = LoaderOption() );
+                                     const LoaderOption& option = LoaderOption() );
         static void stopLoading( const KURL& url );
         static bool isLoadingNow( const KURL& url );
 
@@ -85,7 +85,7 @@ namespace Kita
 
         FileLoader* getLoader( const KURL& url );
         void deleteLoader( Kita::FileLoader* );
-       
+
     private slots:
         void slotResult( const Kita::LoaderData& );
 
@@ -100,13 +100,13 @@ namespace Kita
     class FileLoader : public QObject
     {
         Q_OBJECT
-           
+
         LoaderData m_data;
-       
+
         KIO::Job* m_currentJob;
         QFile *m_file;
         QDataStream *m_ds;
-       
+
     public:
         FileLoader( const KURL& url, const QString& path, const LoaderOption& option );
         ~FileLoader();
@@ -135,17 +135,17 @@ namespace Kita
 
 
     /*-----------------------------------------*/
-    
+
     /* delete loader event */
     class DeleteLoaderEvent : public QCustomEvent
     {
-       Kita::FileLoader* m_loader;
+        Kita::FileLoader* m_loader;
 
     public:
-       DeleteLoaderEvent( Kita::FileLoader* loader ) : QCustomEvent( EVENT_DeleteLoader )
-           , m_loader( loader ) {}
+        DeleteLoaderEvent( Kita::FileLoader* loader ) : QCustomEvent( EVENT_DeleteLoader )
+        , m_loader( loader ) {}
 
-       Kita::FileLoader* getLoader() const { return m_loader; }
+        Kita::FileLoader* getLoader() const { return m_loader; }
     };
 }
 
index 1fa84e9..c49d820 100644 (file)
@@ -34,7 +34,7 @@ void FavoriteBoards::append( KURL& url )
 {
     if ( ! getInstance() ->m_list.contains( url ) ) {
         getInstance() ->m_list.append( url );
-        getInstance()->notifyChange();
+        getInstance() ->notifyChange();
     }
 }
 
@@ -42,7 +42,7 @@ void FavoriteBoards::remove( KURL& url )
 {
     if ( getInstance() ->m_list.contains( url ) ) {
         getInstance() ->m_list.remove( url );
-        getInstance()->notifyChange();
+        getInstance() ->notifyChange();
     }
 }
 
@@ -77,39 +77,39 @@ bool FavoriteBoards::readFromXML( QString& xml )
 void FavoriteBoards::processChildNode( QDomNode& node )
 {
     QDomNode urlNode = node.namedItem( "url" );
-    if ( ! urlNode.isElement() ) return;
+    if ( ! urlNode.isElement() ) return ;
 
     QString urlText = urlNode.toElement().text();
 
     KURL url = KURL( urlText );
     if ( url.isValid() ) {
         //FavoriteBoards::append( url );
-        if ( !getInstance()->m_list.contains( url ) )
-            getInstance()->m_list.append( url );
+        if ( !getInstance() ->m_list.contains( url ) )
+            getInstance() ->m_list.append( url );
     }
 }
 
 QString FavoriteBoards::toXML()
 {
     QDomDocument document;
-    
+
     QDomProcessingInstruction pi = document.createProcessingInstruction( "xml", "version=\"1.0\"" );
     document.appendChild( pi );
-    
+
     QDomElement root = document.createElementNS( "http://kita.sourceforge.jp/ns/boardlist", "boardlist" );
     document.appendChild( root );
-    
+
     QValueList<KURL> boards = FavoriteBoards::boards();
     QValueList<KURL>::iterator it;
-    for( it = boards.begin(); it != boards.end(); ++it ) {
+    for ( it = boards.begin(); it != boards.end(); ++it ) {
         QDomElement board = document.createElementNS( "http://kita.sourceforge.jp/ns/board", "board" );
         root.appendChild( board );
-        
-        QString boardURL = (*it).url();
+
+        QString boardURL = ( *it ).url();
         QDomElement urlElement = document.createElement( "url" );
         board.appendChild( urlElement );
         urlElement.appendChild( document.createTextNode( boardURL ) );
-    
+
         QString boardName = Kita::BoardManager::boardName( boardURL );
         QDomElement nameElement = document.createElement( "name" );
         board.appendChild( nameElement );
@@ -120,11 +120,11 @@ QString FavoriteBoards::toXML()
 
 void FavoriteBoards::replace( QString fromURL, QString toURL )
 {
-    if( FavoriteBoards::getInstance() == NULL ) return;
-    QValueList<KURL>& boardList = FavoriteBoards::getInstance()->m_list;
+    if ( FavoriteBoards::getInstance() == NULL ) return ;
+    QValueList<KURL>& boardList = FavoriteBoards::getInstance() ->m_list;
     QValueList<KURL>::iterator it;
     for ( it = boardList.begin(); it != boardList.end(); ++it ) {
-        QString url = (*it).url();
+        QString url = ( *it ).url();
         if ( url.find( fromURL ) == 0 ) {
             url = url.replace( 0, fromURL.length(), toURL );
             boardList.remove( it );
@@ -132,7 +132,7 @@ void FavoriteBoards::replace( QString fromURL, QString toURL )
             it = boardList.begin();
         }
     }
-    FavoriteBoards::getInstance()->notifyChange();
+    FavoriteBoards::getInstance() ->notifyChange();
 }
 
 void FavoriteBoards::notifyChange()
index 5102b46..059dc32 100644 (file)
 
 // FavoriteThreadItem
 FavoriteThreadItem::FavoriteThreadItem()
-{
-}
+{}
 
 FavoriteThreadItem::~ FavoriteThreadItem()
-{
-}
+{}
 
 bool FavoriteThreadItem::operator==( const FavoriteThreadItem& item ) const
 {
@@ -106,7 +104,7 @@ void FavoriteThreads::processThreadNode( QDomNode& node )
     QDomNode datURLNode = node.namedItem( "daturl" );
     QDomNode nameNode = node.namedItem( "name" );
 
-    if ( !datURLNode.isElement() || !nameNode.isElement() ) return;
+    if ( !datURLNode.isElement() || !nameNode.isElement() ) return ;
 
     QString url = datURLNode.toElement().text();
     QString name = nameNode.toElement().text();
@@ -115,7 +113,7 @@ void FavoriteThreads::processThreadNode( QDomNode& node )
     Kita::Thread* thread = Kita::Thread::getByURL( datURL );
     thread->setThreadName( name );
     Kita::ThreadIndex::loadIndex( thread, datURL );
-    
+
     FavoriteThreads::getInstance() ->insert( datURL.prettyURL() );
 }
 
@@ -143,24 +141,24 @@ const QString FavoriteThreads::toXML() const
         QDomElement nameElement = document.createElement( "name" );
         threadElement.appendChild( nameElement );
         nameElement.appendChild( document.createTextNode( threadName ) );
-        
-        QString resNum = QString::number( Kita::DatManager::getResNum( datURL ) );      
-        QDomElement resNumElement = document.createElement( "resnum" );         
-        threadElement.appendChild( resNumElement );     
-        resNumElement.appendChild( document.createTextNode( resNum ) );         
-        
-        // board        
-        QDomElement board = document.createElementNS( "http://kita.sourceforge.jp/ns/board", "board" );   
-        threadElement.appendChild( board );     
-
-        QString boardURL = Kita::BoardManager::boardURL( datURL );      
-        QDomElement boardURLElement = document.createElement( "url" );          
-        board.appendChild( boardURLElement );   
-        boardURLElement.appendChild( document.createTextNode( boardURL ) );     
-
-        QString boardName = Kita::BoardManager::boardName( boardURL );          
-        QDomElement boardNameElement = document.createElement( "name" );        
-        board.appendChild( boardNameElement );          
+
+        QString resNum = QString::number( Kita::DatManager::getResNum( datURL ) );
+        QDomElement resNumElement = document.createElement( "resnum" );
+        threadElement.appendChild( resNumElement );
+        resNumElement.appendChild( document.createTextNode( resNum ) );
+
+        // board
+        QDomElement board = document.createElementNS( "http://kita.sourceforge.jp/ns/board", "board" );
+        threadElement.appendChild( board );
+
+        QString boardURL = Kita::BoardManager::boardURL( datURL );
+        QDomElement boardURLElement = document.createElement( "url" );
+        board.appendChild( boardURLElement );
+        boardURLElement.appendChild( document.createTextNode( boardURL ) );
+
+        QString boardName = Kita::BoardManager::boardName( boardURL );
+        QDomElement boardNameElement = document.createElement( "name" );
+        board.appendChild( boardNameElement );
         boardNameElement.appendChild( document.createTextNode( boardName ) );
     }
     return document.toString( 0 );
@@ -168,7 +166,7 @@ const QString FavoriteThreads::toXML() const
 
 void FavoriteThreads::replace( QString fromURL, QString toURL )
 {
-    if( FavoriteThreads::getInstance() == NULL ) return;
+    if ( FavoriteThreads::getInstance() == NULL ) return ;
     QValueList<FavoriteThreadItem>& threadList = FavoriteThreads::getInstance() ->m_threadList;
     QValueList<FavoriteThreadItem>::iterator it;
     for ( it = threadList.begin(); it != threadList.end(); ++it ) {
@@ -184,8 +182,8 @@ void FavoriteThreads::replace( QString fromURL, QString toURL )
 
 QString FavoriteThreads::getDatURL( int i )
 {
-    if ( getInstance()->m_threadList.count() > i ) {
-        return getInstance()->m_threadList[ i ].m_datURL;
+    if ( getInstance() ->m_threadList.count() > i ) {
+        return getInstance() ->m_threadList[ i ].m_datURL;
     } else {
         return QString::null;
     }
index d814c54..a2cf103 100644 (file)
@@ -52,7 +52,7 @@ public:
     static void replace( QString fromURL, QString toURL );
     // FIXME: use Iterator
     static QString getDatURL( int i );
-    static int count() { return getInstance()->m_threadList.count(); }
+static int count() { return getInstance() ->m_threadList.count(); }
 };
 
 #endif
index 10abad5..6173ae6 100644 (file)
@@ -294,7 +294,7 @@ bool ImgManager::loadPrivate( const KURL& url, const KURL& datURL )
     const unsigned int maxload = 5; // = KitaConfig::maxLoader();
 
     /*------------------------------*/
-    
+
     if ( DownloadManager::isLoadingNow( url ) ) return FALSE;
 
     /* cache exists? */
@@ -308,8 +308,8 @@ bool ImgManager::loadPrivate( const KURL& url, const KURL& datURL )
         return TRUE;
     }
 
-    if( m_urlList.count() > maxload ) return FALSE;
-    
+    if ( m_urlList.count() > maxload ) return FALSE;
+
     QString path = Cache::getImgPath( url );
     deleteImgDat( url );
 
@@ -319,12 +319,12 @@ bool ImgManager::loadPrivate( const KURL& url, const KURL& datURL )
     option.usrurl = datURL;
     FileLoader* loader = DownloadManager::download( url, path, option );
     if ( loader == NULL ) return FALSE;
-    
+
     connect( loader, SIGNAL( data( const Kita::LoaderData&, const QByteArray& ) ),
-            SLOT( slotData( const Kita::LoaderData&, const QByteArray& ) ) );
+             SLOT( slotData( const Kita::LoaderData&, const QByteArray& ) ) );
 
     connect( loader, SIGNAL( result( const Kita::LoaderData& ) ),
-            SLOT( slotResult( const Kita::LoaderData& ) ) );
+             SLOT( slotResult( const Kita::LoaderData& ) ) );
 
     m_urlList += url.prettyURL();
 
index 1996e3d..e2fe51c 100644 (file)
@@ -37,7 +37,7 @@ struct IMGDAT
 namespace Kita
 {
     class LoaderData;
-    
+
     class ImgManager : public QObject
     {
         Q_OBJECT
@@ -46,7 +46,7 @@ namespace Kita
         static QMutex m_mutex;
         QDict< IMGDAT > m_imgDatDict;
         QWidget* m_mainwidget;
-        QStringList m_urlList; 
+        QStringList m_urlList;
 
     public:
         ImgManager( QWidget* mainwidget );
@@ -105,12 +105,12 @@ namespace Kita
     /* finish event */
     class EmitFinishEvent : public QCustomEvent
     {
-       KURL m_url;
+        KURL m_url;
 
-      public:
-       EmitFinishEvent( KURL url ) : QCustomEvent( EVENT_EmitFinigh ), m_url( url ) {}
+    public:
+        EmitFinishEvent( KURL url ) : QCustomEvent( EVENT_EmitFinigh ), m_url( url ) {}
 
-       KURL url() const { return m_url; }
+        KURL url() const { return m_url; }
     };
 
 }
index 856d973..2815ee1 100644 (file)
@@ -33,8 +33,8 @@ namespace Kita
 {
     static QMutex codecMutex;
     static QCp932Codec* qcpCodec = NULL;
-    static QTextCodec*  utf8Codec = NULL;
-    static QTextCodec*  eucCodec = NULL; 
+    static QTextCodec* utf8Codec = NULL;
+    static QTextCodec* eucCodec = NULL;
 
     static QString m_weekstr[ 7 ];
     static QString m_colonstr;
@@ -44,7 +44,7 @@ namespace Kita
     static int m_prevConvMode;
     static QString m_prevConvURL;
     static QString m_prevConvNewURL;
-    static QString m_prevConvRefstr;    
+    static QString m_prevConvRefstr;
 
     /* for ParseMachiBBSOneLine */
     static QString m_machiSubject;
@@ -130,7 +130,7 @@ void Kita::DatToText(
 )
 {
     text = QString::null;
-    
+
     unsigned int startPos, pos;
     const QChar *chpt = rawData.unicode();
     unsigned int length = rawData.length();
@@ -156,8 +156,8 @@ void Kita::DatToText(
 
             /* remove HTML tags <[^>]*>  */
             else {
-               
-                if( i - startPos ) text += rawData.mid( startPos, i - startPos );
+
+                if ( i - startPos ) text += rawData.mid( startPos, i - startPos );
                 while ( chpt[ i ] != '>' && i < length ) i++;
                 startPos = i + 1;
             }
@@ -168,7 +168,7 @@ void Kita::DatToText(
             /*----------------------------------*/
 
         case '&':
-           
+
             /* special char */
             {
                 QString tmpstr;
@@ -255,30 +255,30 @@ QString Kita::getThreadURL( const KURL& url )
 }
 
 
-/* convert thread URL, and get reference. 
+/* convert thread URL, and get reference.
    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. 
    
 (ex.1)
-
 mode = 0
 url  = http://pc5.2ch.net/linux/dat/1069738960.dat#20-30
 ->
 return : http://pc5.2ch.net/linux/dat/1069738960.dat
 retstr : 20-30
-
 (ex.2)
-
 mode = 1
 url  = http://pc5.2ch.net/linux/dat/1069738960.dat#20-30
 ->
 return : http://pc5.2ch.net/test/read.cgi/linux/1069738960
 retstr : 20-30
-
 (ex.3)
-
 mode = 0
 url  = http://pc5.2ch.net/test/read.cgi/linux/1069738960/-100
 ->
@@ -289,26 +289,26 @@ refstr : 1-100
 QString Kita::convertURL(
 
     /* input */
-    int mode,  /* if 0, output is dat URL. If 1, output is thread URL */
+    int mode,   /* if 0, output is dat URL. If 1, output is thread URL */
     const KURL& url ,
 
     /* output */
     QString& refstr )
 {
     refstr = QString::null;
-    
-    if( url.isEmpty() ) return QString::null;
-       
+
+    if ( url.isEmpty() ) return QString::null;
+
     /* cache */
-    if( m_prevConvMode == mode &&  m_prevConvURL == url.prettyURL() ) {
+    if ( m_prevConvMode == mode && m_prevConvURL == url.prettyURL() ) {
 
-       refstr = m_prevConvRefstr;
-       return m_prevConvNewURL;
+        refstr = m_prevConvRefstr;
+        return m_prevConvNewURL;
     }
-    
+
     /* Is board enrolled ? */
     BoardData* bdata = Kita::BoardManager::getBoardData( url );
-    if( bdata == NULL ) return QString::null;
+    if ( bdata == NULL ) return QString::null;
 
     QString urlstr = url.prettyURL();
 
@@ -316,58 +316,57 @@ QString Kita::convertURL(
     QString thread = QString::null;
     QString refBase = QString::null;;
 
-    if( urlstr.contains( "/dat/" ) ){ 
+    if ( urlstr.contains( "/dat/" ) ) {
 
-       /* url = (hostname)/(rootPath)/(bbsPath)/dat/(thread_ID).(ext)#(refBase)  */
-       thread = url.filename().remove( bdata->ext() );
-       refBase = url.ref();
-    }
-    else if( urlstr.contains( bdata->delimiter() ) ) {
-
-       QString tmpstr;
-       switch( bdata->type() ){
-
-       /* machi BBS */
-       /* ex.) If url = http://kanto.machi.to/bbs/read.pl?BBS=kana&KEY=1096716679 ,
-          then, thread = 1096716679                                */
-       case Board_MachiBBS:
-           thread = url.queryItem( "KEY" );
-           refBase = QString::null;
-           break;
-
-        /* url = (hostname)/(rootPath)/(delimiter)/(bbsPath)/(thread_ID)/(refBase) */
-       default:
-           tmpstr = urlstr.section( bdata->delimiter() + bdata->bbsPath(), 1, 1 );
+        /* url = (hostname)/(rootPath)/(bbsPath)/dat/(thread_ID).(ext)#(refBase)  */
+        thread = url.filename().remove( bdata->ext() );
+        refBase = url.ref();
+    } else if ( urlstr.contains( bdata->delimiter() ) ) {
+
+        QString tmpstr;
+        switch ( bdata->type() ) {
+
+            /* machi BBS */
+            /* ex.) If url = http://kanto.machi.to/bbs/read.pl?BBS=kana&KEY=1096716679 ,
+               then, thread = 1096716679                                */
+        case Board_MachiBBS:
+            thread = url.queryItem( "KEY" );
+            refBase = QString::null;
+            break;
+
+            /* url = (hostname)/(rootPath)/(delimiter)/(bbsPath)/(thread_ID)/(refBase) */
+        default:
+            tmpstr = urlstr.section( bdata->delimiter() + bdata->bbsPath(), 1, 1 );
             thread = tmpstr.section( '/', 1, 1 );
-           refBase = tmpstr.section( '/', 2, 2 );
-           break;
-       }
+            refBase = tmpstr.section( '/', 2, 2 );
+            break;
+        }
     }
 
-    if( thread == QString::null ) return QString::null;
+    if ( thread == QString::null ) return QString::null;
+
+    if ( refBase != QString::null ) {
 
-    if ( refBase != QString::null ){
-       
-       if ( refBase.at( 0 ) == '-' ) refstr = "1" + refBase;
-       else refstr = refBase;
+        if ( refBase.at( 0 ) == '-' ) refstr = "1" + refBase;
+        else refstr = refBase;
     }
 
     /* create new URL */
     QString newURL;
-    if( mode == URLMODE_DAT ) newURL = bdata->basePath() + "dat/" + thread + bdata->ext();
+    if ( mode == URLMODE_DAT ) newURL = bdata->basePath() + "dat/" + thread + bdata->ext();
     else {
-       newURL = bdata->cgiBasePath();
-           
-       switch( bdata->type() ){
-
-       case Board_MachiBBS:
-           newURL += "&KEY=" + thread;
-           break;
-           
-       default:
-           newURL += thread;
-           break;
-       }
+        newURL = bdata->cgiBasePath();
+
+        switch ( bdata->type() ) {
+
+        case Board_MachiBBS:
+            newURL += "&KEY=" + thread;
+            break;
+
+        default:
+            newURL += thread;
+            break;
+        }
     }
 
     /* cache */
@@ -375,7 +374,7 @@ QString Kita::convertURL(
     m_prevConvURL = url.prettyURL();
     m_prevConvNewURL = newURL;
     m_prevConvRefstr = refstr;
-    
+
     return newURL;
 }
 
@@ -418,20 +417,20 @@ QString Kita::datToOfflaw( const KURL& datURL )
 bool Kita::mkdir( const QString& targetPath )
 {
     QDir qdir( targetPath );
-    if( !qdir.exists() ){
+    if ( !qdir.exists() ) {
+
+        QStringList pathList = QStringList::split( "/", targetPath );
+        QString path = QString::null;
 
-       QStringList pathList = QStringList::split( "/", targetPath );
-       QString path = QString::null;
+        for ( unsigned int i = 0; i < pathList.count(); ++i ) {
 
-       for( unsigned int i = 0; i < pathList.count(); ++i ){
-           
-           path += "/" + pathList[ i ];
+            path += "/" + pathList[ i ];
 
-           qdir =  path;
-           if( !qdir.exists() ){
-               if( !qdir.mkdir( path ) ) return FALSE;
-           }
-       }
+            qdir = path;
+            if ( !qdir.exists() ) {
+                if ( !qdir.mkdir( path ) ) return FALSE;
+            }
+        }
     }
 
     return TRUE;
@@ -451,7 +450,7 @@ uint Kita::datToSince( const KURL& datURL )
 }
 
 
-/* if cdat == str, return str.length() */ 
+/* if cdat == str, return str.length() */
 int Kita::isEqual( const QChar *cdat, const QString& str )
 {
     int i = 0;
@@ -499,7 +498,8 @@ int Kita::stringToPositiveNum( const QChar *cdat, const unsigned int length )
 
 
 /* init parser. Don't forget to call this before parsing. */
-void Kita::InitParseMachiBBS(){
+void Kita::InitParseMachiBBS()
+{
     m_machiSubject = QString::null;
     m_machiLine = QString::null;
 }
@@ -520,7 +520,7 @@ QString Kita::ParseMachiBBSOneLine( const QString& inputLine, int& nextNum )
 
     // Subject
     QRegExp title_regexp( "<title>(.*)</title>" );
-    
+
     // pattern 1 (tokyo,kanagawa,...)
     QRegExp regexp ( "<dt>(\\d*) .*<font color=\"#......\"><b> (.*) </b></font> .* (..../../..).* (..:..:..) ID:([^<]*)<br><dd>(.*)" );
     QRegExp regexp2( "<dt>(\\d*) .*<a href=\"mailto:(.*)\"><b> (.*) </B></a> .* (..../../..).* (..:..:..) ID:([^<]*)<br><dd>(.*)" );
@@ -532,72 +532,71 @@ QString Kita::ParseMachiBBSOneLine( const QString& inputLine, int& nextNum )
     /* abone */
     QRegExp regexp5( "<dt>(\\d*) .*<br><dd>.*" );
 
-    
+
     if ( regexp.search( m_machiLine ) != -1 ) {
-           
-       num = regexp.cap( 1 ).toInt();
-       name = regexp.cap( 2 );
-       date = regexp.cap( 3 );
-       time = regexp.cap( 4 );
-       id = regexp.cap( 5 );
-       message = regexp.cap( 6 );
-           
+
+        num = regexp.cap( 1 ).toInt();
+        name = regexp.cap( 2 );
+        date = regexp.cap( 3 );
+        time = regexp.cap( 4 );
+        id = regexp.cap( 5 );
+        message = regexp.cap( 6 );
+
     } else if ( regexp2.search( m_machiLine ) != -1 ) {
-           
-       num = regexp2.cap( 1 ).toInt();
-       mail = regexp2.cap( 2 );
-       name = regexp2.cap( 3 );
-       date = regexp2.cap( 4 );
-       time = regexp2.cap( 5 );
-       id = regexp2.cap( 6 );
-       message = regexp2.cap( 7 );
-           
+
+        num = regexp2.cap( 1 ).toInt();
+        mail = regexp2.cap( 2 );
+        name = regexp2.cap( 3 );
+        date = regexp2.cap( 4 );
+        time = regexp2.cap( 5 );
+        id = regexp2.cap( 6 );
+        message = regexp2.cap( 7 );
+
     } else if ( regexp3.search( m_machiLine ) != -1 ) {
-       
-       num = regexp3.cap( 1 ).toInt();
-       name = regexp3.cap( 2 );
-       date = regexp3.cap( 3 );
-       time = regexp3.cap( 4 );
-       id = regexp3.cap( 5 );
-       host = regexp3.cap( 6 );
-       message = regexp3.cap( 7 );
-       
+
+        num = regexp3.cap( 1 ).toInt();
+        name = regexp3.cap( 2 );
+        date = regexp3.cap( 3 );
+        time = regexp3.cap( 4 );
+        id = regexp3.cap( 5 );
+        host = regexp3.cap( 6 );
+        message = regexp3.cap( 7 );
+
     } else if ( regexp4.search( m_machiLine ) != -1 ) {
-       
-       num = regexp4.cap( 1 ).toInt();
-       mail = regexp4.cap( 2 );
-       name = regexp4.cap( 3 );
-       date = regexp4.cap( 4 );
-       time = regexp4.cap( 5 );
-       id = regexp4.cap( 6 );
-       host = regexp4.cap( 7 );        
-       message = regexp4.cap( 8 );
+
+        num = regexp4.cap( 1 ).toInt();
+        mail = regexp4.cap( 2 );
+        name = regexp4.cap( 3 );
+        date = regexp4.cap( 4 );
+        time = regexp4.cap( 5 );
+        id = regexp4.cap( 6 );
+        host = regexp4.cap( 7 );
+        message = regexp4.cap( 8 );
 
     } else if ( regexp5.search( m_machiLine ) != -1 ) { /* abone */
-       
-       num = regexp5.cap( 1 ).toInt();
-       m_machiLine = QString::null;
-       if( num == nextNum ) return "abone<><><>abone<>";
-       else return QString::null;
-       
+
+        num = regexp5.cap( 1 ).toInt();
+        m_machiLine = QString::null;
+        if ( num == nextNum ) return "abone<><><>abone<>";
+        else return QString::null;
+
     } else if ( title_regexp.search( m_machiLine ) != -1 ) { /* get title */
-       
-       m_machiSubject = title_regexp.cap( 1 );
-       m_machiLine = QString::null;
-       return QString::null;
+
+        m_machiSubject = title_regexp.cap( 1 );
+        m_machiLine = QString::null;
+        return QString::null;
     }
-    
     else return QString::null;
 
-    if( num >= nextNum ){
-       
-       if( num != 1 ) m_machiSubject = QString::null;
-       ret += name + "<><>" + date + " " + time + " ID:" + id;
-       if( host != QString::null ) ret += " HOST:" + host;
-       ret += "<>" + message + "<>" + m_machiSubject;
-       nextNum = num;
+    if ( num >= nextNum ) {
+
+        if ( num != 1 ) m_machiSubject = QString::null;
+        ret += name + "<><>" + date + " " + time + " ID:" + id;
+        if ( host != QString::null ) ret += " HOST:" + host;
+        ret += "<>" + message + "<>" + m_machiSubject;
+        nextNum = num;
     }
-    
+
     m_machiLine = QString::null;
     return ret;
 }
@@ -609,32 +608,32 @@ QString Kita::ParseMachiBBSOneLine( const QString& inputLine, int& nextNum )
 
 QString Kita::ParseJBBSOneLine( const QString& line, int& nextNum )
 {
-  QString ret = QString::null;
-  QStringList list = QStringList::split( "<>", line, true );
-  if( list.size() != 7 ) return QString::null;
-
-  int num = list[ 0 ].toInt();
-  QString name = list[ 1 ];
-  QString mail = list[ 2 ];
-  QString date = list[ 3 ];
-  QString body = list[ 4 ];
-  QString subject = list[ 5 ];
-  QString id = list[ 6 ];
-
-  if( num < nextNum ) return QString::null;
-  
-  /* remove tag */
-  QRegExp rex( "<[^<]*>" );
-  name.remove( rex );
+    QString ret = QString::null;
+    QStringList list = QStringList::split( "<>", line, true );
+    if ( list.size() != 7 ) return QString::null;
 
-  /* remove week */
-  rex = QRegExp( "\\(.*\\)" );
-  date.remove( rex );
-  
-  ret += name + "<>" + mail + "<>" + date + " ID:" + id + "<>" + body + "<>" + subject;
-  nextNum = num;
-  
-  return ret;
+    int num = list[ 0 ].toInt();
+    QString name = list[ 1 ];
+    QString mail = list[ 2 ];
+    QString date = list[ 3 ];
+    QString body = list[ 4 ];
+    QString subject = list[ 5 ];
+    QString id = list[ 6 ];
+
+    if ( num < nextNum ) return QString::null;
+
+    /* remove tag */
+    QRegExp rex( "<[^<]*>" );
+    name.remove( rex );
+
+    /* remove week */
+    rex = QRegExp( "\\(.*\\)" );
+    date.remove( rex );
+
+    ret += name + "<>" + mail + "<>" + date + " ID:" + id + "<>" + body + "<>" + subject;
+    nextNum = num;
+
+    return ret;
 }
 
 
@@ -644,27 +643,27 @@ QString Kita::ParseJBBSOneLine( const QString& line, int& nextNum )
 
 QString Kita::ParseFlashCGIOneLine( const QString& line )
 {
-  QString ret = QString::null;
-  QStringList list = QStringList::split( "<>", line, true );
-  if( list.size() != 13 ) return QString::null;
-
-  QString name = list[ 0 ];
-  QString mail = list[ 1 ];
-  QString date = list[ 2 ];
-  QString body = list[ 3 ];
-  QString subject = list[ 4 ];
-  QString id = list[ 6 ];
-  QString host = list[ 7 ];
-
-  /* remove tag */
-  QRegExp rex( "<[^<]*>" );
-  name.remove( rex );
-
-  ret += name + "<>" + mail + "<>" + date + " ID:" + id;
-  if( host != QString::null ) ret += " HOST:" + host;
-  ret += "<>" + body + "<>" + subject;
-  
-  return ret;
+    QString ret = QString::null;
+    QStringList list = QStringList::split( "<>", line, true );
+    if ( list.size() != 13 ) return QString::null;
+
+    QString name = list[ 0 ];
+    QString mail = list[ 1 ];
+    QString date = list[ 2 ];
+    QString body = list[ 3 ];
+    QString subject = list[ 4 ];
+    QString id = list[ 6 ];
+    QString host = list[ 7 ];
+
+    /* remove tag */
+    QRegExp rex( "<[^<]*>" );
+    name.remove( rex );
+
+    ret += name + "<>" + mail + "<>" + date + " ID:" + id;
+    if ( host != QString::null ) ret += " HOST:" + host;
+    ret += "<>" + body + "<>" + subject;
+
+    return ret;
 }
 
 
@@ -684,23 +683,23 @@ QString Kita::ParseFlashCGIOneLine( const QString& line )
   This function is called from Kita::DatToHtml() and DatInfo::parseDat()
   
   input:
-
   resdat.num     ... number
   resdat.linestr ... raw line strings
-
   output:
   
   resdat.*
   subject
-*/ 
+*/
 bool Kita::parseResDat( RESDAT& resdat, QString& subject )
 {
     if ( resdat.parsed ) return TRUE;
-    
+
     resdat.parsed = TRUE;
     resdat.broken = FALSE;
     resdat.anclist.clear();
-    
+
     /* search the staring positions of each section to split raw data. */
     const QChar *chpt = resdat.linestr.unicode();
     unsigned int length = resdat.linestr.length();
@@ -708,43 +707,43 @@ bool Kita::parseResDat( RESDAT& resdat, QString& subject )
     unsigned int sectionPos[ 5 ];
     for ( unsigned int i = 0 ; i < length ; i++ ) {
 
-       /* sections are splitted by "<>" */
-       if ( chpt[ i ] == '<' && chpt[ i + 1 ] == '>' ){
-           section++;
+        /* sections are splitted by "<>" */
+        if ( chpt[ i ] == '<' && chpt[ i + 1 ] == '>' ) {
+            section++;
 
 
-           if( section >= 5 ){
-               resdat.broken = TRUE;
-               return TRUE;
-           }
+            if ( section >= 5 ) {
+                resdat.broken = TRUE;
+                return TRUE;
+            }
 
-           sectionPos[ section ] = i + 2;
-           i++;
-       }
+            sectionPos[ section ] = i + 2;
+            i++;
+        }
     }
 
-    /* broken data */    
-    if( section != 4 ){
-       resdat.broken = TRUE;
-       return TRUE;
+    /* broken data */
+    if ( section != 4 ) {
+        resdat.broken = TRUE;
+        return TRUE;
     }
 
-//    qDebug("[%d] %d %d %d %d",section, sectionPos[1],sectionPos[2],sectionPos[3],sectionPos[4] );
+    //    qDebug("[%d] %d %d %d %d",section, sectionPos[1],sectionPos[2],sectionPos[3],sectionPos[4] );
 
     /* name */
-    length = sectionPos[ 1 ] -2 ;
+    length = sectionPos[ 1 ] - 2 ;
     parseName( resdat.linestr.mid( 0, length ), resdat );
 
     /* mail */
-    length = sectionPos[ 2 ] -2 - sectionPos[ 1 ];
+    length = sectionPos[ 2 ] - 2 - sectionPos[ 1 ];
     DatToText( resdat.linestr.mid( sectionPos[ 1 ], length ), resdat.address );
 
     /* date, ID, host  */
-    length = sectionPos[ 3 ] -2 - sectionPos[ 2 ];
+    length = sectionPos[ 3 ] - 2 - sectionPos[ 2 ];
     parseDateId( resdat.linestr.mid( sectionPos[ 2 ], length ), resdat );
 
     /* body */
-    length = sectionPos[ 4 ] -2 - sectionPos[ 3 ];
+    length = sectionPos[ 4 ] - 2 - sectionPos[ 3 ];
     parseBody( resdat.linestr.mid( sectionPos[ 3 ], length ), resdat );
 
     /* subject */
@@ -764,7 +763,7 @@ bool Kita::parseResDat( RESDAT& resdat, QString& subject )
 */
 void Kita::parseName( const QString& rawStr, RESDAT& resdat )
 {
-    unsigned int i = 0, pos;   
+    unsigned int i = 0, pos;
     int refNum[ 2 ];
     QString linkurl, linkstr;
 
@@ -773,34 +772,34 @@ void Kita::parseName( const QString& rawStr, RESDAT& resdat )
     const QChar * chpt = resdat.name.unicode();
     unsigned int length = resdat.name.length();
     resdat.nameHTML = QString::null;
-    
+
     /* anchor */
-    while( parseResAnchor( chpt + i, length - i, linkstr, refNum, pos ) ) {
-
-       linkurl = QString( "#%1" ).arg( refNum[ 0 ] );
-       if ( refNum[ 1 ] ) linkurl += QString( "-%1" ).arg( refNum[ 1 ] );
-
-       resdat.nameHTML += "<a href=\"" + linkurl + "\">";
-       resdat.nameHTML += linkstr;
-       resdat.nameHTML += "</a>";
-
-       ANCNUM anctmp;
-       if ( refNum[ 1 ] < refNum[ 0 ] ) refNum[ 1 ] = refNum[ 0 ];
-       anctmp.from = refNum[ 0 ];
-       anctmp.to = refNum[ 1 ];
-       resdat.anclist += anctmp;
-           
-       i += pos;
+    while ( parseResAnchor( chpt + i, length - i, linkstr, refNum, pos ) ) {
+
+        linkurl = QString( "#%1" ).arg( refNum[ 0 ] );
+        if ( refNum[ 1 ] ) linkurl += QString( "-%1" ).arg( refNum[ 1 ] );
+
+        resdat.nameHTML += "<a href=\"" + linkurl + "\">";
+        resdat.nameHTML += linkstr;
+        resdat.nameHTML += "</a>";
+
+        ANCNUM anctmp;
+        if ( refNum[ 1 ] < refNum[ 0 ] ) refNum[ 1 ] = refNum[ 0 ];
+        anctmp.from = refNum[ 0 ];
+        anctmp.to = refNum[ 1 ];
+        resdat.anclist += anctmp;
+
+        i += pos;
     }
 
     /* non-digits strings */
-    if( i < length ){
-           
-       resdat.nameHTML += "<span class=\"name_noaddr\">";
-       resdat.nameHTML += resdat.name.mid( i );
-       resdat.nameHTML += "</span>";
+    if ( i < length ) {
+
+        resdat.nameHTML += "<span class=\"name_noaddr\">";
+        resdat.nameHTML += resdat.name.mid( i );
+        resdat.nameHTML += "</span>";
     }
-    
+
 }
 
 
@@ -812,7 +811,7 @@ void Kita::parseName( const QString& rawStr, RESDAT& resdat )
    resdat.date
    resdat.id
    resdat.host
-
 */
 void Kita::parseDateId( const QString& rawStr, RESDAT& resdat )
 {
@@ -829,14 +828,14 @@ void Kita::parseDateId( const QString& rawStr, RESDAT& resdat )
     resdat.date = rawStr;
     resdat.id = QString::null;
     resdat.host = QString::null;
-     
+
     const QChar *chpt = rawStr.unicode();
     unsigned int pos = 0, startpos = 0;
     unsigned int length = rawStr.length();
 
     /* year */
-    while( chpt[ pos ] != '/' && pos++ < length );
-    if( pos >= length ) return;
+    while ( chpt[ pos ] != '/' && pos++ < length );
+    if ( pos >= length ) return ;
     int year = rawStr.mid( 0, pos ).toInt();
     pos++;
 
@@ -846,90 +845,90 @@ void Kita::parseDateId( const QString& rawStr, RESDAT& resdat )
         year += 2000;
     }
 
-//    qDebug("year %d, pos %d",year,pos );
+    //    qDebug("year %d, pos %d",year,pos );
 
     /* month */
     startpos = pos;
-    while( chpt[ pos ] != '/' && pos++ < length );
-    if( pos >= length ) return;
+    while ( chpt[ pos ] != '/' && pos++ < length );
+    if ( pos >= length ) return ;
     int month = rawStr.mid( startpos, pos - startpos ).toInt();
     pos++;
 
-//    qDebug("month %d, pos %d",month,pos );
+    //    qDebug("month %d, pos %d",month,pos );
 
     /* day */
     startpos = pos;
-    while( chpt[ pos ] != ' ' && chpt[ pos ] != '(' && pos++ < length );
-    if( pos >= length ) return;
+    while ( chpt[ pos ] != ' ' && chpt[ pos ] != '(' && pos++ < length );
+    if ( pos >= length ) return ;
     int day = rawStr.mid( startpos, pos - startpos ).toInt();
     pos++;
 
-//    qDebug("day %d, pos %d",day,pos );
+    //    qDebug("day %d, pos %d",day,pos );
 
     /* skip week */
-    if( chpt[ pos -1 ] == '(' ){
+    if ( chpt[ pos - 1 ] == '(' ) {
 
-       while ( chpt[ pos ] != ')' && pos++ < length );
-       pos++;
+        while ( chpt[ pos ] != ')' && pos++ < length );
+        pos++;
     }
-    
+
     /* hour */
     startpos = pos;
-    while( chpt[ pos ] != ':' && pos++ < length );
-    if( pos >= length ) return;
+    while ( chpt[ pos ] != ':' && pos++ < length );
+    if ( pos >= length ) return ;
     int hour = rawStr.mid( startpos, pos - startpos ).toInt();
     pos++;
 
-//    qDebug("h %d, pos %d",hour,pos );
+    //    qDebug("h %d, pos %d",hour,pos );
 
     /* min */
     startpos = pos;
-    while( chpt[ pos ] != ':' && chpt[ pos ] != ' ' && pos++ < length );
+    while ( chpt[ pos ] != ':' && chpt[ pos ] != ' ' && pos++ < length );
     int min = rawStr.mid( startpos, pos - startpos ).toInt();
     pos++;
 
-//    qDebug("min %d, pos %d",min,pos );
+    //    qDebug("min %d, pos %d",min,pos );
 
     /* sec */
     int sec = 0;
-    if( pos < length && chpt[ pos -1 ] == ':' ){
-       startpos = pos;
-       while( chpt[ pos ] != ' ' && pos++ < length );
-       sec = rawStr.mid( startpos, pos - startpos ).toInt();
-       pos++;
+    if ( pos < length && chpt[ pos - 1 ] == ':' ) {
+        startpos = pos;
+        while ( chpt[ pos ] != ' ' && pos++ < length );
+        sec = rawStr.mid( startpos, pos - startpos ).toInt();
+        pos++;
 
-//     qDebug("sec %d, pos %d",sec,pos );
+        //     qDebug("sec %d, pos %d",sec,pos );
     }
 
     /* date */
     resdat.dateTime = QDateTime( QDate( year, month, day ), QTime( hour, min, sec ) );
     resdat.date = resdat.dateTime.toString( "yy/MM/dd" )
-       + m_weekstr[ resdat.dateTime.date().dayOfWeek() - 1 ]
-       + resdat.dateTime.toString( "hh:mm:ss" );
+                  + m_weekstr[ resdat.dateTime.date().dayOfWeek() - 1 ]
+                  + resdat.dateTime.toString( "hh:mm:ss" );
+
+    if ( pos >= length ) return ;
 
-    if( pos >= length ) return;
-    
     /* id */
-    if( chpt[ pos ] == 'I' && chpt[ pos +1 ] == 'D'  ){
-       pos += 3;
-       startpos = pos;
-       while( chpt[ pos ] != ' ' && pos++ < length );
-       resdat.id = rawStr.mid( startpos, pos - startpos );
-       pos++;
+    if ( chpt[ pos ] == 'I' && chpt[ pos + 1 ] == 'D' ) {
+        pos += 3;
+        startpos = pos;
+        while ( chpt[ pos ] != ' ' && pos++ < length );
+        resdat.id = rawStr.mid( startpos, pos - startpos );
+        pos++;
     }
 
-//    qDebug("date %s, ID %s", (const char*)resdat.date.local8Bit(), resdat.id.ascii() );
-    
-    if( pos >= length ) return;    
+    //    qDebug("date %s, ID %s", (const char*)resdat.date.local8Bit(), resdat.id.ascii() );
+
+    if ( pos >= length ) return ;
 
     /* host */
-    if( chpt[ pos ] == 'H' && chpt[ pos +1 ] == 'O'  ){
-       pos += 5;
-       startpos = pos;
-       while( chpt[ pos ] != ' ' && pos++ < length );
-       resdat.host = rawStr.mid( startpos, pos - startpos );
-       pos++;
-//     qDebug("host %s", resdat.host.ascii());
+    if ( chpt[ pos ] == 'H' && chpt[ pos + 1 ] == 'O' ) {
+        pos += 5;
+        startpos = pos;
+        while ( chpt[ pos ] != ' ' && pos++ < length );
+        resdat.host = rawStr.mid( startpos, pos - startpos );
+        pos++;
+        //     qDebug("host %s", resdat.host.ascii());
     }
 }
 
@@ -940,7 +939,7 @@ void Kita::parseDateId( const QString& rawStr, RESDAT& resdat )
 /* output :
    
    resdat.bodyHTML
-
 */
 void Kita::parseBody( const QString &rawStr, RESDAT& resdat )
 {
@@ -951,14 +950,14 @@ void Kita::parseBody( const QString &rawStr, RESDAT& resdat )
     bool showAA = KitaConfig::showAA();
     resdat.bodyHTML = "<div>";
 #endif
-    
+
     unsigned int startPos, pos;
     QString linkstr, linkurl;
     const QChar *chpt = rawStr.unicode();
     unsigned int length = rawStr.length();
 
     bool ancChain = FALSE;
-    
+
     /* ancChain is chain for anchor. For examle, if anchor "&gt;2"
        appeared, ancChain is set to TRUE. Moreover, if next strings
        are "=5", anchor for 5 is also set. Thus, we can obtain anchors
@@ -968,7 +967,7 @@ void Kita::parseBody( const QString &rawStr, RESDAT& resdat )
     */
 
     int offset = 0;
-    if( chpt[ 0 ] == ' ' ) offset = 1; /* remove one space after <> */    
+    if ( chpt[ 0 ] == ' ' ) offset = 1; /* remove one space after <> */
     for ( unsigned int i = startPos = offset ; i < length ; i++ ) {
 
         switch ( chpt[ i ].unicode() ) {
@@ -978,20 +977,20 @@ void Kita::parseBody( const QString &rawStr, RESDAT& resdat )
             /* " <br> " */
             if ( chpt[ i + 1 ] == 'b' && chpt[ i + 2 ] == 'r' && chpt[ i + 3 ] == '>' ) {
 
-               /* reset anchor chain */
+                /* reset anchor chain */
                 ancChain = FALSE;
 
                 unsigned int i2 = i - startPos;
                 if ( i > 0 && chpt[ i - 1 ] == ' ' ) i2--; /* remove space before <br> */
                 resdat.bodyHTML += rawStr.mid( startPos, i2 );
 
-               resdat.bodyHTML += "<br>";
-               
+                resdat.bodyHTML += "<br>";
+
 #if KDE_IS_VERSION( 3, 2, 0 )
 #else
-               /* show Ascii Art (for KDE3.1*) */
-               if ( showAA ) resdat.bodyHTML += "<span style=\"color: white\">_</span>";
-#endif         
+                /* show Ascii Art (for KDE3.1*) */
+                if ( showAA ) resdat.bodyHTML += "<span style=\"color: white\">_</span>";
+#endif
 
                 startPos = i + 4;
                 if ( chpt[ startPos ] == ' ' ) startPos++; /* remove space after <br> */
@@ -1002,8 +1001,8 @@ void Kita::parseBody( const QString &rawStr, RESDAT& resdat )
 
             /* remove HTML tags <[^>]*>  */
             else {
-               
-                if( i - startPos ) resdat.bodyHTML += rawStr.mid( startPos, i - startPos );
+
+                if ( i - startPos ) resdat.bodyHTML += rawStr.mid( startPos, i - startPos );
                 while ( chpt[ i ] != '>' && i < length ) i++;
                 startPos = i + 1;
             }
@@ -1012,15 +1011,15 @@ void Kita::parseBody( const QString &rawStr, RESDAT& resdat )
 
             /*----------------------------------------*/
 
-        case 'h':    /* "http://" or "ttp://" or "tp:" */
+        case 'h':     /* "http://" or "ttp://" or "tp:" */
         case 't':
 
             if ( parseLink( chpt + i, length - i, linkstr, linkurl, pos ) ) {
 
                 resdat.bodyHTML += rawStr.mid( startPos, i - startPos );
-               resdat.bodyHTML += "<a href=\"" + linkurl + "\">";
-               resdat.bodyHTML += linkstr;
-               resdat.bodyHTML += "</a>";
+                resdat.bodyHTML += "<a href=\"" + linkurl + "\">";
+                resdat.bodyHTML += linkstr;
+                resdat.bodyHTML += "</a>";
 
                 startPos = i + pos;
                 i = startPos - 1;
@@ -1042,14 +1041,14 @@ void Kita::parseBody( const QString &rawStr, RESDAT& resdat )
 
             /* unicode '>'  */
         case UTF16_BRACKET:
-           
+
             ancChain = createResAnchor( rawStr, resdat, chpt, i, startPos );
             break;
 
             /*----------------------------------*/
 
         default:
-           
+
             if ( ancChain ) ancChain = createResAnchor( rawStr, resdat, chpt, i, startPos );
         }
     }
@@ -1147,7 +1146,7 @@ bool Kita::parseResAnchor(
             if ( c == '-'
                     || ( c >= 0x2010 && c <= 0x2015 )
                     || ( c == 0x2212 )
-                    || ( c == 0xFF0D )         /* UTF8: 0xEFBC8D */
+                    || ( c == 0xFF0D )          /* UTF8: 0xEFBC8D */
                ) {
                 return TRUE;
             }
@@ -1231,9 +1230,9 @@ bool Kita::parseResAnchor(
 
 /* create res anchor  */
 /* This function is called from parseBody internally.
-   See also parseBody.                                */   
+   See also parseBody.                                */
 bool Kita::createResAnchor( const QString &rawStr, RESDAT& resdat,
-                           const QChar *chpt, unsigned int &i, unsigned int &startPos )
+                            const QChar *chpt, unsigned int &i, unsigned int &startPos )
 {
     QString linkstr, linkurl;
     int refNum[ 2 ];
@@ -1242,7 +1241,7 @@ bool Kita::createResAnchor( const QString &rawStr, RESDAT& resdat,
 
     /* parse anchor */
     if ( !parseResAnchor( chpt + i, length - i, linkstr, refNum, pos ) ) {
-       
+
         i += pos - 1;
         return FALSE;
     }
@@ -1262,7 +1261,7 @@ bool Kita::createResAnchor( const QString &rawStr, RESDAT& resdat,
     anctmp.from = refNum[ 0 ];
     anctmp.to = refNum[ 1 ];
     resdat.anclist += anctmp;
-    
+
     startPos = i + pos;
     i = startPos - 1;
 
@@ -1273,18 +1272,18 @@ bool Kita::createResAnchor( const QString &rawStr, RESDAT& resdat,
 /* create HTML of title.
   
   struct RESDAT resdat should be parsed by parseResDat before  calling this function.
-
   output: titleHTML
   
 */
 void Kita::createTitleHTML( RESDAT& resdat, QString& titleHTML )
 {
     titleHTML = QString::null;
-    if ( !resdat.parsed ) return
+    if ( !resdat.parsed ) return ;
 
     bool showMailAddress = KitaConfig::showMailAddress();
     bool useTableTag = KitaConfig::useStyleSheet();
-    
+
     if ( m_colonstr == QString::null ) {
         m_colonstr = utf8ToUnicode( KITAUTF8_COLON );
         m_colonnamestr = utf8ToUnicode( KITAUTF8_NAME );
@@ -1295,65 +1294,65 @@ void Kita::createTitleHTML( RESDAT& resdat, QString& titleHTML )
     /* For KDE3.1    */
     useTableTag = TRUE;
 #endif
-    
-    if( useTableTag ) titleHTML += "<table class=\"res_title\"><tr>";
-    
+
+    if ( useTableTag ) titleHTML += "<table class=\"res_title\"><tr>";
+
     /* res number */
-    if( useTableTag ) titleHTML += "<td class=\"res_title_number\">";
+    if ( useTableTag ) titleHTML += "<td class=\"res_title_number\">";
     titleHTML += "<a href=\"#write" + QString().setNum( resdat.num ) + "\">";
     titleHTML += QString().setNum( resdat.num );
     titleHTML += "</a> ";
 
-    
+
     /* name & mail address */
-    if( useTableTag ) titleHTML += "<td class=\"res_title_name\">";
+    if ( useTableTag ) titleHTML += "<td class=\"res_title_name\">";
     titleHTML += "<b>" + m_colonnamestr;
 
     /* show name with mail address */
-    if ( showMailAddress ){
-       
-       titleHTML += resdat.nameHTML;
-       if ( resdat.address != QString::null ) titleHTML += " [" + resdat.address + "]";
+    if ( showMailAddress ) {
+
+        titleHTML += resdat.nameHTML;
+        if ( resdat.address != QString::null ) titleHTML += " [" + resdat.address + "]";
 
     } else { /* don't show mail address */
 
-       if( resdat.address == QString::null ){
-           
-           titleHTML += "<span class=\"name_noaddr\">";
-           titleHTML += resdat.name;
-           titleHTML += "</span>";
-           
-       } else{
-       
-           titleHTML += "<a href=\"mailto:" + resdat.address + "\"";
-           titleHTML += " title=\"" + resdat.address + "\">";
-           titleHTML += resdat.name;
-           titleHTML += "</a>";
-       }
+        if ( resdat.address == QString::null ) {
+
+            titleHTML += "<span class=\"name_noaddr\">";
+            titleHTML += resdat.name;
+            titleHTML += "</span>";
+
+        } else {
+
+            titleHTML += "<a href=\"mailto:" + resdat.address + "\"";
+            titleHTML += " title=\"" + resdat.address + "\">";
+            titleHTML += resdat.name;
+            titleHTML += "</a>";
+        }
     }
 
     titleHTML += "</b> ";
 
     /* date */
-    if( useTableTag ) titleHTML += "<td class=\"res_title_date\">";
+    if ( useTableTag ) titleHTML += "<td class=\"res_title_date\">";
     titleHTML += m_colonstr + resdat.date + " ";
 
     /* ID */
     if ( resdat.id != QString::null ) {
 
-       if( useTableTag ) titleHTML += "<td class=\"res_title_id\">";
+        if ( useTableTag ) titleHTML += "<td class=\"res_title_id\">";
         if ( resdat.id == "???" ) titleHTML += "ID:" + resdat.id;
         else titleHTML += "<a href=\"#idpop" + resdat.id + "\">ID</a>" + ":" + resdat.id;
     }
 
     /* host */
-    if( resdat.host != QString::null ){
+    if ( resdat.host != QString::null ) {
 
-       if( useTableTag ) titleHTML += "<td class=\"res_title_host\">";
-       titleHTML += "HOST:" + resdat.host;
+        if ( useTableTag ) titleHTML += "<td class=\"res_title_host\">";
+        titleHTML += "HOST:" + resdat.host;
     }
 
-    if( useTableTag ) titleHTML += "</tr></table>";
+    if ( useTableTag ) titleHTML += "</tr></table>";
 }
 
 
@@ -1362,5 +1361,5 @@ void Kita::createTitleHTML( RESDAT& resdat, QString& titleHTML )
 /*--------------------------------*/
 /* obsolete */
 
-QString Kita::datToBoard( const KURL& datURL ){ return BoardManager::boardURL( datURL ); } 
+QString Kita::datToBoard( const KURL& datURL ) { return BoardManager::boardURL( datURL ); }
 int Kita::boardType( const KURL& url ) { return BoardManager::type( url ); }
index f0b260b..aa57dbf 100644 (file)
@@ -33,19 +33,19 @@ namespace Kita
      * @author Hideki Ikemoto
      */
 
-    /*------------------------------*/    
+    /*------------------------------*/
     /* text codecs */
     QString qcpToUnicode( const QString& str );
     QString utf8ToUnicode( const QString& str );
     QString ecuToUnicode( const QString& str );
 
-    
+
     /*------------------------------*/
     /* conversion of DAT  */
     QString DatToHtml( const QString& rawData, int num );
     void DatToText( const QString &rawData, QString& text );
     QString parseSpecialChar( const QChar *cdat, unsigned int& pos );
-    
+
 
     /*------------------------------*/
     /* conversion of URL */
@@ -58,25 +58,25 @@ namespace Kita
     QString convertURL( int mode, const KURL& url , QString& refstr );
 
     QString datToOfflaw( const KURL& datURL );
-    
-    
-    /*------------------------------*/    
+
+
+    /*------------------------------*/
     /* utilities */
     bool mkdir( const QString& path );
     QString unescape( const QString& str );
     uint datToSince( const KURL& datURL );
     int isEqual( const QChar *cdat, const QString& str );
     int stringToPositiveNum( const QChar *cdat, const unsigned int length );
-    
+
 
     /*------------------------------*/
     /* internal parsing funtions */
 
-    
+
     /* for MACHI BBS */
     void InitParseMachiBBS();
     QString ParseMachiBBSOneLine( const QString& inputLine, int& nextNum );
-    
+
     /* for JBBS */
     QString ParseJBBSOneLine( const QString& line, int& nextNum );
 
@@ -84,24 +84,24 @@ namespace Kita
     /* for Flash CGI/Mini Thread */
     QString ParseFlashCGIOneLine( const QString& line );
 
-    
+
     /* for 2ch */
     bool parseResDat( RESDAT& resdat, QString& subject );
-    
-    void parseName( const QString& rawStr, RESDAT& resdat );    
+
+    void parseName( const QString& rawStr, RESDAT& resdat );
     void parseDateId( const QString& rawStr, RESDAT& resdat );
     void parseBody( const QString &rawStr, RESDAT& resdat );
 
     bool parseLink( const QChar *cdat, const unsigned int length,
-                          QString& linkstr, QString& linkurl, unsigned int& pos );
+                    QString& linkstr, QString& linkurl, unsigned int& pos );
     bool parseResAnchor( const QChar *cdat, const unsigned int length,
-                               QString& linkstr, int* refNum, unsigned int& pos );
+                         QString& linkstr, int* refNum, unsigned int& pos );
     bool createResAnchor( const QString &rawStr, RESDAT& resdat,
-                         const QChar *chpt, unsigned int &i, unsigned int &index );
+                          const QChar *chpt, unsigned int &i, unsigned int &index );
+
+    void createTitleHTML( RESDAT& resdat, QString& titletext );
 
-    void createTitleHTML( RESDAT& resdat, QString& titletext );    
 
-    
     /*--------------------------------*/
     /* obsolete */
     QString datToBoard( const KURL& datURL );
index 68cf7fe..425ef71 100644 (file)
@@ -218,14 +218,14 @@ QString KitaConfig::defaultStyleSheetText()
                "a.coloredLink:link\n"
                "{\n"
                " color: magenta;"
-               "}\n"               
-              
+               "}\n"
+
                "div.res_title,\n"
                "div.pop_res_title {\n"
                "  white-space: nowrap;\n"
                "  padding-bottom: .2em;\n"
                "}\n"
-              
+
                "span.name_noaddr {\n"
                "  color: green;\n"
                "}\n"
@@ -235,7 +235,7 @@ QString KitaConfig::defaultStyleSheetText()
                "  margin-left: 3.5em;\n"
                "  padding-bottom: 1.8em;\n"
                "}\n"
-              
+
                "div.kokoyon {\n"
                "  background-color: #CCCCCC;\n"
                "  text-align: center;\n"
index 10530d0..ffec1e9 100644 (file)
@@ -138,7 +138,7 @@ public:
     static bool aboneChain() { return getInstance() ->m_aboneChain; }
     static void setAboneChain( bool value ) { getInstance() ->m_aboneChain = value; }
     static bool defaultAboneChain() { return false; }
-    
+
     static QStringList& aboneWordList() { return getInstance() ->m_aboneWordList; }
     static void setAboneWordList( QStringList list ) { getInstance() ->m_aboneWordList = list; }
     static void addAboneWord( QString word ) { getInstance() ->m_aboneWordList.append( word ); }
index 1f9c891..32e5011 100644 (file)
@@ -23,17 +23,21 @@ namespace Kita
     class ParseMisc
     {
     public:
-       static KURL parseURL( const KURL& url , QString& refstr ){
-           return Kita::getDatURL( url , refstr ); }
-
-       static KURL parseURLonly( const KURL& url ){ return Kita::getDatURL( url ); }
-       
-       static QString qcpToUnicode( const QString& str ){ return Kita::qcpToUnicode( str ); }
-       
-       static QString utf8ToUnicode( const QString& str ){ return Kita::utf8ToUnicode( str ); }
-       
-       static int stringToPositiveNum( const QChar *cdat, const unsigned int length ){
-           return Kita::stringToPositiveNum( cdat, length ); }
+        static KURL parseURL( const KURL& url , QString& refstr )
+        {
+            return Kita::getDatURL( url , refstr );
+        }
+
+        static KURL parseURLonly( const KURL& url ) { return Kita::getDatURL( url ); }
+
+        static QString qcpToUnicode( const QString& str ) { return Kita::qcpToUnicode( str ); }
+
+        static QString utf8ToUnicode( const QString& str ) { return Kita::utf8ToUnicode( str ); }
+
+        static int stringToPositiveNum( const QChar *cdat, const unsigned int length )
+        {
+            return Kita::stringToPositiveNum( cdat, length );
+        }
     };
 
 }
index 5459d76..421691b 100644 (file)
@@ -227,14 +227,14 @@ bool QCp932Codec::canEncode(const QString& s) const
 // FIXME: implement
 int QCp932Codec::heuristicContentMatch( const char*, int ) const
 {
-//    kdWarning( 7743 ) << "XXX heuristicContentMatch" << endl;
+    //    kdWarning( 7743 ) << "XXX heuristicContentMatch" << endl;
     return 0;
 }
 
 // FIXME: implement
 int QCp932Codec::heuristicNameMatch( const char * hint ) const
 {
-//    kdWarning( 7743 ) << "XXX heuristicNameMatch hint = " << hint << endl;
+    //    kdWarning( 7743 ) << "XXX heuristicNameMatch hint = " << hint << endl;
     return 0;
 }
 
index 9adcef6..5f219e4 100644 (file)
@@ -1,26 +1,26 @@
 /***************************************************************************
- *   Copyright (C) 2003 by Hideki Ikemoto                                  *
- *   ikemo@wakaba.jp                                                       *
- *                                                                         *
- *   Permission is hereby granted, free of charge, to any person obtaining *
- *   a copy of this software and associated documentation files (the       *
- *   "Software"), to deal in the Software without restriction, including   *
- *   without limitation the rights to use, copy, modify, merge, publish,   *
- *   distribute, sublicense, and/or sell copies of the Software, and to    *
- *   permit persons to whom the Software is furnished to do so, subject to *
- *   the following conditions:                                             *
- *                                                                         *
- *   The above copyright notice and this permission notice shall be        *
- *   included in all copies or substantial portions of the Software.       *
- *                                                                         *
- *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       *
- *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    *
- *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*
- *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR     *
- *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
- *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
- *   OTHER DEALINGS IN THE SOFTWARE.                                       *
- ***************************************************************************/
+*   Copyright (C) 2003 by Hideki Ikemoto                                  *
+*   ikemo@wakaba.jp                                                       *
+*                                                                         *
+*   Permission is hereby granted, free of charge, to any person obtaining *
+*   a copy of this software and associated documentation files (the       *
+*   "Software"), to deal in the Software without restriction, including   *
+*   without limitation the rights to use, copy, modify, merge, publish,   *
+*   distribute, sublicense, and/or sell copies of the Software, and to    *
+*   permit persons to whom the Software is furnished to do so, subject to *
+*   the following conditions:                                             *
+*                                                                         *
+*   The above copyright notice and this permission notice shall be        *
+*   included in all copies or substantial portions of the Software.       *
+*                                                                         *
+*   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       *
+*   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    *
+*   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*
+*   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR     *
+*   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
+*   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
+*   OTHER DEALINGS IN THE SOFTWARE.                                       *
+***************************************************************************/
 
 #ifndef _QCP932CODEC_H_
 #define _QCP932CODEC_H_
@@ -35,33 +35,33 @@ class QJpUnicodeConv;
 class QCp932Codec : public QTextCodec
 {
 private:
-  QJpUnicodeConv* conv;
+    QJpUnicodeConv* conv;
 public:
-  QCp932Codec();
-  ~QCp932Codec();
-  virtual const char * name() const;
-  virtual const char * mimeName() const;
-  virtual int mibEnum() const;
-  virtual QTextDecoder* makeDecoder() const;
-//  virtual QTextEncoder* makeEncoder() const;
-//  virtual QString toUnicode(const char* chars, int len) const;
-//  using QTextCodec::fromUnicode;
-  virtual QCString fromUnicode(const QString& uc, int& lenInOut) const;
-//  virtual bool canEncode(QChar ch) const;
-//  virtual bool canEncode(const QString& s) const;
-  virtual int heuristicContentMatch(const char* chars, int len) const;
-  virtual int heuristicNameMatch(const char * hint) const;
+    QCp932Codec();
+    ~QCp932Codec();
+    virtual const char * name() const;
+    virtual const char * mimeName() const;
+    virtual int mibEnum() const;
+    virtual QTextDecoder* makeDecoder() const;
+    //  virtual QTextEncoder* makeEncoder() const;
+    //  virtual QString toUnicode(const char* chars, int len) const;
+    //  using QTextCodec::fromUnicode;
+    virtual QCString fromUnicode( const QString& uc, int& lenInOut ) const;
+    //  virtual bool canEncode(QChar ch) const;
+    //  virtual bool canEncode(const QString& s) const;
+    virtual int heuristicContentMatch( const char* chars, int len ) const;
+    virtual int heuristicNameMatch( const char * hint ) const;
 };
 
 class QCp932Decoder : public QTextDecoder
 {
 private:
-  QJpUnicodeConv* conv;
+    QJpUnicodeConv* conv;
 
 public:
-  QCp932Decoder(QJpUnicodeConv* _conv);
-  ~QCp932Decoder();
-  virtual QString toUnicode(const char* chars, int len);
+    QCp932Decoder( QJpUnicodeConv* _conv );
+    ~QCp932Decoder();
+    virtual QString toUnicode( const char* chars, int len );
 };
 
 #endif
index b33b000..37afdc9 100644 (file)
@@ -1,12 +1,12 @@
 /***************************************************************************
- *   Copyright (C) 2004 by Kita Developers                                 *
- *   ikemo@users.sourceforge.jp                                            *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2004 by Kita Developers                                 *
+*   ikemo@users.sourceforge.jp                                            *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 #include "signalcollection.h"
 
 using namespace Kita;
index b0b6d87..0d6c8c4 100644 (file)
@@ -119,7 +119,7 @@ namespace Kita
 
         /* to : KitaWriteDock */
         void showWriteView( const KURL& , const QString& );
-        void createNewThread( const KURL& , const QString&, const QString& );  
+        void createNewThread( const KURL& , const QString&, const QString& );
         void switchToWritedock();
     };
 
index 67d785c..615eaf5 100644 (file)
@@ -1,12 +1,12 @@
 /***************************************************************************
- *   Copyright (C) 2003 by Hideki Ikemoto                                  *
- *   ikemo@wakaba.jp                                                       *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2003 by Hideki Ikemoto                                  *
+*   ikemo@wakaba.jp                                                       *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 #include "boardtest.h"
 
 using namespace Kita;
@@ -19,8 +19,7 @@ void BoardTest::setUp()
 }
 
 void BoardTest::tearDown()
-{
-}
+{}
 
 void BoardTest::testID()
 {
@@ -38,7 +37,7 @@ void BoardTest::testStaticName()
 void BoardTest::testReplace()
 {
     Kita::Board::replace( QString( "http://pc.2ch.net/linux/" ), QString( "http://pc3.2ch.net/linux/" ) );
-    
+
     CPPUNIT_ASSERT_EQUAL( QString( "linux" ), Kita::Board::getID( "http://pc3.2ch.net/linux/" ) );
     CPPUNIT_ASSERT_EQUAL( QString( "Linux" ), Kita::Board::getName( "http://pc3.2ch.net/linux/" ) );
 }
index c938bf7..ca0ebb7 100644 (file)
@@ -1,12 +1,12 @@
 /***************************************************************************
- *   Copyright (C) 2003 by Hideki Ikemoto                                  *
- *   ikemo@wakaba.jp                                                       *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2003 by Hideki Ikemoto                                  *
+*   ikemo@wakaba.jp                                                       *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 #ifndef BOARDTEST_H
 #define BOARDTEST_H
 
@@ -16,7 +16,8 @@
 /**
 @author Hideki Ikemoto
 */
-class BoardTest : public CppUnit::TestFixture {
+class BoardTest : public CppUnit::TestFixture
+{
     CPPUNIT_TEST_SUITE( BoardTest );
     CPPUNIT_TEST( testID );
     CPPUNIT_TEST( testStaticName );
index fe5d1a9..c400d40 100644 (file)
@@ -12,9 +12,7 @@
 using namespace Kita;
 
 void CacheTest::setUp()
-{
-}
+{}
 
 void CacheTest::tearDown()
-{
-}
+{}
index 41e3088..dcc85e0 100644 (file)
@@ -76,7 +76,7 @@ void FavoriteThreadsTest::testThreads()
     CPPUNIT_ASSERT_EQUAL( QString( "http://pc.2ch.net/linux/" ), thread2->boardURL() );
     CPPUNIT_ASSERT_EQUAL( QString( "Linux" ), thread2->boardName() );
     CPPUNIT_ASSERT_EQUAL( QString( "linux" ), thread2->boardID() );
-    
+
     Kita::Thread* thread3 = Kita::Thread::getByURL( threadList[ 2 ] );
     CPPUNIT_ASSERT_EQUAL( QString( "2ch browser thread" ), thread3->name() );
     CPPUNIT_ASSERT_EQUAL( 20, thread3->resNum() );
@@ -109,7 +109,7 @@ void FavoriteThreadsTest::testReplace()
     CPPUNIT_ASSERT_EQUAL( QString( "http://pc.2ch.net/linux/" ), thread2->boardURL() );
     CPPUNIT_ASSERT_EQUAL( QString( "Linux" ), thread2->boardName() );
     CPPUNIT_ASSERT_EQUAL( QString( "linux" ), thread2->boardID() );
-    
+
     Kita::Thread* thread3 = Kita::Thread::getByURL( threadList[ 2 ] );
     CPPUNIT_ASSERT_EQUAL( QString( "2ch browser thread" ), thread3->name() );
     CPPUNIT_ASSERT_EQUAL( 20, thread3->resNum() );
index 3e4a43c..e328ee9 100644 (file)
@@ -1,80 +1,80 @@
 /***************************************************************************
- *   Copyright (C) 2003 by Hideki Ikemoto                                  *
- *   ikemo@wakaba.jp                                                       *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2003 by Hideki Ikemoto                                  *
+*   ikemo@wakaba.jp                                                       *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 #include "k2ch_articlefiletest.h"
 #include "../k2ch_articlefile.h"
 #include <cppunit/TestCaller.h>
 
 void K2chArticleFileTest::setUp()
 {
-  m_empty = new K2chArticleFile();
-  m_empty->parse( "()" );
+    m_empty = new K2chArticleFile();
+    m_empty->parse( "()" );
 
-  m_one = new K2chArticleFile();
-  m_one->parse( "((\"1000000000\" :seen 100 :access-time (16122 26923 0)))" );
+    m_one = new K2chArticleFile();
+    m_one->parse( "((\"1000000000\" :seen 100 :access-time (16122 26923 0)))" );
 
-  m_many = new K2chArticleFile();
-  m_many->parse( "((\"1000000000\" :seen 100 :access-time (16122 26923 0))"
-                 "(\"999999999\" :seen -1 :access-time (16122 26778 0))"
-                 "(\"1234567890\" :seen 999 :access-time (16205 63250 0)))" );
+    m_many = new K2chArticleFile();
+    m_many->parse( "((\"1000000000\" :seen 100 :access-time (16122 26923 0))"
+                   "(\"999999999\" :seen -1 :access-time (16122 26778 0))"
+                   "(\"1234567890\" :seen 999 :access-time (16205 63250 0)))" );
 }
 
 void K2chArticleFileTest::tearDown()
 {
-  delete m_empty;
-  delete m_one;
-  delete m_many;
+    delete m_empty;
+    delete m_one;
+    delete m_many;
 }
 
 void K2chArticleFileTest::testCount()
 {
-  CPPUNIT_ASSERT_EQUAL( 0, m_empty->count() );
-  CPPUNIT_ASSERT_EQUAL( 1, m_one->count() );
-  CPPUNIT_ASSERT_EQUAL( 3, m_many->count() );
+    CPPUNIT_ASSERT_EQUAL( 0, m_empty->count() );
+    CPPUNIT_ASSERT_EQUAL( 1, m_one->count() );
+    CPPUNIT_ASSERT_EQUAL( 3, m_many->count() );
 }
 
 void K2chArticleFileTest::testName()
 {
-  CPPUNIT_ASSERT_EQUAL( QString( "1000000000" ), m_one->item( 0 ).name() );
+    CPPUNIT_ASSERT_EQUAL( QString( "1000000000" ), m_one->item( 0 ).name() );
 
-  CPPUNIT_ASSERT_EQUAL( QString( "1000000000" ), m_many->item( 0 ).name() );
-  CPPUNIT_ASSERT_EQUAL( QString( "999999999" ),  m_many->item( 1 ).name() );
-  CPPUNIT_ASSERT_EQUAL( QString( "1234567890" ), m_many->item( 2 ).name() );
+    CPPUNIT_ASSERT_EQUAL( QString( "1000000000" ), m_many->item( 0 ).name() );
+    CPPUNIT_ASSERT_EQUAL( QString( "999999999" ), m_many->item( 1 ).name() );
+    CPPUNIT_ASSERT_EQUAL( QString( "1234567890" ), m_many->item( 2 ).name() );
 }
 
 void K2chArticleFileTest::testSeen()
 {
-  CPPUNIT_ASSERT_EQUAL( 100, m_one->item( 0 ).seen() );
+    CPPUNIT_ASSERT_EQUAL( 100, m_one->item( 0 ).seen() );
 
-  CPPUNIT_ASSERT_EQUAL( 100, m_many->item( 0 ).seen() );
-  CPPUNIT_ASSERT_EQUAL(  -1, m_many->item( 1 ).seen() );
-  CPPUNIT_ASSERT_EQUAL( 999, m_many->item( 2 ).seen() );
+    CPPUNIT_ASSERT_EQUAL( 100, m_many->item( 0 ).seen() );
+    CPPUNIT_ASSERT_EQUAL( -1, m_many->item( 1 ).seen() );
+    CPPUNIT_ASSERT_EQUAL( 999, m_many->item( 2 ).seen() );
 }
 
 void K2chArticleFileTest::testAccessTime()
 {
-  CPPUNIT_ASSERT_EQUAL( (time_t)1056598315, m_one->item( 0 ).accessTime() );
+    CPPUNIT_ASSERT_EQUAL( ( time_t ) 1056598315, m_one->item( 0 ).accessTime() );
 
-  CPPUNIT_ASSERT_EQUAL( (time_t)1056598315, m_many->item( 0 ).accessTime() );
-  CPPUNIT_ASSERT_EQUAL( (time_t)1056598170, m_many->item( 1 ).accessTime() );
-  CPPUNIT_ASSERT_EQUAL( (time_t)1062074130, m_many->item( 2 ).accessTime() );
+    CPPUNIT_ASSERT_EQUAL( ( time_t ) 1056598315, m_many->item( 0 ).accessTime() );
+    CPPUNIT_ASSERT_EQUAL( ( time_t ) 1056598170, m_many->item( 1 ).accessTime() );
+    CPPUNIT_ASSERT_EQUAL( ( time_t ) 1062074130, m_many->item( 2 ).accessTime() );
 }
 
 void K2chArticleFileTest::testToString()
 {
-  CPPUNIT_ASSERT_EQUAL( QString( "()" ), m_empty->toString() );
+    CPPUNIT_ASSERT_EQUAL( QString( "()" ), m_empty->toString() );
 
-  CPPUNIT_ASSERT_EQUAL( QString( "((\"1000000000\" :seen 100 :access-time (16122 26923 0)))" ),
-                        m_one->toString() );
+    CPPUNIT_ASSERT_EQUAL( QString( "((\"1000000000\" :seen 100 :access-time (16122 26923 0)))" ),
+                          m_one->toString() );
 
-  CPPUNIT_ASSERT_EQUAL( QString( "((\"1000000000\" :seen 100 :access-time (16122 26923 0))"
-                                 "(\"999999999\" :seen -1 :access-time (16122 26778 0))"
-                                 "(\"1234567890\" :seen 999 :access-time (16205 63250 0)))" ),
-                        m_many->toString() );
+    CPPUNIT_ASSERT_EQUAL( QString( "((\"1000000000\" :seen 100 :access-time (16122 26923 0))"
+                                   "(\"999999999\" :seen -1 :access-time (16122 26778 0))"
+                                   "(\"1234567890\" :seen 999 :access-time (16205 63250 0)))" ),
+                          m_many->toString() );
 }
index 7b622aa..20aedf4 100644 (file)
@@ -1,12 +1,12 @@
 /***************************************************************************
- *   Copyright (C) 2003 by Hideki Ikemoto                                  *
- *   ikemo@wakaba.jp                                                       *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2003 by Hideki Ikemoto                                  *
+*   ikemo@wakaba.jp                                                       *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 #ifndef K2CH_ARTICLEFILETEST_H
 #define K2CH_ARTICLEFILETEST_H
 
@@ -19,25 +19,25 @@ class K2chArticleFile;
 */
 class K2chArticleFileTest : public CppUnit::TestFixture
 {
-  CPPUNIT_TEST_SUITE( K2chArticleFileTest );
-  CPPUNIT_TEST( testCount );
-  CPPUNIT_TEST( testName );
-  CPPUNIT_TEST( testSeen );
-  CPPUNIT_TEST( testAccessTime );
-  CPPUNIT_TEST( testToString );
-  CPPUNIT_TEST_SUITE_END();
+    CPPUNIT_TEST_SUITE( K2chArticleFileTest );
+    CPPUNIT_TEST( testCount );
+    CPPUNIT_TEST( testName );
+    CPPUNIT_TEST( testSeen );
+    CPPUNIT_TEST( testAccessTime );
+    CPPUNIT_TEST( testToString );
+    CPPUNIT_TEST_SUITE_END();
 
-  K2chArticleFile *m_empty, *m_one, *m_many;
+    K2chArticleFile *m_empty, *m_one, *m_many;
 
 public:
-  void setUp();
-  void tearDown();
+    void setUp();
+    void tearDown();
 
-  void testCount();
-  void testName();
-  void testSeen();
-  void testAccessTime();
-  void testToString();
+    void testCount();
+    void testName();
+    void testSeen();
+    void testAccessTime();
+    void testToString();
 };
 
 #endif
index 1c28201..fab9d5c 100644 (file)
@@ -1,12 +1,12 @@
 /***************************************************************************
- *   Copyright (C) 2003 by Hideki Ikemoto                                  *
- *   ikemo@wakaba.jp                                                       *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2003 by Hideki Ikemoto                                  *
+*   ikemo@wakaba.jp                                                       *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 
 #include <cppunit/ui/text/TestRunner.h>
 #include <cppunit/TextTestResult.h>
 
 int main( int argc, char* argv[] )
 {
-  CppUnit::TextUi::TestRunner runner;
+    CppUnit::TextUi::TestRunner runner;
 
-  runner.addTest( K2chArticleFileTest::suite() );
-  runner.addTest( URLConvertTest::suite() );
-  runner.addTest( ThreadTest::suite() );
-  runner.addTest( BoardTest::suite() );
-  runner.addTest( MiscTest::suite() );
-  runner.addTest( FavoriteThreadsTest::suite() );
-  runner.addTest( FavoriteBoardsTest::suite() );
-  runner.addTest( CacheTest::suite() );
-  runner.run( "" );
-  return 0;
+    runner.addTest( K2chArticleFileTest::suite() );
+    runner.addTest( URLConvertTest::suite() );
+    runner.addTest( ThreadTest::suite() );
+    runner.addTest( BoardTest::suite() );
+    runner.addTest( MiscTest::suite() );
+    runner.addTest( FavoriteThreadsTest::suite() );
+    runner.addTest( FavoriteBoardsTest::suite() );
+    runner.addTest( CacheTest::suite() );
+    runner.run( "" );
+    return 0;
 }
index 9d1a1cc..7153716 100644 (file)
@@ -1,12 +1,12 @@
 /***************************************************************************
- *   Copyright (C) 2003 by Hideki Ikemoto                                  *
- *   ikemo@wakaba.jp                                                       *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2003 by Hideki Ikemoto                                  *
+*   ikemo@wakaba.jp                                                       *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 #include "threadtest.h"
 #include "../board.h"
 
@@ -16,7 +16,7 @@ void ThreadTest::setUp()
 {
     Kita::Board::setName( "http://pc.2ch.net/linux/", "Linux" );
     Kita::Thread::setName( "http://pc.2ch.net/linux/dat/1069738960.dat",
-    "Kita - 2ch client for KDE" );
+                           "Kita - 2ch client for KDE" );
     m_normal = Kita::Thread::getByURL( "http://pc.2ch.net/linux/dat/1069738960.dat" );
 
     Kita::Board::setName( "http://pc.2ch.net/unix/", "Unix" );
@@ -24,18 +24,17 @@ void ThreadTest::setUp()
 }
 
 void ThreadTest::tearDown()
-{
-}
+{}
 
 void ThreadTest::testDatURL()
 {
-    CPPUNIT_ASSERT_EQUAL( QString( "http://pc.2ch.net/linux/dat/1069738960.dat"),
+    CPPUNIT_ASSERT_EQUAL( QString( "http://pc.2ch.net/linux/dat/1069738960.dat" ),
                           m_normal->datURL() );
 }
 
 void ThreadTest::testURL()
 {
-    CPPUNIT_ASSERT_EQUAL( QString( "http://pc.2ch.net/test/read.cgi/linux/1069738960/"),
+    CPPUNIT_ASSERT_EQUAL( QString( "http://pc.2ch.net/test/read.cgi/linux/1069738960/" ),
                           m_normal->url() );
 }
 
@@ -75,10 +74,10 @@ void ThreadTest::testReplace()
     Kita::Thread::replace( QString( "http://pc.2ch.net/unix/" ),
                            QString( "http://pc3.2ch.net/unix/" ) );
     Kita::Thread* unix = Kita::Thread::getByURL( "http://pc3.2ch.net/unix/dat/1069738960.dat" );
-    
-    CPPUNIT_ASSERT_EQUAL( QString( "http://pc3.2ch.net/unix/dat/1069738960.dat"),
+
+    CPPUNIT_ASSERT_EQUAL( QString( "http://pc3.2ch.net/unix/dat/1069738960.dat" ),
                           unix->datURL() );
-    CPPUNIT_ASSERT_EQUAL( QString( "http://pc3.2ch.net/test/read.cgi/unix/1069738960/"),
+    CPPUNIT_ASSERT_EQUAL( QString( "http://pc3.2ch.net/test/read.cgi/unix/1069738960/" ),
                           unix->url() );
     CPPUNIT_ASSERT_EQUAL( QString( "1069738960" ), unix->datID() );
     CPPUNIT_ASSERT_EQUAL( 0, unix->resNum() );
index 1e7758a..1d1ed29 100644 (file)
@@ -1,12 +1,12 @@
 /***************************************************************************
- *   Copyright (C) 2003 by Hideki Ikemoto                                  *
- *   ikemo@wakaba.jp                                                       *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2003 by Hideki Ikemoto                                  *
+*   ikemo@wakaba.jp                                                       *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 #ifndef THREADTEST_H
 #define THREADTEST_H
 
@@ -16,7 +16,8 @@
 /**
 @author Hideki Ikemoto
 */
-class ThreadTest : public CppUnit::TestFixture {
+class ThreadTest : public CppUnit::TestFixture
+{
     CPPUNIT_TEST_SUITE( ThreadTest );
     CPPUNIT_TEST( testDatURL );
     CPPUNIT_TEST( testURL );
index 7bb45cd..b6db224 100644 (file)
@@ -27,9 +27,9 @@ void URLConvertTest::setUp()
 
     // FIXME: invalid dat url.
     m_machibbsDatURL = "http://kanto.machi.to/kana/dat/1234567890.cgi";
-    
+
     m_machibbsThreadURL = "http://kanto.machi.to/bbs/read.pl?BBS=kana&KEY=1234567890";
-    
+
     // relative path.
     m_cachePath = QString( "pc.2ch.net/linux/1022744633.dat" );
 }
index 53b8d7f..30025ab 100644 (file)
@@ -43,7 +43,7 @@ class URLConvertTest : public CppUnit::TestFixture
     QString m_boardURL2_k2ch;
     QString m_cachePath;
     QString m_cachePath_k2ch;
-    
+
     QString m_machibbsDatURL;
     QString m_machibbsThreadURL;
 
index cc39bc8..5c2fc5d 100644 (file)
@@ -18,7 +18,7 @@ using namespace Kita;
 QDict<Thread>* Thread::m_threadDict = 0;
 
 Thread::Thread( const KURL& datURL )
-    : m_datURL( datURL ), m_threadName( 0 ) , m_resNum( 0 ), m_readNum( 0 ), m_viewPos( 0 ), m_isOpened( 0 )
+        : m_datURL( datURL ), m_threadName( 0 ) , m_resNum( 0 ), m_readNum( 0 ), m_viewPos( 0 ), m_isOpened( 0 )
 {}
 
 Thread::~Thread()
@@ -39,12 +39,12 @@ const QString& Thread::threadName() const
 void Thread::setThreadName( QString threadName )
 {
     /* remove space */
-    QRegExp qrx(" +$");    
+    QRegExp qrx( " +$" );
     threadName.replace( qrx, "" );
 
     /* unescape */
     threadName.replace( "&lt;", "<" ).replace( "&gt;", ">" ).replace( "&amp;", "&" );
-    
+
     m_threadName = threadName;
 }
 
@@ -115,7 +115,7 @@ bool Thread::isMarked( int num )
 {
     QValueList< int >::iterator it;
     for ( it = m_markList.begin(); it != m_markList.end(); ++it ) {
-        if( ( *it ) == num ) return TRUE;
+        if ( ( *it ) == num ) return TRUE;
     }
 
     return FALSE;
@@ -125,9 +125,9 @@ bool Thread::isMarked( int num )
 bool Thread::setMark( int num, bool newStatus )
 {
     bool status = isMarked( num );
-    if( status == newStatus ) return FALSE;
+    if ( status == newStatus ) return FALSE;
 
-    if( newStatus ) m_markList += num;
+    if ( newStatus ) m_markList += num;
     else m_markList.remove( num );
 
     return TRUE;
@@ -163,9 +163,9 @@ Thread* Thread::getByURLNew( const KURL& datURL )
 
 void Thread::replace( const QString& fromURL, const QString& toURL )
 {
-    if( m_threadDict == NULL ) return;
+    if ( m_threadDict == NULL ) return ;
     QDictIterator<Kita::Thread> it( *m_threadDict );
-    for( ; it.current(); ++it ) {
+    for ( ; it.current(); ++it ) {
         QString url = it.currentKey();
         Kita::Thread* thread = it.current();
         if ( url.find( fromURL ) == 0 ) {
index 82e691a..4c61f2c 100644 (file)
@@ -26,10 +26,10 @@ namespace Kita
 
         KURL m_datURL;
         QString m_threadName;
-       int m_resNum;
-       int m_readNum;
-       int m_viewPos;
-       bool m_isOpened;
+        int m_resNum;
+        int m_readNum;
+        int m_viewPos;
+        bool m_isOpened;
         QValueList< int > m_markList;
 
     public:
@@ -37,29 +37,29 @@ namespace Kita
         ~Thread();
 
         const KURL& datURL() const;
-       
+
         const QString& threadName() const;
-       void setThreadName( QString threadName );
+        void setThreadName( QString threadName );
+
+        const int resNum() const;
+        void setResNum( int num );
 
-       const int resNum() const;
-       void setResNum( int num );
+        const int readNum() const;
+        void setReadNum( int num );
 
-       const int readNum() const;
-       void setReadNum( int num );
-       
-       const int viewPos() const;
-       void setViewPos( int viewPos );
+        const int viewPos() const;
+        void setViewPos( int viewPos );
 
-       bool isOpened() const;
-       void setIsOpened( bool isOpend );
+        bool isOpened() const;
+        void setIsOpened( bool isOpend );
 
         const QValueList< int >& markList() const;
         void setMarkList( const QValueList< int >& markList );
         bool isMarked( int num );
         bool setMark( int num, bool newStatus );
-       
-       /*----------------------*/
-       
+
+        /*----------------------*/
+
         static Thread* getByURL( const KURL& datURL );
         static Thread* getByURLNew( const KURL& datURL );
         static void replace( const QString& fromURL, const QString& toURL );
index 2e3063c..c66e7af 100644 (file)
@@ -96,16 +96,16 @@ void ThreadIndex::loadIndex( Kita::Thread* thread, const KURL& url, bool checkCa
 
     /* load read number */
     int readNum = getReadNumPrivate( url, config, checkCached );
-    if( readNum == 0 ) return;  /* cache does not exist. */
+    if ( readNum == 0 ) return ;  /* cache does not exist. */
     thread->setReadNum( readNum );
-   
+
     /* load thread name */
     QString subject = getSubjectPrivate( config );
-    if( subject == QString::null && thread->threadName() != QString::null ){
-       subject = thread->threadName();
-       config.writeEntry( "Subject", subject );
+    if ( subject == QString::null && thread->threadName() != QString::null ) {
+        subject = thread->threadName();
+        config.writeEntry( "Subject", subject );
     }
-    if( subject == QString::null ) thread->setThreadName( "?" );
+    if ( subject == QString::null ) thread->setThreadName( "?" );
     else thread->setThreadName( subject );
 
     /* load res number */
@@ -113,7 +113,7 @@ void ThreadIndex::loadIndex( Kita::Thread* thread, const KURL& url, bool checkCa
 
     /* load view pos */
     thread->setViewPos( getViewPosPrivate( config ) );
-    if( thread->viewPos() > thread->readNum() ) thread->setReadNum( thread->viewPos() );
+    if ( thread->viewPos() > thread->readNum() ) thread->setReadNum( thread->viewPos() );
 
     /* load mark */
     thread->setMarkList( getMarkListPrivate( config ) );
@@ -125,19 +125,19 @@ void ThreadIndex::loadIndex( Kita::Thread* thread, const KURL& url, bool checkCa
 void ThreadIndex::saveIndex( const Kita::Thread* thread, const KURL& url )
 {
     /* If readNum == 0, delete idx file */
-    if( thread->readNum() == 0 ){
-       
-       QString indexPath = Kita::DatManager::getCacheIndexPath( url );
-       QFile::remove( indexPath );
-       qDebug("delete %s",indexPath.ascii());
+    if ( thread->readNum() == 0 ) {
+
+        QString indexPath = Kita::DatManager::getCacheIndexPath( url );
+        QFile::remove( indexPath );
+        qDebug( "delete %s", indexPath.ascii() );
     }
 
     QString indexPath = Kita::Cache::getIndexPath( url );
     KConfig config( indexPath );
-       
+
     /* save thread name */
     setSubjectPrivate( thread->threadName(), config );
-       
+
     /* save res number */
     setResNumPrivate( thread->resNum(), config );
 
@@ -149,7 +149,7 @@ void ThreadIndex::saveIndex( const Kita::Thread* thread, const KURL& url )
 
     /* save mark */
     setMarkListPrivate( thread->markList(), config );
-    
+
     /* save "cache" */
     KURL datURL = Kita::getDatURL( url );
     int num = ( thread->viewPos() ? thread->viewPos() : thread->readNum() );
@@ -178,12 +178,12 @@ void ThreadIndex::setSubjectPrivate( const QString& str, KConfig& config )
 int ThreadIndex::getResNumPrivate( const KURL& url, KConfig& config )
 {
     int resNum = config.readNumEntry( "ResNum" );
-    
+
     /* use obsoleted "cache" file */
-    if( !resNum ){
-       KURL datURL = Kita::getDatURL( url );
-       resNum = KitaThreadInfo::readNum( datURL.prettyURL() );
-       if( resNum ) config.writeEntry( "ResNum", resNum );
+    if ( !resNum ) {
+        KURL datURL = Kita::getDatURL( url );
+        resNum = KitaThreadInfo::readNum( datURL.prettyURL() );
+        if ( resNum ) config.writeEntry( "ResNum", resNum );
     }
 
     return resNum;
@@ -201,29 +201,29 @@ void ThreadIndex::setResNumPrivate( int resNum, KConfig& config )
 int ThreadIndex::getReadNumPrivate( const KURL& url, KConfig& config, bool checkCached )
 {
     /* If cache does not exist, return 0 */
-    if( checkCached ){
-       
-       QString path = Kita::DatManager::getCachePath( url );
-       if( ! QFile::exists( path ) ){
-           qDebug("%s does not exits",path.ascii());
-           return 0;
-       }
+    if ( checkCached ) {
+
+        QString path = Kita::DatManager::getCachePath( url );
+        if ( ! QFile::exists( path ) ) {
+            qDebug( "%s does not exits", path.ascii() );
+            return 0;
+        }
     }
-    
+
     int readNum = config.readNumEntry( "ReadNum" );
 
-    if( !readNum ){
+    if ( !readNum ) {
+
+        /* use ViewPos instead of ReadNum. */
+        readNum = config.readNumEntry( "ViewPos" );
 
-       /* use ViewPos instead of ReadNum. */
-       readNum = config.readNumEntry( "ViewPos" );
-                       
-       /* use obsoleted "cache" file */
-       if( !readNum ){
-           KURL datURL = Kita::getDatURL( url );
-           readNum = KitaThreadInfo::readNum( datURL.prettyURL() );
-       }
+        /* use obsoleted "cache" file */
+        if ( !readNum ) {
+            KURL datURL = Kita::getDatURL( url );
+            readNum = KitaThreadInfo::readNum( datURL.prettyURL() );
+        }
 
-       if( readNum ) config.writeEntry( "ReadNum", readNum );
+        if ( readNum ) config.writeEntry( "ReadNum", readNum );
     }
 
     return readNum;
index 344dc32..b57ceca 100644 (file)
@@ -21,7 +21,7 @@ class KConfig;
 namespace Kita
 {
     class Thread;
-    
+
     /**
     @author Hideki Ikemoto
     */
@@ -41,14 +41,14 @@ namespace Kita
         static void setViewPos( const KURL& url, int viewPos );
 
         static void setMarkList( const KURL& url, const QValueList< int >& markList );
-        
-       /*---------------------------------*/
-       
-       static void loadIndex( Kita::Thread* thread, const KURL& url, bool checkCached = TRUE );
-       static void saveIndex( const Kita::Thread* thread, const KURL& url );   
-
-      private:
-       
+
+        /*---------------------------------*/
+
+        static void loadIndex( Kita::Thread* thread, const KURL& url, bool checkCached = TRUE );
+        static void saveIndex( const Kita::Thread* thread, const KURL& url );
+
+    private:
+
         static QString getSubjectPrivate( KConfig& config );
         static void setSubjectPrivate( const QString& str, KConfig& config );
 
@@ -60,7 +60,7 @@ namespace Kita
 
         static int getViewPosPrivate( KConfig& config );
         static void setViewPosPrivate( int viewPos, KConfig& config );
-        
+
         static QValueList< int > getMarkListPrivate( KConfig& config );
         static void setMarkListPrivate( const QValueList< int >& markList, KConfig& config );
     };
index ebf34f2..33f876b 100644 (file)
@@ -67,7 +67,7 @@ void KitaThreadInfo::replace( const QString fromURL, const QString toURL )
 {
     QMap<QString, int>::Iterator it;
     KitaThreadInfo* instance = KitaThreadInfo::getInstance();
-    if( instance == NULL ) return;
+    if ( instance == NULL ) return ;
 
     for ( it = instance->m_readDict.begin(); it != instance->m_readDict.end(); ++it ) {
         QString url = it.key();
index 42c926f..ef6254a 100644 (file)
 namespace Kita
 {
     ListViewItem::ListViewItem( QListView *parent, QListViewItem *after,
-                                QString label1, QString label2, QString label3, QString label4,
-                                QString label5, QString label6, QString label7, QString label8)
-       : KListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8)
+                                QString label1, QString label2, QString label3, QString label4,
+                                QString label5, QString label6, QString label7, QString label8 )
+            : KListViewItem( parent, after, label1, label2, label3, label4, label5, label6, label7, label8 )
     {
-       init();
+        init();
     }
 
     ListViewItem::ListViewItem( QListViewItem *parent, QListViewItem *after,
-                                QString label1, QString label2, QString label3, QString label4,
-                                QString label5, QString label6, QString label7, QString label8)
-       : KListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8)
+                                QString label1, QString label2, QString label3, QString label4,
+                                QString label5, QString label6, QString label7, QString label8 )
+            : KListViewItem( parent, after, label1, label2, label3, label4, label5, label6, label7, label8 )
     {
-       init();
+        init();
     }
 
-    ListViewItem::ListViewItem( QListView* parent, QString label1, QString label2  )
-       : KListViewItem( parent, label1, label2 )
+    ListViewItem::ListViewItem( QListView* parent, QString label1, QString label2 )
+            : KListViewItem( parent, label1, label2 )
     {
-       init(); 
+        init();
     }
 
-    ListViewItem::ListViewItem( QListViewItem* parent, QString label1, QString label2  )
-       : KListViewItem( parent, label1, label2 )
+    ListViewItem::ListViewItem( QListViewItem* parent, QString label1, QString label2 )
+            : KListViewItem( parent, label1, label2 )
     {
-       init();
+        init();
     }
-    
+
     ListViewItem::~ListViewItem()
     {}
 
     /* private */
     void ListViewItem::init()
     {
-       QColorGroup colors = listView()->viewport()->colorGroup();
-       m_textColor = colors.text();
-       m_baseColor = colors.base();
+        QColorGroup colors = listView() ->viewport() ->colorGroup();
+        m_textColor = colors.text();
+        m_baseColor = colors.base();
     }
 
     /* public */
     void ListViewItem::setColor( QColor textColor, QColor baseColor )
     {
-       m_textColor = textColor;
-       m_baseColor = baseColor;
+        m_textColor = textColor;
+        m_baseColor = baseColor;
     }
 
     /* public */ /* virtual */
     void ListViewItem::paintCell( QPainter *p, const QColorGroup &cg,
-      int column, int width, int align )
+                                  int column, int width, int align )
     {
         QColorGroup color = cg;
         color.setColor( QColorGroup::Text, m_textColor );
@@ -73,30 +73,30 @@ namespace Kita
 
 
     SubjectListViewItem::SubjectListViewItem( QListView* parent )
-       : Kita::ListViewItem( parent )
+            : Kita::ListViewItem( parent )
     {}
 
     SubjectListViewItem::~SubjectListViewItem()
     {}
-    
-    /* public */ /* virtual */    
+
+    /* public */ /* virtual */
     int SubjectListViewItem::compare( QListViewItem* i, int col, bool ascending ) const
     {
-       switch ( col ) {
-       case Col_ResNum:
-       case Col_ReadNum:
-       case Col_Unread:
-           return i->key( col, ascending ).toInt() - key( col, ascending ).toInt();
-       case Col_ID:
-           return key( Col_IDOrder, ascending ).toInt() - i->key( Col_IDOrder, ascending ).toInt();
-       case Col_Mark:
-           return QString::localeAwareCompare( i->key( Col_MarkOrder, ascending ), key( Col_MarkOrder, ascending ) );
-       case Col_Since:
-           return QString::localeAwareCompare( i->key( col, ascending ), key( col, ascending ) );
-       case Col_Speed:
-           return static_cast<int>( i->key( col, ascending ).toDouble() * 1000 - key( col, ascending ).toDouble() * 1000 );
-       default:
-           return QString::localeAwareCompare( key( col, ascending ), i->key( col, ascending ) );
-       }
+        switch ( col ) {
+        case Col_ResNum:
+        case Col_ReadNum:
+        case Col_Unread:
+            return i->key( col, ascending ).toInt() - key( col, ascending ).toInt();
+        case Col_ID:
+            return key( Col_IDOrder, ascending ).toInt() - i->key( Col_IDOrder, ascending ).toInt();
+        case Col_Mark:
+            return QString::localeAwareCompare( i->key( Col_MarkOrder, ascending ), key( Col_MarkOrder, ascending ) );
+        case Col_Since:
+            return QString::localeAwareCompare( i->key( col, ascending ), key( col, ascending ) );
+        case Col_Speed:
+            return static_cast<int>( i->key( col, ascending ).toDouble() * 1000 - key( col, ascending ).toDouble() * 1000 );
+        default:
+            return QString::localeAwareCompare( key( col, ascending ), i->key( col, ascending ) );
+        }
     }
-} 
+}
index 5454b5b..803c92d 100644 (file)
@@ -37,49 +37,49 @@ namespace Kita
 {
     class ListViewItem : public KListViewItem
     {
-       QColor m_textColor;  /* text color */
-       QColor m_baseColor;  /* background color */
-           
-      public:
-
-       ListViewItem( QListView *parent, QListViewItem *after,
-                     QString, QString = QString::null,
-                     QString = QString::null, QString = QString::null,
-                     QString = QString::null, QString = QString::null,
-                     QString = QString::null, QString = QString::null);    
-
-       ListViewItem( QListViewItem *parent, QListViewItem *after,
-                     QString, QString = QString::null,
-                     QString = QString::null, QString = QString::null,
-                     QString = QString::null, QString = QString::null,
-                     QString = QString::null, QString = QString::null);    
-
-       ListViewItem( QListView* parent, QString = QString::null, QString = QString::null );
-
-       ListViewItem( QListViewItem* parent, QString = QString::null, QString = QString::null );
-       
-       ~ListViewItem();
-
-       void setColor( QColor textColor, QColor baseColor );
-       virtual void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align );
-
-      private:
-       void init();
+        QColor m_textColor;  /* text color */
+        QColor m_baseColor;  /* background color */
+
+    public:
+
+        ListViewItem( QListView *parent, QListViewItem *after,
+                      QString, QString = QString::null,
+                      QString = QString::null, QString = QString::null,
+                      QString = QString::null, QString = QString::null,
+                      QString = QString::null, QString = QString::null );
+
+        ListViewItem( QListViewItem *parent, QListViewItem *after,
+                      QString, QString = QString::null,
+                      QString = QString::null, QString = QString::null,
+                      QString = QString::null, QString = QString::null,
+                      QString = QString::null, QString = QString::null );
+
+        ListViewItem( QListView* parent, QString = QString::null, QString = QString::null );
+
+        ListViewItem( QListViewItem* parent, QString = QString::null, QString = QString::null );
+
+        ~ListViewItem();
+
+        void setColor( QColor textColor, QColor baseColor );
+        virtual void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align );
+
+    private:
+        void init();
     };
 
     /*----------------------------------------*/
-    
+
     /* for KitaSubjectView */
     class SubjectListViewItem : public Kita::ListViewItem
     {
-       SubjectListViewItem( QListView* parent );
-       ~SubjectListViewItem();
-       
+        SubjectListViewItem( QListView* parent );
+        ~SubjectListViewItem();
+
     public:
         virtual int compare( QListViewItem* i, int col, bool ascending ) const;
     };
-    
-} 
+
+}
 
 
 
index e1651cd..6923062 100644 (file)
@@ -1,12 +1,12 @@
 /***************************************************************************
- *   Copyright (C) 2003 by Hideki Ikemoto                                  *
- *   ikemo@users.sourceforge.jp                                            *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2003 by Hideki Ikemoto                                  *
+*   ikemo@users.sourceforge.jp                                            *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 
 #include "kita.h"
 
 #include "libkita/kitaconfig.h"
 
 static const char *description =
-    I18N_NOOP("Kita - 2ch client for KDE");
+    I18N_NOOP( "Kita - 2ch client for KDE" );
 
 static const char *version = VERSION;
 
 static KCmdLineOptions options[] =
-{
-    { "+[URL]", I18N_NOOP( "Document to open." ), 0 },
-    { "boardlist <boardlist>", I18N_NOOP( "board list's URL." ), "http://www.ff.iij4u.or.jp/~ch2/bbsmenu.html" }, 
-    { 0, 0, 0 }
-};
+    {
+        { "+[URL]", I18N_NOOP( "Document to open." ), 0 },
+        { "boardlist <boardlist>", I18N_NOOP( "board list's URL." ), "http://www.ff.iij4u.or.jp/~ch2/bbsmenu.html" },
+        { 0, 0, 0 }
+    };
 
-int main(int argc, char **argv)
+int main( int argc, char **argv )
 {
-    KAboutData about("kita", I18N_NOOP("Kita"), version, description,
-                     KAboutData::License_GPL, "(C) 2003-2004 Kita Developers", 0, 0, "ikemo@users.sourceforge.jp");
-    about.addAuthor( "Hideki Ikemoto", I18N_NOOP("maintainer, initial code"), "ikemo@users.sourceforge.jp" );
-    about.addAuthor( "konqueror plugin no hito", I18N_NOOP("konqueror plugin, KDE part"), "ogirin@users.sourceforge.jp");
-    about.addAuthor( "421", I18N_NOOP("kitanavi, threadview's improvement") );
-    about.addAuthor( "Toshihiko Okada", I18N_NOOP("improvements"), "tossi@users.sourceforge.jp");
-    about.addAuthor( "75", I18N_NOOP("stylesheet support") );
-    KCmdLineArgs::init(argc, argv, &about);
-    KCmdLineArgs::addCmdLineOptions(options);
+    KAboutData about( "kita", I18N_NOOP( "Kita" ), version, description,
+                      KAboutData::License_GPL, "(C) 2003-2004 Kita Developers", 0, 0, "ikemo@users.sourceforge.jp" );
+    about.addAuthor( "Hideki Ikemoto", I18N_NOOP( "maintainer, initial code" ), "ikemo@users.sourceforge.jp" );
+    about.addAuthor( "konqueror plugin no hito", I18N_NOOP( "konqueror plugin, KDE part" ), "ogirin@users.sourceforge.jp" );
+    about.addAuthor( "421", I18N_NOOP( "kitanavi, threadview's improvement" ) );
+    about.addAuthor( "Toshihiko Okada", I18N_NOOP( "improvements" ), "tossi@users.sourceforge.jp" );
+    about.addAuthor( "75", I18N_NOOP( "stylesheet support" ) );
+    KCmdLineArgs::init( argc, argv, &about );
+    KCmdLineArgs::addCmdLineOptions( options );
     KUniqueApplication app;
 
     // register ourselves as a dcop client
-    app.dcopClient()->registerAs(app.name(), false);
+    app.dcopClient() ->registerAs( app.name(), false );
 
     KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
     KitaConfig::setBoardListURL( QString( args->getOption( "boardlist" ) ) );
 
     // see if we are starting with session management
-    if (app.isRestored())
-        RESTORE(KitaMainWindow)
-    else
-    {
-        // no session.. just start up normally
-        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
-        if (args->count() == 0)
-        {
-            KitaMainWindow *widget = new KitaMainWindow;
-            widget->show();
-        }
-        else
-        {
-            int i = 0;
-            for (; i < args->count(); i++)
-            {
-                KitaMainWindow *widget = new KitaMainWindow;
+    if ( app.isRestored() )
+        RESTORE( KitaMainWindow )
+        else {
+            // no session.. just start up normally
+            KCmdLineArgs * args = KCmdLineArgs::parsedArgs();
+            if ( args->count() == 0 ) {
+                KitaMainWindow * widget = new KitaMainWindow;
                 widget->show();
-                widget->load(args->url(i));
+            } else {
+                int i = 0;
+                for ( ; i < args->count(); i++ ) {
+                    KitaMainWindow *widget = new KitaMainWindow;
+                    widget->show();
+                    widget->load( args->url( i ) );
+                }
             }
+            args->clear();
         }
-        args->clear();
-    }
 
     return app.exec();
 }
index d213d67..f12f0ee 100644 (file)
@@ -74,28 +74,28 @@ bool KitaDomTree::createResElement( int num )
         if ( m_resStatus[ num ] != KITA_HTML_NOTPARSED ) return TRUE; /* already parsed */
     }
     /* resize buffer size */
-    else{
+    else {
 
-       if ( m_bufLng == 0 ) m_bufLng = mrg;
-       while ( num >= m_bufLng ) m_bufLng += delta;
+        if ( m_bufLng == 0 ) m_bufLng = mrg;
+        while ( num >= m_bufLng ) m_bufLng += delta;
 
-       m_titleElm.resize( m_bufLng );
-       m_bodyElm.resize( m_bufLng );       
-       m_resshown.resize( m_bufLng, FALSE );
-       m_resStatus.resize( m_bufLng, KITA_HTML_NOTPARSED );
+        m_titleElm.resize( m_bufLng );
+        m_bodyElm.resize( m_bufLng );
+        m_resshown.resize( m_bufLng, FALSE );
+        m_resStatus.resize( m_bufLng, KITA_HTML_NOTPARSED );
         m_coloredNum.resize( m_bufLng, FALSE );
     }
 
     /* cleate elements */
     QString titleHTML, bodyHTML;
     m_resStatus[ num ] = m_datInfo->getHTML( num, TRUE, titleHTML, bodyHTML );
-    if( m_resStatus[ num ] == KITA_HTML_NOTPARSED ) return FALSE;
-    
+    if ( m_resStatus[ num ] == KITA_HTML_NOTPARSED ) return FALSE;
+
     m_titleElm[ num ] = m_hdoc.createElement( "DIV" );
     m_titleElm[ num ].setAttribute( "class", "res_title" );
     m_titleElm[ num ].setAttribute( "id", QString().setNum( num ) );
     m_titleElm[ num ].setInnerHTML( titleHTML );
-    
+
     m_bodyElm[ num ] = m_hdoc.createElement( "DIV" );
     m_bodyElm[ num ].setAttribute( "class", "res_body" );
     m_bodyElm[ num ].setAttribute( "id", QString().setNum( num ) );
@@ -103,20 +103,20 @@ bool KitaDomTree::createResElement( int num )
 
 #if KDE_IS_VERSION( 3, 2, 0 )
 #else
-    if( KitaConfig::showAA() ){
+    if ( KitaConfig::showAA() ) {
 
         /* clear text in the span */
         DOM::Node tmpnode = m_bodyElm[ num ].firstChild().firstChild();
-        while( !tmpnode.isNull() ){
-            if ( tmpnode.nodeName().string() == "span" ){
-                if( !tmpnode.firstChild().isNull() ) tmpnode.firstChild().setNodeValue( "" );
+        while ( !tmpnode.isNull() ) {
+            if ( tmpnode.nodeName().string() == "span" ) {
+                if ( !tmpnode.firstChild().isNull() ) tmpnode.firstChild().setNodeValue( "" );
             }
 
             tmpnode = tmpnode.nextSibling();
         }
     }
-#endif    
-    
+#endif
+
     return TRUE;
 }
 
@@ -128,7 +128,7 @@ bool KitaDomTree::appendRes( int num )
     if ( !createResElement( num ) ) return FALSE;
 
     m_hdoc.body().appendChild( m_titleElm[ num ] );
-    m_hdoc.body().appendChild( m_bodyElm[ num ] );    
+    m_hdoc.body().appendChild( m_bodyElm[ num ] );
     m_resshown[ num ] = TRUE;
 
     if ( num < m_topNum ) m_topNum = num;
@@ -155,14 +155,14 @@ void KitaDomTree::redraw( bool force )
 
         if ( !m_resshown[ i ] ) continue;
 
-       QString titleHTML, bodyHTML;
+        QString titleHTML, bodyHTML;
         int oldStatus = m_resStatus[ i ];
-       m_resStatus[ i ] = m_datInfo->getHTML( i , TRUE, titleHTML, bodyHTML );
-           
-        if ( force || oldStatus != m_resStatus[ i ] ){
-           
-           m_titleElm[ i ].setInnerHTML( titleHTML );
-           m_bodyElm[ i ].setInnerHTML( bodyHTML );
+        m_resStatus[ i ] = m_datInfo->getHTML( i , TRUE, titleHTML, bodyHTML );
+
+        if ( force || oldStatus != m_resStatus[ i ] ) {
+
+            m_titleElm[ i ].setInnerHTML( titleHTML );
+            m_bodyElm[ i ].setInnerHTML( bodyHTML );
         }
     }
 }
@@ -174,9 +174,9 @@ void KitaDomTree::redraw( bool force )
    and DatInfo::collectResponsedRes().                   */ /* public */
 void KitaDomTree::changeColorOfAllResponsedNumber()
 {
-    for( int i = 1; i <= m_bottomNum; ++i ){
-        
-        if( m_resshown[ i ] && m_datInfo->isResponsed( i ) ) changeColorOfNumber( i );
+    for ( int i = 1; i <= m_bottomNum; ++i ) {
+
+        if ( m_resshown[ i ] && m_datInfo->isResponsed( i ) ) changeColorOfNumber( i );
     }
 }
 
@@ -230,7 +230,7 @@ void KitaDomTree::appendTemplate( int tmpNum )
     if ( tmpNum > m_templateNum ) m_templateNum = tmpNum;
 
     for ( int i = 1; i <= m_templateNum; i++ ) {
-       
+
         if ( !createResElement( i ) ) continue;
 
         m_hdoc.body().appendChild( m_titleElm[ i ] );
@@ -326,7 +326,7 @@ void KitaDomTree::appendMae100()
     }
 
     int i = m_topNum;
-    if ( i > readNum ) return;
+    if ( i > readNum ) return ;
     while ( !m_resshown[ i ] && i <= readNum ) i++;
 
     if ( i <= readNum ) {
@@ -417,7 +417,7 @@ void KitaDomTree::appendANode( DOM::Element rootnode, const QString& linkstr, co
 
 /* update footer or header No  */ /* private */
 void KitaDomTree::updateFooterOrHeader(
-    DOM::Element& targetelm,   /* = m_header or m_footer */
+    DOM::Element& targetelm,    /* = m_header or m_footer */
     QString strType /* = "header" or "footer" */
 )
 {
@@ -615,7 +615,7 @@ void KitaDomTree::createMae100()
     m_mae100 = rootnode;
 }
 
-/* change color of number */ 
+/* change color of number */
 /*
    specify color like this:  "a.coloredLink:link{ color: red; }"   */ /* private */
 
@@ -623,13 +623,13 @@ void KitaDomTree::changeColorOfNumber( int num )
 {
     if ( ! m_datInfo ) return ;
     if ( m_hdoc == NULL ) return ;
-    if ( m_coloredNum[ num ] ) return;
-    if ( !m_resshown[ num ] ) return;
+    if ( m_coloredNum[ num ] ) return ;
+    if ( !m_resshown[ num ] ) return ;
 
     m_coloredNum[ num ] = TRUE;
     DOM::Node node = m_titleElm[ num ];
     node = node.firstChild();
-    while( node.nodeName().string() != "a" ) node = node.firstChild();  /* table tag is used. */
+    while ( node.nodeName().string() != "a" ) node = node.firstChild();  /* table tag is used. */
 
     static_cast< DOM::HTMLElement> ( node ).setAttribute( "class", "coloredLink" );
 }
index dcb1226..0392928 100644 (file)
@@ -42,7 +42,7 @@ class KitaDomTree
     int m_bottomNum;
     int m_headerMaxNum;
     QValueVector < bool > m_resshown; /* the res is shown */
-    QValueVector < int > m_resStatus; /* return val of DatInfo::getHTML(). See datinfo.h */    
+    QValueVector < int > m_resStatus; /* return val of DatInfo::getHTML(). See datinfo.h */
     QValueVector < bool > m_coloredNum; /* colored number */
 
     /* DOM elements */
index 7c45216..2801b9c 100644 (file)
@@ -68,7 +68,7 @@ void KitaHTMLPart::clearPart()
 {
 
     slotDeletePopup();
-    
+
     /* delete KitaDomTree */
     if ( m_domtree ) delete m_domtree;
     m_domtree = NULL;
@@ -76,12 +76,12 @@ void KitaHTMLPart::clearPart()
     /* update ViewPos */
     if ( m_mode == HTMLPART_MODE_MAINPART && !m_updatedKokoyon && !m_datURL.isEmpty() ) {
         int readNum = Kita::DatManager::getReadNum( m_datURL );
-        if ( readNum ){
-           Kita::DatManager::setViewPos( m_datURL, readNum );
-       }
+        if ( readNum ) {
+            Kita::DatManager::setViewPos( m_datURL, readNum );
+        }
     }
     m_updatedKokoyon = FALSE;
-    
+
     /* clear variables */
     m_anchorStack.clear();
     m_centerNum = 0;
@@ -93,17 +93,17 @@ void KitaHTMLPart::clearPart()
         /* don't forget to unlock previous datURL here. */
         Kita::DatManager::unlock( m_datURL );
 
-        if ( m_mode == HTMLPART_MODE_MAINPART ){ /* This part is on the main thread view. */
+        if ( m_mode == HTMLPART_MODE_MAINPART ) { /* This part is on the main thread view. */
+
+            /* tell Thread class that "thread is closed" */
+            Kita::DatManager::setMainThreadOpened( m_datURL, FALSE );
 
-           /* tell Thread class that "thread is closed" */         
-           Kita::DatManager::setMainThreadOpened( m_datURL, FALSE );
-           
-           /* emit "deactivated all thread view" SIGNAL */         
-           emit activateThreadView( QString::null );
+            /* emit "deactivated all thread view" SIGNAL */
+            emit activateThreadView( QString::null );
 
-           /*  update subject tab. */
-           emit updateSubjectTab( m_datURL );
-       }
+            /*  update subject tab. */
+            emit updateSubjectTab( m_datURL );
+        }
     }
     m_datURL = QString::null;
     m_mode = HTMLPART_MODE_KHTML;
@@ -120,22 +120,22 @@ bool KitaHTMLPart::setup( int mode, const KURL& url )
 
     m_datURL = Kita::getDatURL( url );
     m_mode = mode;
-    
-    if( m_mode == HTMLPART_MODE_MAINPART ){ /* This part is on the main thread view. */
 
-       /* create DatInfo explicitly to open new thread.   */
-       /* Usually, DatInfo is NOT created if ReadNum == 0.*/
-       /* See also DatManager::createDatInfo() and        */
-       /*          DatManager::getDatInfo().              */
-       Kita::DatManager::createDatInfo( m_datURL );
+    if ( m_mode == HTMLPART_MODE_MAINPART ) { /* This part is on the main thread view. */
+
+        /* create DatInfo explicitly to open new thread.   */
+        /* Usually, DatInfo is NOT created if ReadNum == 0.*/
+        /* See also DatManager::createDatInfo() and        */
+        /*          DatManager::getDatInfo().              */
+        Kita::DatManager::createDatInfo( m_datURL );
 
-       /* tell Thread class that "thread is opend" */
-       Kita::DatManager::setMainThreadOpened( m_datURL, TRUE );
+        /* tell Thread class that "thread is opend" */
+        Kita::DatManager::setMainThreadOpened( m_datURL, TRUE );
 
-       /* reset abone */
-       Kita::DatManager::resetAbone( m_datURL );
+        /* reset abone */
+        Kita::DatManager::resetAbone( m_datURL );
     }
-    
+
     /* Lock datURL. Don't forget to unlock it later ! */
     Kita::DatManager::lock ( m_datURL );
 
@@ -146,7 +146,7 @@ bool KitaHTMLPart::setup( int mode, const KURL& url )
     if ( m_mode == HTMLPART_MODE_MAINPART || m_mode == HTMLPART_MODE_NAVI ) {
         m_domtree = new KitaDomTree( htmlDocument(), m_datURL );
     }
-    
+
     return TRUE;
 }
 
@@ -372,8 +372,8 @@ void KitaHTMLPart::updateScreen( bool showHeaderEtc, bool clock )
 
     /* change color of number of the res which is responsed. */
     if ( m_mode == HTMLPART_MODE_MAINPART || m_mode == HTMLPART_MODE_NAVI ) {
-        
-        if( KitaConfig::checkResponsed() ) m_domtree->changeColorOfAllResponsedNumber();
+
+        if ( KitaConfig::checkResponsed() ) m_domtree->changeColorOfAllResponsedNumber();
     }
 
     /*----------------------------*/
@@ -1265,7 +1265,7 @@ void KitaHTMLPart::customEvent( QCustomEvent * e )
 {
     if ( e->type() == EVENT_GotoAnchor ) {
         KHTMLPart::gotoAnchor( static_cast< GotoAnchorEvent* >( e ) ->getAnc() );
-        return;
+        return ;
     }
 
     KHTMLPart::customEvent( e );
@@ -1607,7 +1607,7 @@ void KitaHTMLPart::showWritePopupMenu( const QString& refstr )
 
     case WRITEMENU_SETKOKOYON:
         Kita::DatManager::setViewPos( m_datURL, resNum );
-       emit updateSubjectTab( m_datURL );
+        emit updateSubjectTab( m_datURL );
         m_updatedKokoyon = TRUE;
         updateScreen( TRUE, TRUE );
         gotoAnchor( QString().setNum( resNum ), FALSE );
@@ -1966,15 +1966,15 @@ void KitaHTMLPart::slotOnURL( const QString& url )
     KURL datURL = m_datURL;
     if ( url.at( 0 ) == '#' ) refstr = url.mid( 1 );
     else datURL = Kita::getDatURL( KURL( m_datURL, url ) , refstr );
-    
+
     /*------------------------*/
     /* id popup               */
 
     if ( url.left( 6 ) == "#idpop" ) {
         int num = Kita::DatManager::getNumByID( m_datURL, url.mid( 6 ) );
         QString tmpstr;
-       if( num >=2 ) tmpstr = QString( "<DIV>ID:%1:[%2]</DIV>" ).arg( url.mid( 6 ) ).arg( num );
-       else tmpstr = "<DIV>" + i18n( "None" ) + "</DIV>";
+        if ( num >= 2 ) tmpstr = QString( "<DIV>ID:%1:[%2]</DIV>" ).arg( url.mid( 6 ) ).arg( num );
+        else tmpstr = "<DIV>" + i18n( "None" ) + "</DIV>";
         showPopup( m_datURL, tmpstr );
         return ;
     }
@@ -1982,14 +1982,14 @@ void KitaHTMLPart::slotOnURL( const QString& url )
 
     /*------------------------*/
     /* show reffered num      */
-    
-    if ( refstr.left( 5 ) == "write" ){
-       int no = refstr.mid( 5 ).toInt();
+
+    if ( refstr.left( 5 ) == "write" ) {
+        int no = refstr.mid( 5 ).toInt();
         int num = 0;
         Kita::DatManager::getTreeByRes( m_datURL, no, num );
         QString tmpstr;
-       if( num ) tmpstr = QString( "<DIV>No.%1 : [%2]</DIV>" ).arg( no ).arg( num );
-       else tmpstr = "<DIV>" + i18n( "None" ) + "</DIV>";
+        if ( num ) tmpstr = QString( "<DIV>No.%1 : [%2]</DIV>" ).arg( no ).arg( num );
+        else tmpstr = "<DIV>" + i18n( "None" ) + "</DIV>";
         showPopup( m_datURL, tmpstr );
         return ;
     }
@@ -2000,11 +2000,11 @@ void KitaHTMLPart::slotOnURL( const QString& url )
 
     if ( url.left( 6 ) == "#abone" ) {
         int no = url.mid( 6 ).toInt();
-       QString tmpstr = Kita::DatManager::getHtml( m_datURL, no, no, FALSE );
+        QString tmpstr = Kita::DatManager::getHtml( m_datURL, no, no, FALSE );
         showPopup( m_datURL, tmpstr );
         return ;
     }
-    
+
     /*------------------------*/
     /* image popup            */
     if ( KitaConfig::useImagePopup() ) {
@@ -2063,11 +2063,11 @@ void KitaHTMLPart::slotOnURL( const QString& url )
         QString boardName = Kita::BoardManager::boardName( datURL );
         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(). */
-       Kita::DatManager::getDatInfoPointer( datURL ); 
+        /* 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(). */
+        Kita::DatManager::getDatInfoPointer( datURL );
 
-       /* get thread Name */
+        /* get thread Name */
         QString subName = Kita::DatManager::threadName( datURL );
         if ( subName != QString::null ) innerHTML += subName + "<br><br>";
 
@@ -2247,16 +2247,16 @@ namespace Kita
             if ( qr.bottom() > maxheight ) maxheight = qr.bottom();
 
             /* move to the next node */
-           DOM::Node next = curnode.firstChild();
+            DOM::Node next = curnode.firstChild();
 
-           if ( next.isNull() ) next = curnode.nextSibling();
+            if ( next.isNull() ) next = curnode.nextSibling();
 
-           while ( !curnode.isNull() && next.isNull() ) {
-               curnode = curnode.parentNode();
-               if ( !curnode.isNull() ) next = curnode.nextSibling();
-           }
+            while ( !curnode.isNull() && next.isNull() ) {
+                curnode = curnode.parentNode();
+                if ( !curnode.isNull() ) next = curnode.nextSibling();
+            }
 
-           curnode = next;
+            curnode = next;
 
             if ( curnode.isNull() ) break;
         }
index 9e2ec95..8bb9676 100644 (file)
@@ -289,7 +289,7 @@ class GotoAnchorEvent : public QCustomEvent
 public:
 
     GotoAnchorEvent( const QString& anc )
-        : QCustomEvent( EVENT_GotoAnchor ), m_anc( anc ){};
+            : QCustomEvent( EVENT_GotoAnchor ), m_anc( anc ) {};
 
     const QString& getAnc() const { return m_anc; }
 };
index d41e828..bb51a00 100644 (file)
@@ -31,20 +31,18 @@ void KitaHTMLView::leaveEvent( QEvent* )
 void KitaHTMLView::keyPressEvent( QKeyEvent* e )
 {
     if ( e->key() == Key_Space || e->key() == Key_PageDown
-            || e->key() == Key_Down || e->key() == Key_End )
-    {
-        if( emitPushDown() ) return;
+            || e->key() == Key_Down || e->key() == Key_End ) {
+        if ( emitPushDown() ) return ;
     }
 
     KHTMLView::keyPressEvent( e );
 }
 
 /* protected */
-void KitaHTMLView::viewportWheelEvent(QWheelEvent * e)
+void KitaHTMLView::viewportWheelEvent( QWheelEvent * e )
 {
-    if( e->delta() < 0 )
-    { /* scroll down */
-        if( emitPushDown() ) return;
+    if ( e->delta() < 0 ) { /* scroll down */
+        if ( emitPushDown() ) return ;
     }
 
     KHTMLView::viewportWheelEvent( e );
@@ -55,9 +53,8 @@ bool KitaHTMLView::emitPushDown()
 {
 
     int y = contentsY();
-    if( y >= contentsHeight() - visibleHeight() )
-    {
-        emit pushDown();/* to KitaHTMLPart in order to call slotClickTugi100 */
+    if ( y >= contentsHeight() - visibleHeight() ) {
+        emit pushDown(); /* to KitaHTMLPart in order to call slotClickTugi100 */
         return TRUE;
     }
 
index 82b1e99..f510e23 100644 (file)
@@ -25,14 +25,14 @@ public:
 protected:
     void leaveEvent( QEvent* );
     void keyPressEvent( QKeyEvent* e );
-    void viewportWheelEvent(QWheelEvent * e);
+    void viewportWheelEvent( QWheelEvent * e );
 
 private:
     bool emitPushDown();
-    
+
 signals:
     void leave();
-    void pushDown();    
+    void pushDown();
 };
 
 #endif
index 15234cf..eaf3fde 100644 (file)
@@ -230,12 +230,11 @@ void KitaImgView::contentsMousePressEvent( QMouseEvent * e )
         QString dummy;
         slotPopupMenu( dummy, e->globalPos() );
         return ;
-    }
-    else if ( e->button() & Qt::LeftButton ) { /* start dragscrolling */
+    } else if ( e->button() & Qt::LeftButton ) { /* start dragscrolling */
         m_dragScroll = TRUE;
         QApplication::setOverrideCursor( KCursor::handCursor() );
         m_dragx = e->globalX();
-        m_dragy = e->globalY();        
+        m_dragy = e->globalY();
     }
 
     QScrollView::contentsMousePressEvent( e );
@@ -244,20 +243,20 @@ void KitaImgView::contentsMousePressEvent( QMouseEvent * e )
 /* Note that e->button() is always NoButton. */ /* virtual protected */
 void KitaImgView::contentsMouseMoveEvent( QMouseEvent * e )
 {
-    if( !m_dragScroll ) return;
-    
+    if ( !m_dragScroll ) return ;
+
     /* drag & scroll */
     int dx = m_dragx - e->globalX();
     int dy = m_dragy - e->globalY();
     scrollBy( dx, dy );
     m_dragx = e->globalX();
-    m_dragy = e->globalY();        
+    m_dragy = e->globalY();
 }
 
 /* virtual protected */
-void KitaImgView::contentsMouseReleaseEvent( QMouseEvent *  )
+void KitaImgView::contentsMouseReleaseEvent( QMouseEvent * )
 {
-    if( m_dragScroll ){
+    if ( m_dragScroll ) {
         m_dragScroll = FALSE;
         QApplication::restoreOverrideCursor();
     }
index e3c8eb7..fbfef9f 100644 (file)
@@ -153,7 +153,7 @@ KitaThreadView::KitaThreadView( QWidget* parent, const char* name )
              signalCollection, SIGNAL( showWriteView( const KURL& , const QString& ) ) );
     connect( this, SIGNAL( createNewThread( const KURL& , const QString&, const QString& ) ),
              signalCollection, SIGNAL( createNewThread( const KURL& , const QString&, const QString& ) ) );
-    
+
 
     m_viewmode = VIEWMODE_MAINVIEW;
     m_rescode = 200;
@@ -455,7 +455,7 @@ void KitaThreadView::setup( const KURL& datURL, int mode )
     /* setup                                 */
 
     m_datURL = Kita::getDatURL( datURL );
-   
+
     /* setup HTMLPart */
     int partMode = HTMLPART_MODE_MAINPART;
     if ( mode == VIEWMODE_KITANAVI ) partMode = HTMLPART_MODE_NAVI;
@@ -648,9 +648,9 @@ void KitaThreadView::slotSearchButton()
         }
         /* create new thread */
         else if ( str.mid( 1, 3 ) == "new" ) {
-           emit createNewThread( m_datURL, QString::null, QString::null );
+            emit createNewThread( m_datURL, QString::null, QString::null );
             return ;
-        }      
+        }
 
         /* jump */
         QString anc = str.mid( 1 );
@@ -681,20 +681,20 @@ void KitaThreadView::slotSearchPrivate( bool rev )
     QStringList query;
     query += SearchCombo->currentText();
     int ResNum = Kita::DatManager::getResNum( m_datURL );
-    for( int i = 1; i <= ResNum; i++){
-       
-       if( Kita::DatManager::checkWord( m_datURL, query, i, FALSE ) ){
-           
-           /* if this is parent, then show all responses, and search */
-           if ( m_viewmode == VIEWMODE_MAINVIEW ) m_threadPart->showAll();
-
-           insertSearchCombo();
-           QStringList list = parseSearchQuery( SearchCombo->currentText() );
-           m_threadPart->findText( SearchCombo->currentText(), rev );
-           SearchCombo->setFocus();
-
-           return;
-       }
+    for ( int i = 1; i <= ResNum; i++ ) {
+
+        if ( Kita::DatManager::checkWord( m_datURL, query, i, FALSE ) ) {
+
+            /* if this is parent, then show all responses, and search */
+            if ( m_viewmode == VIEWMODE_MAINVIEW ) m_threadPart->showAll();
+
+            insertSearchCombo();
+            QStringList list = parseSearchQuery( SearchCombo->currentText() );
+            m_threadPart->findText( SearchCombo->currentText(), rev );
+            SearchCombo->setFocus();
+
+            return ;
+        }
     }
 
     QMessageBox::information( this, i18n( "kita" ), i18n( "Not Found" ) );
@@ -736,9 +736,9 @@ void KitaThreadView::slotDeleteButtonClicked()
                 != QMessageBox::Ok ) return ;
     }
 
-    if( Kita::DatManager::deleteCache( m_datURL ) ){
-       emit closeThreadTab( m_datURL );
-       emit updateSubjectTab( m_datURL );
+    if ( Kita::DatManager::deleteCache( m_datURL ) ) {
+        emit closeThreadTab( m_datURL );
+        emit updateSubjectTab( m_datURL );
     }
 }
 
index 427c564..6648ceb 100644 (file)
@@ -144,7 +144,7 @@ signals:
     /* kita navi */
     void showKitaNaviByWord( const KURL& , QString );
     void showWriteView( const KURL& , const QString& );
-    void createNewThread( const KURL& , const QString&, const QString& );    
+    void createNewThread( const KURL& , const QString&, const QString& );
     void activateThreadView( const KURL& );
 };
 
index 5c1e35b..d08745d 100644 (file)
 void KitaWriteDialogBase::sageBoxToggled( bool on )
 {
     if ( on ) {
-       m_mailswap = mailLine->text();
-       mailLine->setText("sage");
-       mailLine->setReadOnly(true);
+        m_mailswap = mailLine->text();
+        mailLine->setText( "sage" );
+        mailLine->setReadOnly( true );
     } else {
-       mailLine->setReadOnly(false);
-       mailLine->setText(m_mailswap);
+        mailLine->setReadOnly( false );
+        mailLine->setText( m_mailswap );
     }
 }
 
index fad000b..ba602fc 100644 (file)
@@ -72,7 +72,7 @@ KitaWriteView::KitaWriteView( QWidget* parent, const char* name, const KURL& url
         : KitaWriteDialogBase( parent, name, 0 )
 {
     if ( !m_cp932Codec ) m_cp932Codec = new QCp932Codec();
-    
+
     m_mode = mode;
 
     if ( m_mode == WRITEMODE_NORMAL ) m_datURL = Kita::getDatURL( url );
@@ -88,26 +88,25 @@ KitaWriteView::KitaWriteView( QWidget* parent, const char* name, const KURL& url
     m_bbstype = Kita::BoardManager::type( m_datURL );
 
     /* set path of bbs.cgi */
-    switch( m_bbstype ){
-       
-    case Kita::Board_JBBS:
-    {
-       QString cgipath = Kita::BoardManager::boardRoot( m_datURL )
-           + "/bbs/write.cgi/" + Kita::BoardManager::boardID( m_datURL ) + "/";
-       
-       if( m_mode == WRITEMODE_NORMAL ) cgipath += Kita::DatManager::threadID( m_datURL ) + "/";
-       else  cgipath += "new/";
-
-       m_bbscgi = cgipath;
-    }
+    switch ( m_bbstype ) {
+
+    case Kita::Board_JBBS: {
+            QString cgipath = Kita::BoardManager::boardRoot( m_datURL )
+                              + "/bbs/write.cgi/" + Kita::BoardManager::boardID( m_datURL ) + "/";
 
-       break;
+            if ( m_mode == WRITEMODE_NORMAL ) cgipath += Kita::DatManager::threadID( m_datURL ) + "/";
+            else cgipath += "new/";
+
+            m_bbscgi = cgipath;
+        }
+
+        break;
 
     default:
 
-       m_bbscgi = Kita::BoardManager::boardRoot( m_datURL ) + "/test/bbs.cgi";
+        m_bbscgi = Kita::BoardManager::boardRoot( m_datURL ) + "/test/bbs.cgi";
     }
-    
+
     /* connect signals */
     connect( buttonOk, SIGNAL( clicked() ),
              SLOT( slotPostMessage() ) );
@@ -243,7 +242,7 @@ void KitaWriteView::slotPostMessage()
         return ;
     }
 
-    if ( !slotBodyTextChanged() ){
+    if ( !slotBodyTextChanged() ) {
         QMessageBox::warning( this, "Kita", i18n( "Body text is too long." ) );
         return ;
     }
@@ -253,10 +252,10 @@ void KitaWriteView::slotPostMessage()
 
     /* set post message */
     QString postStr;
-    switch( m_bbstype ){
-       
+    switch ( m_bbstype ) {
+
     case Kita::Board_JBBS: postStr = setJBBSPostStr(); break;
-       
+
     case Kita::Board_FlashCGI: postStr = setFlashCGIPostStr(); break;
 
     default: postStr = setPostStr(); break;
@@ -324,9 +323,9 @@ void KitaWriteView::slotPostFinished( KIO::Job* )
 {
     QString response;
 
-    if( m_array.contains( "x-euc-jp" ) ) response = QTextCodec::codecForName( "eucJP" )->toUnicode( m_array );
-    else response = QTextCodec::codecForName( "sjis" )->toUnicode( m_array );
-    
+    if ( m_array.contains( "x-euc-jp" ) ) response = QTextCodec::codecForName( "eucJP" ) ->toUnicode( m_array );
+    else response = QTextCodec::codecForName( "sjis" ) ->toUnicode( m_array );
+
     int retcode = resultCode( response );
 
     switch ( retcode ) {
@@ -436,20 +435,20 @@ bool KitaWriteView::slotBodyTextChanged()
 
     /* replace '\n' -> " <br> ", '>' -> "&lt;", and etc. */
     length += ( ( bodyText->text().contains( '\n' ) ) * 5
-               +( bodyText->text().contains( '>' ) ) * 3
-               +( bodyText->text().contains( '<' ) ) * 3               
-       );
+                + ( bodyText->text().contains( '>' ) ) * 3
+                + ( bodyText->text().contains( '<' ) ) * 3
+              );
 
     int maxLength = Kita::BoardManager::getBBSMsgCount( m_datURL );
 
     QString str;
     str = QString().setNum( lines ) + "/" + ( maxLines != 0 ? QString().setNum( maxLines ) : QString( "--" ) );
-    str += " | " + QString().setNum( length ) + "/" + ( maxLength != 0 ? QString().setNum( maxLength ) : QString( "--" ) );    
+    str += " | " + QString().setNum( length ) + "/" + ( maxLength != 0 ? QString().setNum( maxLength ) : QString( "--" ) );
     lengthLabel->setText( str );
 
-    if( maxLines != 0 && lines > maxLines ) return FALSE;
-    if( maxLength != 0 && length > maxLength ) return FALSE;
-    
+    if ( maxLines != 0 && lines > maxLines ) return FALSE;
+    if ( maxLength != 0 && length > maxLength ) return FALSE;
+
     return TRUE;
 }
 
@@ -500,7 +499,7 @@ QString KitaWriteView::setJBBSPostStr()
 {
     QString ret;
 
-    int mib = QTextCodec::codecForName( "eucJP" )->mibEnum();
+    int mib = QTextCodec::codecForName( "eucJP" ) ->mibEnum();
     int serverTime;
 
     if ( m_mode == WRITEMODE_NORMAL ) serverTime = Kita::DatManager::getServerTime( m_datURL );
@@ -518,11 +517,11 @@ QString KitaWriteView::setJBBSPostStr()
     ( ret += "&BBS=" ) += Kita::BoardManager::boardID( m_datURL ).section( "/", 1, 1 );
 
     /* DIR */
-    ( ret += "&DIR=" ) +=Kita::BoardManager::boardID( m_datURL ).section( "/", 0, 0 );
+    ( ret += "&DIR=" ) += Kita::BoardManager::boardID( m_datURL ).section( "/", 0, 0 );
 
     /* SUBJECT */
     if ( m_mode == WRITEMODE_NEWTHREAD ) ( ret += "&SUBJECT=" ) += KURL::encode_string( threadName->text(), mib );
-    
+
     /* KEY */
     if ( m_mode == WRITEMODE_NORMAL ) ( ret += "&KEY=" ) += Kita::DatManager::threadID( m_datURL );
 
@@ -624,23 +623,23 @@ int KitaWriteView::resultCode( const QString& response ) const
             else if ( title.contains( truestr ) ) retcode = K2ch_True;
             else if ( title.contains( ckstr ) ) retcode = K2ch_Cookie;
 
-           /* re-post new thread message. adhock... */
+            /* re-post new thread message. adhock... */
             else if ( m_mode == WRITEMODE_NEWTHREAD
                       && response.contains( ckstr )
                       && response.contains( "subbbs.cgi" ) ) retcode = K2ch_NewThread;
 
             /* for Flash CGI */
-            else if( m_bbstype == Kita::Board_FlashCGI ){
-               
-                if( title.contains( "ERROR!!" ) ) retcode = K2ch_Error;    
+            else if ( m_bbstype == Kita::Board_FlashCGI ) {
+
+                if ( title.contains( "ERROR!!" ) ) retcode = K2ch_Error;
                 else retcode = K2ch_True;
             }
-           
+
             /* for JBBS.  adhoc... */
-            else if( m_bbstype == Kita::Board_JBBS ){
-               
-                 if ( response.contains( "x-euc-jp" ) ) retcode = K2ch_True;
-                 else retcode = K2ch_Error;
+            else if ( m_bbstype == Kita::Board_JBBS ) {
+
+                if ( response.contains( "x-euc-jp" ) ) retcode = K2ch_True;
+                else retcode = K2ch_Error;
             }
         }
     }
@@ -652,17 +651,17 @@ int KitaWriteView::resultCode( const QString& response ) const
 /* private */
 QString KitaWriteView::resultMessage( const QString& response ) const
 {
-    if( m_bbstype == Kita::Board_FlashCGI ){
-       
-       QRegExp regexp( "<blockquote>(.*)</blockquote>" );
-       int pos = regexp.search( response );
-       if ( pos != -1 ) {
-           return regexp.cap( 1 ).replace( "<br>", "\n" );
-       }
-
-       return QString::null;
+    if ( m_bbstype == Kita::Board_FlashCGI ) {
+
+        QRegExp regexp( "<blockquote>(.*)</blockquote>" );
+        int pos = regexp.search( response );
+        if ( pos != -1 ) {
+            return regexp.cap( 1 ).replace( "<br>", "\n" );
+        }
+
+        return QString::null;
     }
-    
+
     QRegExp regexp( "<b>([^<]*)</b>" );
     int pos = regexp.search( response );
     if ( pos != -1 ) {
index 9aaee5d..65fdeb0 100644 (file)
@@ -43,10 +43,10 @@ class KitaWriteView : public KitaWriteDialogBase
     int m_bbstype;
     int m_mode;
 
-    static QCp932Codec* m_cp932Codec;    
-    
+    static QCp932Codec* m_cp932Codec;
+
 public:
-    
+
     KitaWriteView( QWidget* parent, const char* name, const KURL& url, int mode, const QString& newThreadName = QString::null );
     virtual ~KitaWriteView();
     void setMessage( const QString& bodyStr );
@@ -56,7 +56,7 @@ public:
     const QString mail() const;
     const QString body() const;
     const KURL datURL() const;
-    
+
 public slots:
 
     virtual void setFocus();
@@ -66,18 +66,18 @@ public slots:
 
 
 private slots:
-    
+
     void slotRecieveData( KIO::Job*, const QByteArray& );
     void slotPostFinished( KIO::Job* );
     void slotCurrentChanged ( QWidget * w );
     bool slotBodyTextChanged();
-    
+
 private:
+
     QString setPostStr();
     QString setJBBSPostStr();
     QString setFlashCGIPostStr();
-    void logPostMessage();    
+    void logPostMessage();
     int resultCode( const QString& response ) const;
     QString resultMessage( const QString& response ) const;
     QString resultTitle( const QString& response ) const;
index 6bc80cc..faa6d88 100644 (file)
@@ -23,13 +23,13 @@ AbonePrefPage::AbonePrefPage( QWidget *parent, const char *name )
     nameAboneText->setText( KitaConfig::aboneNameList().join( "\n" ) );
     wordAboneText->setText( KitaConfig::aboneWordList().join( "\n" ) );
 
-    connect( idAboneText, SIGNAL( textChanged() ), SLOT( slotTextChanged() ));
-    connect( nameAboneText, SIGNAL( textChanged() ), SLOT( slotTextChanged() ));
-    connect( wordAboneText, SIGNAL( textChanged() ), SLOT( slotTextChanged() ));
+    connect( idAboneText, SIGNAL( textChanged() ), SLOT( slotTextChanged() ) );
+    connect( nameAboneText, SIGNAL( textChanged() ), SLOT( slotTextChanged() ) );
+    connect( wordAboneText, SIGNAL( textChanged() ), SLOT( slotTextChanged() ) );
 
     Kita::SignalCollection* signalCollection = Kita::SignalCollection::getInstance();
     connect( this, SIGNAL( redrawAllHTMLPart( bool ) ),
-             signalCollection, SIGNAL( redrawAllHTMLPart( bool ) ));
+             signalCollection, SIGNAL( redrawAllHTMLPart( bool ) ) );
 
     m_changed = FALSE;
 }
@@ -45,8 +45,7 @@ void AbonePrefPage::slotTextChanged()
 
 void AbonePrefPage::apply()
 {
-    if( m_changed )
-    {
+    if ( m_changed ) {
         QString idText = idAboneText->text();
         QStringList idList = QStringList::split( '\n', idText );
         KitaConfig::setAboneIDList( idList );
index b8ec6eb..d6b6642 100644 (file)
@@ -1,12 +1,12 @@
 /***************************************************************************
- *   Copyright (C) 2004 by Kita Developers                                 *
- *   ikemo@users.sourceforge.jp                                            *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2004 by Kita Developers                                 *
+*   ikemo@users.sourceforge.jp                                            *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 #include "loginprefpage.h"
 
 #include "libkita/kitaconfig.h"
@@ -23,7 +23,7 @@ LoginPrefPage::LoginPrefPage( QWidget *parent )
     userIDLine->setText( KitaConfig::userID() );
     passwordLine->insert( KitaConfig::password() );
     autoLoginCheckBox->setChecked( KitaConfig::autoLogin() );
-    
+
     connect( userIDLine, SIGNAL( textChanged( const QString& ) ), SIGNAL( changed() ) );
     connect( passwordLine, SIGNAL( textChanged( const QString& ) ), SIGNAL( changed() ) );
     connect( autoLoginCheckBox, SIGNAL( toggled( bool ) ), SIGNAL( changed() ) );
index 26eb2bc..8ba39d1 100644 (file)
@@ -1,12 +1,12 @@
 /***************************************************************************
- *   Copyright (C) 2004 by Kita Developers                                 *
- *   ikemo@users.sourceforge.jp                                            *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2004 by Kita Developers                                 *
+*   ikemo@users.sourceforge.jp                                            *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 #ifndef KITALOGINPREFPAGE_H
 #define KITALOGINPREFPAGE_H
 
index 8bbabbd..0528dc8 100644 (file)
@@ -66,8 +66,8 @@ KitaPreferences::KitaPreferences()
     QVBox * loginFrame = addVBoxPage( i18n( "Login" ), i18n( "Login" ) );
     m_loginPage = new Kita::LoginPrefPage( loginFrame );
 
-//    QVBox * debugFrame = addVBoxPage( i18n( "Debug" ), i18n( "Debug" ) );
-//    m_debugPage = new DebugPrefPage( debugFrame );
+    //    QVBox * debugFrame = addVBoxPage( i18n( "Debug" ), i18n( "Debug" ) );
+    //    m_debugPage = new DebugPrefPage( debugFrame );
 
     connect( m_facePage, SIGNAL( changed() ), SLOT( slotChanged() ) );
     connect( m_asciiArtPage, SIGNAL( changed() ), SLOT( slotChanged() ) );
@@ -186,9 +186,9 @@ void DebugPrefPage::replace()
                                      "Are you ready?" ), QMessageBox::Ok,
                                QMessageBox::Cancel | QMessageBox::Default | QMessageBox::Escape ) == QMessageBox::Ok ) {
 
-       if( BoardManager::moveBoard( fromURL, toURL ) )
-           QMessageBox::information( this, i18n( "replace" ), i18n( "Complete." ) );
-       else KMessageBox::error( this, i18n( "replace" ), i18n( "Failed.." ) );
+        if ( BoardManager::moveBoard( fromURL, toURL ) )
+            QMessageBox::information( this, i18n( "replace" ), i18n( "Complete." ) );
+        else KMessageBox::error( this, i18n( "replace" ), i18n( "Failed.." ) );
     }
 }
 
index db2c750..f169a71 100644 (file)
@@ -50,7 +50,7 @@ private:
     Kita::UIPrefPage* m_uiPage;
     Kita::AbonePrefPage* m_abonePage;
     Kita::LoginPrefPage* m_loginPage;
-//    DebugPrefPage* m_debugPage;
+    //    DebugPrefPage* m_debugPage;
 
 private slots:
     void slotChanged();
index 0fd705e..3ee485c 100644 (file)
 
 using namespace Kita;
 
-struct Col_Attr ThreadListView::s_colAttr[] = {
-    // labelName, itemName, keyName, showDefault
-    { I18N_NOOP(" "), I18N_NOOP("Mark"), "Col_Mark", true },
-    { I18N_NOOP("No."), I18N_NOOP("ID"), "Col_ID", true},
-    { I18N_NOOP(" "), I18N_NOOP("Icon"), "Col_Icon", true},
-    { I18N_NOOP("Title"), I18N_NOOP("Subject"), "Col_Subject", true},
-    { I18N_NOOP("ResNum"), I18N_NOOP("ResNum"), "Col_ResNum", true},
-    { I18N_NOOP("ReadNum"), I18N_NOOP("ReadNum"), "Col_ReadNum", true},
-    { I18N_NOOP("ViewPos"), I18N_NOOP("ViewPos"), "Col_ViewPos", false},
-    { I18N_NOOP("Unread"), I18N_NOOP("Unread"), "Col_Unread", true},
-    { I18N_NOOP("Since"), I18N_NOOP("Since"), "Col_Since", true},
-    { I18N_NOOP("Thread's speed"), I18N_NOOP("Speed"), "Col_Speed", true},
-    { I18N_NOOP("Board"), I18N_NOOP("Board"), "Col_Board", false},
-    { I18N_NOOP("Dat URL"), I18N_NOOP("DatURL"), "Col_DatURL", false},
-    { I18N_NOOP("Mark Order"), I18N_NOOP("MarkOrder"), "Col_MarkOrder", false},
-    { I18N_NOOP("ID Order"), I18N_NOOP("IDOrder"), "Col_IDOrder", false}
-};
+struct Col_Attr ThreadListView::s_colAttr[] =
+    {
+        // labelName, itemName, keyName, showDefault
+        { I18N_NOOP( " " ), I18N_NOOP( "Mark" ), "Col_Mark", true },
+        { I18N_NOOP( "No." ), I18N_NOOP( "ID" ), "Col_ID", true},
+        { I18N_NOOP( " " ), I18N_NOOP( "Icon" ), "Col_Icon", true},
+        { I18N_NOOP( "Title" ), I18N_NOOP( "Subject" ), "Col_Subject", true},
+        { I18N_NOOP( "ResNum" ), I18N_NOOP( "ResNum" ), "Col_ResNum", true},
+        { I18N_NOOP( "ReadNum" ), I18N_NOOP( "ReadNum" ), "Col_ReadNum", true},
+        { I18N_NOOP( "ViewPos" ), I18N_NOOP( "ViewPos" ), "Col_ViewPos", false},
+        { I18N_NOOP( "Unread" ), I18N_NOOP( "Unread" ), "Col_Unread", true},
+        { I18N_NOOP( "Since" ), I18N_NOOP( "Since" ), "Col_Since", true},
+        { I18N_NOOP( "Thread's speed" ), I18N_NOOP( "Speed" ), "Col_Speed", true},
+        { I18N_NOOP( "Board" ), I18N_NOOP( "Board" ), "Col_Board", false},
+        { I18N_NOOP( "Dat URL" ), I18N_NOOP( "DatURL" ), "Col_DatURL", false},
+        { I18N_NOOP( "Mark Order" ), I18N_NOOP( "MarkOrder" ), "Col_MarkOrder", false},
+        { I18N_NOOP( "ID Order" ), I18N_NOOP( "IDOrder" ), "Col_IDOrder", false}
+    };
 
 ThreadListView::ThreadListView( QWidget* parent, const char* name )
         : ThreadListViewBase( parent, name )
@@ -53,10 +54,10 @@ ThreadListView::ThreadListView( QWidget* parent, const char* name )
     closeButton->setPixmap( SmallIcon( "fileclose" ) );
 
     QHeader* header = subjectList->header();
-    for( int i = Col_Begin; i <= Col_End; i++ ) {
-        subjectList->addColumn( i18n( s_colAttr[i].labelName ) );
+    for ( int i = Col_Begin; i <= Col_End; i++ ) {
+        subjectList->addColumn( i18n( s_colAttr[ i ].labelName ) );
 
-        if ( s_colAttr[i].showDefault != true ) {
+        if ( s_colAttr[ i ].showDefault != true ) {
             subjectList->setColumnWidthMode( i, QListView::Manual );
             header->setResizeEnabled( false, i );
             subjectList->setColumnWidth( i, 0 );