}
m_favorites->setColor( m_textColor, m_baseColor );
+ // remove all items.
do {
QListViewItem* child = m_favorites->firstChild();
delete child;
} while ( m_favorites->childCount() != 0 );
+ // insert items.
QValueList<KURL> boards = Kita::FavoriteBoards::boards();
QValueList<KURL>::iterator it;
for ( it = boards.begin(); it != boards.end(); ++it ) {
- QString boardURL = Kita::BoardManager::boardURL( ( *it ) ); /* get up-to-date URL */
- QString boardName = Kita::BoardManager::boardName( boardURL );
- Kita::ListViewItem* tmpitem = new Kita::ListViewItem( m_favorites, 0, boardName, boardURL );
- tmpitem->setColor( m_textColor, m_baseColor );
+ KURL boardURL = *it;
+ QString boardURL_upToDate = Kita::BoardManager::boardURL( boardURL ); /* get up-to-date URL */
+ QString boardName = Kita::BoardManager::boardName( boardURL_upToDate );
+
+ Kita::ListViewItem* item = new Kita::ListViewItem( m_favorites, 0, boardName, boardURL_upToDate );
+ item->setColor( m_textColor, m_baseColor );
}
}