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();
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;
- }*/
}
}
}