OSDN Git Service

refactoring.
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sat, 9 Oct 2004 15:47:37 +0000 (15:47 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sat, 9 Oct 2004 15:47:37 +0000 (15:47 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@1432 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/favoritelistview.cpp
kita/src/kitasubjectview.cpp
kita/src/threadlistview.cpp

index 611de14..f7973a7 100644 (file)
@@ -71,8 +71,8 @@ void FavoriteListView::update()
 
     QValueList<QString>::const_iterator it;
     for ( it = threadList.begin(); it != threadList.end(); ++it ) {
-        const Kita::Thread* thread = Kita::Thread::getByURL( *it );
-        QString datURL = thread->datURL();
+        QString datURL = ( *it );
+        const Kita::Thread* thread = Kita::Thread::getByURL( datURL );
 
         QDateTime since;
         since.setTime_t( Kita::datToSince( datURL ) );
@@ -104,10 +104,10 @@ void FavoriteListView::loadThread( QListViewItem* item )
 
     QValueList<QString>::const_iterator it;
     for ( it = threadList.begin(); it != threadList.end(); ++it ) {
-        const Kita::Thread* thread = Kita::Thread::getByURL( *it );
+        QString datURL = ( *it );
 
-        if ( thread->datURL() == item->text( Col_DatURL ) ) {
-            emit openURLRequestExt( thread->datURL(), KParts::URLArgs(), "kita_open_2chthread", 0 );
+        if ( datURL == item->text( Col_DatURL ) ) {
+            emit openURLRequestExt( datURL, KParts::URLArgs(), "kita_open_2chthread", 0 );
         }
     }
 }
@@ -170,8 +170,8 @@ void FavoriteListView::slotReloadButton()
     const QValueList<QString> threadList = FavoriteThreads::getInstance() -> threadList();
     QValueList<QString>::const_iterator it;
     for ( it = threadList.begin(); it != threadList.end(); ++it ) {
-        const Kita::Thread* thread = Kita::Thread::getByURL( *it );
-        QString boardURL = Kita::datToBoard( thread->datURL() );
+        QString datURL = ( *it );
+        QString boardURL = Kita::datToBoard( datURL );
         if ( boardList.contains( boardURL ) == 0 ) {
             boardList.append( boardURL );
         }
index 00b4376..ce592c8 100644 (file)
@@ -103,12 +103,10 @@ void KitaSubjectView::loadThread( QListViewItem* item )
 
     KURL datURL = item->text( Col_DatURL );
 
-    Kita::Thread* thread = Kita::Thread::getByURL( datURL.url() );
-
     if ( KitaConfig::alwaysUseTab() ) {
-        emit openURLRequestExt( thread->datURL(), KParts::URLArgs(), "kita_open_2chthread", 1 );
+        emit openURLRequestExt( datURL.prettyURL(), KParts::URLArgs(), "kita_open_2chthread", 1 );
     } else { 
-        emit openURLRequestExt( thread->datURL(), KParts::URLArgs(), "kita_open_2chthread", 0 );
+        emit openURLRequestExt( datURL.prettyURL(), KParts::URLArgs(), "kita_open_2chthread", 0 );
     }
 }
 /*
index e559825..8567e82 100644 (file)
@@ -172,13 +172,13 @@ void ThreadListView::slotMouseButtonClicked( int button, QListViewItem* item )
 
     switch ( button ) {
     case MidButton:
-        emit openURLRequestExt( thread->datURL(), KParts::URLArgs(), "kita_open_2chthread", 1 );
+        emit openURLRequestExt( datURL.prettyURL(), KParts::URLArgs(), "kita_open_2chthread", 1 );
         break;
     case LeftButton:
         if ( KitaConfig::alwaysUseTab() ) {
-            emit openURLRequestExt( thread->datURL(), KParts::URLArgs(), "kita_open_2chthread", 1 );
+            emit openURLRequestExt( datURL.prettyURL(), KParts::URLArgs(), "kita_open_2chthread", 1 );
         } else {
-            emit openURLRequestExt( thread->datURL(), KParts::URLArgs(), "kita_open_2chthread", 0 );
+            emit openURLRequestExt( datURL.prettyURL(), KParts::URLArgs(), "kita_open_2chthread", 0 );
         }
         break;
     }