OSDN Git Service

refactoring.
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 14 Mar 2004 16:19:11 +0000 (16:19 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 14 Mar 2004 16:19:11 +0000 (16:19 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@921 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/favoritelistview.cpp
kita/src/favoritelistview.h
kita/src/kita.cpp
kita/src/kitasubjecttabwidget.cpp
kita/src/kitasubjecttabwidget.h
kita/src/kitasubjectview.cpp
kita/src/kitasubjectview.h
kita/src/kitathreadtabwidget.cpp
kita/src/kitathreadtabwidget.h

index 61724bf..85a93a5 100644 (file)
@@ -95,7 +95,7 @@ void FavoriteListView::loadThread( QListViewItem* item )
         const Kita::Thread* thread = it.current();
 
         if ( thread->datURL() == item->text( Col_DatURL ) ) {
-            emit signalShowThread( thread );
+            emit showThreadRequested( thread, false );
         }
     }
 }
@@ -133,7 +133,7 @@ void FavoriteListView::slotContextMenuRequested( QListViewItem* item, const QPoi
         KRun::runURL( thread->url(), "text/html" );
         break;
     case 1:
-        emit signalShowThreadWithNewTab( thread );
+        emit showThreadRequested( thread, true );
         break;
     case 2:
         clipboard->setText( thread->name() + "\n" + thread->url() );
index d137144..f74edf9 100644 (file)
@@ -59,8 +59,7 @@ signals:
     /**
      * @param thread É½¼¨¤¹¤ë¥¹¥ì
      */
-    void signalShowThread( const Kita::Thread* thread );
-    void signalShowThreadWithNewTab( const Kita::Thread* thread );
+    void showThreadRequested( const Kita::Thread* thread, bool withNewTab );
 };
 
 #endif
index a3b8312..bd20de9 100644 (file)
@@ -94,12 +94,8 @@ KitaMainWindow::KitaMainWindow()
     connect( m_boardView, SIGNAL( openBoardRequested( const QString&, bool ) ),
              m_subjectTab, SLOT( loadBoard( const QString&, bool ) ) );
 
-    connect( m_subjectTab, SIGNAL( signalShowThread( const Kita::Thread* ) ),
-             m_threadTab, SLOT( showThread( const Kita::Thread* ) ) );
-
-    // ad-hoc
-    connect( m_subjectTab, SIGNAL( signalShowThreadWithNewTab( const Kita::Thread* ) ),
-             m_threadTab, SLOT( showThreadWithNewTab( const Kita::Thread* ) ) );
+    connect( m_subjectTab, SIGNAL( showThreadRequested( const Kita::Thread*, bool ) ),
+             m_threadTab, SLOT( showThread( const Kita::Thread*, bool ) ) );
 
     connect( m_threadTab, SIGNAL( thread( const Kita::Thread* ) ),
              m_subjectTab, SLOT( updateThread( const Kita::Thread* ) ) );
index 92b1117..d3f9011 100644 (file)
@@ -82,10 +82,8 @@ void KitaSubjectTabWidget::updateThread( const Kita::Thread* thread )
 
 void KitaSubjectTabWidget::connectSignals( Kita::ThreadListView* view )
 {
-    connect( view, SIGNAL( signalShowThread( const Kita::Thread* ) ),
-             this, SIGNAL( signalShowThread( const Kita::Thread* ) ) );
-    connect( view, SIGNAL( signalShowThreadWithNewTab( const Kita::Thread* ) ),
-             this, SIGNAL( signalShowThreadWithNewTab( const Kita::Thread* ) ) );
+    connect( view, SIGNAL( showThreadRequested( const Kita::Thread*, bool ) ),
+             this, SIGNAL( showThreadRequested( const Kita::Thread*, bool ) ) );
 }
 
 void KitaSubjectTabWidget::slotCurrentChanged( QWidget* widget )
index 09681b8..3415093 100644 (file)
@@ -43,8 +43,7 @@ private slots:
     void deleteView( KitaSubjectView* view );
 
 signals:
-    void signalShowThread( const Kita::Thread* );
-    void signalShowThreadWithNewTab( const Kita::Thread* );
+    void showThreadRequested( const Kita::Thread*, bool withNewTab );
     void loadBoardCompleted( const KURL& );
 };
 
index 7d77981..ede484a 100644 (file)
@@ -83,7 +83,7 @@ void KitaSubjectView::loadThread( QListViewItem* item )
 
     Kita::Thread* thread = Kita::Thread::getByURL( datURL.url() );
 
-    emit signalShowThread( thread );
+    emit showThreadRequested( thread, false );
 }
 
 void KitaSubjectView::loadBoard( const Kita::Board* board )
@@ -200,7 +200,7 @@ void KitaSubjectView::slotContextMenuRequested( QListViewItem* item, const QPoin
         KRun::runURL( thread->url(), "text/html" );
         break;
     case 1:
-        emit signalShowThreadWithNewTab( thread );
+        emit showThreadRequested( thread, true );
         break;
     case 2:
         clipboard->setText( thread->name() + "\n" + thread->url() );
@@ -227,10 +227,10 @@ void KitaSubjectView::slotMouseButtonClicked( int button, QListViewItem* item )
 
     switch ( button ) {
     case MidButton:
-        emit signalShowThreadWithNewTab( thread );
+        emit showThreadRequested( thread, true );
         break;
     case LeftButton:
-        emit signalShowThread( thread );
+        emit showThreadRequested( thread, false );
         break;
     }
 }
index 012ca5d..c5c27cb 100644 (file)
@@ -50,8 +50,7 @@ private slots:
 
 signals:
     void loadBoardCompleted( const KURL& );
-    void signalShowThread( const Kita::Thread* thread );
-    void signalShowThreadWithNewTab( const Kita::Thread* thread );
+    void showThreadRequested( const Kita::Thread* thread, bool withNewTab );
 };
 
 #endif
index 398c98a..bec4f61 100644 (file)
@@ -66,6 +66,15 @@ void KitaThreadTabWidget::showThread( const QString& datURL, bool withNewTab )
     }
 }
 
+void KitaThreadTabWidget::showThread( const Kita::Thread* thread, bool withNewTab )
+{
+    if ( withNewTab ) {
+        showThreadWithNewTab( thread );
+    } else {
+        showThread( thread );
+    }
+}
+
 KitaThreadView* KitaThreadTabWidget::createView()
 {
     KLibFactory * factory = KLibLoader::self() ->factory( "libkitapart" );
index 1343588..7d26f64 100644 (file)
@@ -39,6 +39,7 @@ public:
 public slots:
     void showThread( const Kita::Thread* thread );
     void showThread( const QString& datURL, bool withNewTab = false );
+    void showThread( const Kita::Thread* thread, bool withNewTab );
     void showThreadWithNewTab( const Kita::Thread* thread ); // ad-hoc
     void deleteView( KitaThreadView* );
     void reloadThread();