OSDN Git Service

move board( not tested! )
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 17 Apr 2005 12:34:29 +0000 (12:34 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 17 Apr 2005 12:34:29 +0000 (12:34 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@1711 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/bbs/bbsview.cpp

index 4350e8c..60e729b 100644 (file)
@@ -135,6 +135,10 @@ bool KitaBBSView::isBoardURL( const QString& url ) const
  */
 bool KitaBBSView::downloadBoardList()
 {
+    // moved urls.
+    QValueList<QString> oldURLs;
+    QValueList<QString> newURLs;
+    
     QString tmpFile;
     QString url = KitaConfig::boardListURL();
     if ( !
@@ -183,6 +187,8 @@ bool KitaBBSView::downloadBoardList()
             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++;
+            oldURLs += oldURL;
+            newURLs += boardURL;
         }
     }
 
@@ -233,6 +239,14 @@ bool KitaBBSView::downloadBoardList()
         return FALSE;
     }
 
+    // if moved URL exists. move files.
+    for( int i=0; i<oldURLs.count(); i++ ) {
+        QString oldURL = oldURLs[ i ];
+        QString newURL = newURLs[ i ];
+        
+        qDebug("move %s -> %s", oldURL.latin1(), newURL.latin1());
+        Kita::BoardManager::moveBoard( oldURL, newURL );
+    }
     /*------------------------------------------------*/
 
     /* save config */