OSDN Git Service

refactoring...
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Wed, 21 May 2003 16:10:15 +0000 (16:10 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Wed, 21 May 2003 16:10:15 +0000 (16:10 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@253 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/kitaboardview.cpp

index 5c72ea6..dd0fcbf 100644 (file)
@@ -87,20 +87,10 @@ void KitaBoardView::loadBoardList()
 
     if(file.open(IO_ReadOnly))
     {
-      QString html = stream.read();
+      QPtrList<Kita::Category> categoryList = getCategoryList(stream.read());
 
-      /* boardList*/
-      QStringList lines = QStringList::split("\n", html);
-      QStringList::iterator it;
-
-      QPtrList<Kita::Category> categoryList = getCategoryList(html);
-
-      KListViewItem* current_category = 0;
-      KListViewItem* current_board = 0;
-
-      Kita::Category* category;
       KListViewItem* previous = 0;
-      for(category = categoryList.first(); category; category = categoryList.next())
+      for(Kita::Category* category = categoryList.first(); category; category = categoryList.next())
       {
         QValueList<Kita::Board> board_list = category->getBoardList();
 
@@ -110,38 +100,14 @@ void KitaBoardView::loadBoardList()
 
         KListViewItem* categoryItem = new KListViewItem(boardList, previous, category->name());
 
-        QValueListIterator<Kita::Board> it2;
         KListViewItem* previousBoard = 0;
-        for(it2 = board_list.begin(); it2 != board_list.end(); ++it2)
+        for(QValueListIterator<Kita::Board> it = board_list.begin(); it != board_list.end(); ++it)
         {
-          Kita::Board board = (*it2);
+          Kita::Board board = (*it);
           previousBoard = new KListViewItem(categoryItem, previousBoard, board.name(), board.url().prettyURL());
         }
         previous = categoryItem;
       }
-/*
-      for(it = lines.begin(); it != lines.end(); ++it)
-      {
-        QString category = getCategory(*it);
-        if( category != QString::null ) {
-          KListViewItem* old_category = current_category;
-          current_category = new KListViewItem(boardList, old_category, category);
-
-          if( old_category != 0 && old_category->childCount() == 0 ) {
-            // useless category. remove it!
-            delete old_category;
-          }
-        } else {
-          Kita::Board board = getBoard(*it);
-
-          if( current_category != 0 && isBoardUrl(board.url()) == true ) {
-            current_board = new KListViewItem(current_category, current_board, board.name(), board.url().prettyURL());
-          }
-        }
-      }
-      if ( current_category != 0 && current_category->childCount() == 0 ) {
-        delete current_category;
-      }*/
     }
   }
 }