KitaBoardView::~KitaBoardView()
{}
+QString KitaBoardView::getCategory(QString line)
+{
+ QRegExp regexp("<BR><BR><B>(.*)</B><BR>", false);
+ if(regexp.search(line) != -1) {
+ return regexp.cap(1);
+ } else {
+ return QString::null;
+ }
+}
+
void KitaBoardView::loadBoardList()
{
QString tmpFile;
QRegExp url_2ch("http://.*\\.2ch\\.net/.*");
QRegExp url_bbspink("http://.*\\.bbspink\\.com/.*");
QRegExp url_www_2ch("http://www\\.2ch\\.net/.*");
-
+
KListViewItem* current_category = 0;
KListViewItem* current_board = 0;
for(it = lines.begin(); it != lines.end(); ++it)
{
- if(category_r.search(*it) != -1)
- {
- QString category = category_r.cap(1);
-
+ 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;