OSDN Git Service

refactoring.
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Wed, 4 Jul 2007 15:11:35 +0000 (15:11 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Wed, 4 Jul 2007 15:11:35 +0000 (15:11 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@1991 56b19765-1e22-0410-a548-a0f45d66c51a

17 files changed:
kita/src/bbs/bbsview.cpp
kita/src/bbs/bbsview.h
kita/src/board/threadlistview.cpp
kita/src/board/threadlistview.h
kita/src/kitaui/tabwidgetbase.cpp
kita/src/kitaui/tabwidgetbase.h
kita/src/libkita/signalcollection.h
kita/src/mainwindow.cpp
kita/src/mainwindow.h
kita/src/thread/htmlpart.cpp
kita/src/thread/htmlpart.h
kita/src/thread/threadview.cpp
kita/src/thread/threadview.h
kita/src/write/previewpart.cpp
kita/src/write/previewpart.h
kita/src/write/writeview.cpp
kita/src/write/writeview.h

index a9c6f04..af30770 100644 (file)
@@ -105,8 +105,8 @@ KitaBBSView::KitaBBSView( QWidget *parent, const char *name )
     connect( m_boardList, SIGNAL( contextMenuRequested( QListViewItem*, const QPoint&, int ) ),
              SLOT( slotContextMenuRequested( QListViewItem*, const QPoint&, int ) ) );
     connect( Kita::FavoriteBoards::getInstance(), SIGNAL( changed() ), SLOT( refreshFavoriteBoards() ) );
-    connect( this, SIGNAL( openURLRequestExt( const KURL&, const KParts::URLArgs&, QString, int, const KURL& ) ),
-             signalCollection, SIGNAL( openURLRequestExt( const KURL& , const KParts::URLArgs&, QString, int, const KURL& ) ) );
+    connect( this, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
+             signalCollection, SIGNAL( openURLRequestExt( const KURL&, const QString ) ) );
     connect( this, SIGNAL( openBoard( const KURL& ) ), signalCollection, SIGNAL( openBoard( const KURL& ) ) );
     connect( SearchCombo, SIGNAL( textChanged( const QString& ) ),
              SLOT( filter( const QString& ) ) );
@@ -521,7 +521,7 @@ void KitaBBSView::slotContextMenuRequested( QListViewItem* item, const QPoint& p
 
     switch ( popup.exec( point ) ) {
     case Menu_OpenWithBrowser:
-        emit openURLRequestExt( boardURL, KParts::URLArgs(), "text/html" );
+        emit openURLRequestExt( boardURL, "text/html" );
         break;
     case Menu_OpenWithNewTab:
         emit openBoard( boardURL );
index 63f7b14..db7aa54 100644 (file)
@@ -83,10 +83,7 @@ private:
 
 signals:
     void openBoard( const KURL& url );
-    void openURLRequestExt( const KURL& url, const KParts::URLArgs& args = KParts::URLArgs(),
-                            QString mimetype = QString::null,
-                            int usr1 = 0,
-                            const KURL& usrUrl1 = KURL() );
+    void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
     void sigShowSubject();
 };
 
index a22c516..8cad862 100644 (file)
@@ -76,12 +76,8 @@ ThreadListView::ThreadListView( QWidget* parent, const char* name )
              SLOT( slotMouseButtonClicked( int, QListViewItem* ) ) );
     connect( this, SIGNAL( bookmarked( const QString&, bool ) ),
              Kita::SignalCollection::getInstance(), SIGNAL( bookmarked( const QString&, bool ) ) );
-    connect( this, SIGNAL( openURLRequestExt(
-                               const KURL&, const KParts::URLArgs&, QString, int,
-                               const KURL& ) ),
-             Kita::SignalCollection::getInstance(), SIGNAL( openURLRequestExt(
-                         const KURL& , const KParts::URLArgs&, QString, int,
-                         const KURL& ) ) );
+    connect( this, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
+             Kita::SignalCollection::getInstance(), SIGNAL( openURLRequestExt( const KURL&, const QString ) ) );
     connect( this, SIGNAL( openThread( const KURL& ) ),
              Kita::SignalCollection::getInstance(), SIGNAL( openThread( const KURL& ) ) );
 }
index 5f5777a..abd9dfb 100644 (file)
@@ -59,10 +59,7 @@ namespace Kita
         void slotSearchButton();
 
     signals:
-        void openURLRequestExt( const KURL& url, const KParts::URLArgs& args = KParts::URLArgs(),
-                                QString mimetype = QString::null,
-                                int usr1 = 0,
-                                const KURL& usrUrl1 = KURL() );
+        void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
         void openThread( const KURL& url );
         void bookmarked( const QString& datURL, bool on );
     };
index 86f12d3..2ea8db0 100644 (file)
@@ -201,12 +201,8 @@ void KitaTabWidgetBase::connectSignals()
     connect( this, SIGNAL( setMainCaption( const QString& ) ),
              signalCollection, SIGNAL( setMainCaption( const QString& ) ) );
 
-    connect( this, SIGNAL( openURLRequestExt(
-                               const KURL&, const KParts::URLArgs&, QString, int,
-                               const KURL& ) ),
-             signalCollection, SIGNAL( openURLRequestExt(
-                                           const KURL& , const KParts::URLArgs&, QString, int,
-                                           const KURL& ) ) );
+    connect( this, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
+             signalCollection, SIGNAL( openURLRequestExt( const KURL&, const QString ) ) );
 }
 
 
index daf623c..848de51 100644 (file)
@@ -98,10 +98,7 @@ signals:
     void setMainURLLine( const KURL& url );
     void setMainCaption( const QString& captionStr );
     void setMainStatusbar( const QString& statusStr );
-    void openURLRequestExt( const KURL& url, const KParts::URLArgs& args = KParts::URLArgs(),
-                            QString mimetype = QString::null,
-                            int usr1 = 0,
-                            const KURL& usrUrl1 = KURL() );
+    void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
 };
 
 
index 4f96d2f..4967ec7 100644 (file)
@@ -51,9 +51,7 @@ namespace Kita
          * @param usrUrl1 dat's URL(image viewer only)
          *
          */
-        void openURLRequestExt( const KURL& url, const KParts::URLArgs& args = KParts::URLArgs(),
-                                QString mimetype = QString::null,
-                                int usr1 = 0, const KURL& usrUrl1 = KURL() );
+        void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
         void setMainURLLine( const KURL& url );
         void setMainCaption( const QString& captionStr );
         void setMainStatusbar( const QString& statusStr );
index 19c442f..3bae1b1 100644 (file)
@@ -153,12 +153,8 @@ KitaMainWindow::KitaMainWindow()
     connect( signalCollection, SIGNAL( openURLRequest( const KURL&, const KParts::URLArgs& ) ),
              SLOT( slotOpenURLRequest( const KURL&, const KParts::URLArgs& ) ) );
 
-    connect( signalCollection, SIGNAL( openURLRequestExt(
-                                           const KURL&, const KParts::URLArgs&, QString, int,
-                                           const KURL& ) ),
-             SLOT( slotOpenURLRequestExt(
-                       const KURL& , const KParts::URLArgs&, QString, int,
-                       const KURL& ) ) );
+    connect( signalCollection, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
+             SLOT( slotOpenURLRequestExt( const KURL&, const QString ) ) );
 
     connect( signalCollection, SIGNAL( setMainCaption( const QString& ) ),
              SLOT( slotSetMainCaption( const QString& ) ) );
@@ -394,7 +390,7 @@ void KitaMainWindow::slotEditCopy()
 /* open url */ /* public slot */ /* obsolete */
 void KitaMainWindow::slotOpenURLRequest( const KURL& url, const KParts::URLArgs& args )
 {
-    slotOpenURLRequestExt( url, args );
+    slotOpenURLRequestExt( url );
 }
 
 void KitaMainWindow::slotOpenBoard( const KURL& url )
@@ -413,11 +409,7 @@ void KitaMainWindow::slotOpenThread( const KURL& url )
   if mimetype == QString::null, use KIO::NetAccess::mimetype to decide mime type of url.
  
 */  /* public slot */
-void KitaMainWindow::slotOpenURLRequestExt(
-    const KURL& url, const KParts::URLArgs& args,
-    QString mimetype,
-    int usr1,
-    const KURL& usrUrl1 )
+void KitaMainWindow::slotOpenURLRequestExt( const KURL& url, const QString mimetype )
 {
     // FIXME: support be.2ch.net
     if ( url.host() == "be.2ch.net" && url.path().contains( "/test/p.php", true ) < 1 ) {
@@ -428,11 +420,6 @@ void KitaMainWindow::slotOpenURLRequestExt(
     }
 
     kdDebug() << QString( "Requested OpenURL: \"%1\"" ).arg( url.url() ) << endl;
-    kdDebug() << QString( "content type: \"%1\"" ).arg( args.contentType() ) << endl;
-    kdDebug() << QString( "service type: \"%1\"" ).arg( args.serviceType ) << endl;
-    kdDebug() << QString( "NewTab: %1, reload: %2" )
-    .arg( args.newTab() ? "yes" : "no" )
-    .arg( args.reload ? "yes" : "no" ) << endl;
 
     /*  open url with web browser, etc. */
     if ( mimetype != QString::null ) {
@@ -447,11 +434,13 @@ void KitaMainWindow::slotOpenURLRequestExt(
     }
 
     if ( mimetype == QString::null ) {
-        mimetype = KIO::NetAccess::mimetype( url , this );
+        QString url_mimetype = KIO::NetAccess::mimetype( url , this );
+        kdDebug() << QString( "queried MIME type: \"%1\"" ).arg( url_mimetype ) << endl;
+        KRun::runURL( url, url_mimetype );
+    } else {
+        kdDebug() << QString( "queried MIME type: \"%1\"" ).arg( mimetype ) << endl;
+        KRun::runURL( url, mimetype );
     }
-    kdDebug() << QString( "queried MIME type: \"%1\"" ).arg( mimetype ) << endl;
-
-    KRun::runURL( url, mimetype );
 }
 
 void KitaMainWindow::slotSetMainCaption( const QString& captionStr )
index e78c7e1..fc2afd3 100644 (file)
@@ -78,10 +78,7 @@ private slots:
     void slotOpenBoard( const KURL& url );
     void slotOpenThread( const KURL& url );
     void slotOpenURLRequest( const KURL& url, const KParts::URLArgs& );
-    void slotOpenURLRequestExt( const KURL& url, const KParts::URLArgs& args,
-                                QString mimetype = QString::null,
-                                int usr1 = 0,
-                                const KURL& usrUrl1 = KURL() );
+    void slotOpenURLRequestExt( const KURL& url, const QString mimetype = QString::null );
     void slotSetMainCaption( const QString& captionStr );
     void slotSetMainStatusbar( const QString& statusStr );
     void slotURLLine();
index b7fc560..d98e7bc 100644 (file)
@@ -176,12 +176,8 @@ void KitaHTMLPart::connectSignals()
     connect( signalCollection, SIGNAL( windowDeactivated() ), SLOT( slotHideChildPopup() ) );
 
     /* click */
-    connect( this, SIGNAL( openURLRequestExt(
-                               const KURL&, const KParts::URLArgs&, QString, int,
-                               const KURL& ) ),
-             signalCollection, SIGNAL( openURLRequestExt(
-                                           const KURL& , const KParts::URLArgs&, QString, int,
-                                           const KURL& ) ) );
+    connect( this, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
+             signalCollection, SIGNAL( openURLRequestExt( const KURL&, const QString ) ) );
 
     /* write dock */
     connect( this, SIGNAL( activateThreadView( const KURL& ) ),
@@ -889,7 +885,7 @@ void KitaHTMLPart::showPopupMenu( const KURL& kurl )
             break;
 
         case ID_Open_Browser:
-            emit openURLRequestExt( url, KParts::URLArgs(), "text/html" );
+            emit openURLRequestExt( url, "text/html" );
             break;
 
         case ID_Home_Link: gotoAnchor( "header", FALSE ); break;
@@ -1259,7 +1255,7 @@ void KitaHTMLPart::showWritePopupMenu( const QString& refstr )
     case WRITEMENU_SHOWBROWSER:
         str = Kita::DatManager::threadURL( m_datURL ) + "/" + QString().setNum( resNum );
 
-        emit openURLRequestExt( str, KParts::URLArgs(), "text/html" );
+        emit openURLRequestExt( str, "text/html" );
         break;
 
     case WRITEMENU_ABONENAME:
@@ -1373,14 +1369,14 @@ void KitaHTMLPart::showBePopupMenu( const QString& refstr )
             break;
 
         case BEMENU_SHOWBROWSER:
-            emit openURLRequestExt( strURL, KParts::URLArgs(), "text/html" );
+            emit openURLRequestExt( strURL, "text/html" );
             break;
 
         default:
             break;
         }
     } else {
-        emit openURLRequestExt( strURL, KParts::URLArgs(), "text/html" );
+        emit openURLRequestExt( strURL, "text/html" );
     }
 }
 
index 458d195..95e4fd0 100644 (file)
@@ -187,10 +187,7 @@ private slots:
 signals:
 
     void openWriteDialog( QString );
-    void openURLRequestExt( const KURL& url, const KParts::URLArgs& args = KParts::URLArgs(),
-                            QString mimetype = QString::null,
-                            int usr1 = 0,
-                            const KURL& usrUrl1 = KURL() );
+    void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
     void redrawHTMLPart( const KURL& url, bool force );
     void mousePressed(); /* to KitaThreadView */
 
index c85dc64..2e299ac 100644 (file)
@@ -171,12 +171,8 @@ KitaThreadView::KitaThreadView( QWidget* parent, const char* name )
              signalCollection, SIGNAL( updateSubjectTab( const KURL& ) ) );
     connect( this, SIGNAL( updateThreadTab( const KURL& ) ),
              signalCollection, SIGNAL( updateThreadTab( const KURL& ) ) );
-    connect( this, SIGNAL( openURLRequestExt(
-                               const KURL&, const KParts::URLArgs&, QString, int,
-                               const KURL& ) ),
-             signalCollection, SIGNAL( openURLRequestExt(
-                                           const KURL& , const KParts::URLArgs&, QString, int,
-                                           const KURL& ) ) );
+    connect( this, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
+             signalCollection, SIGNAL( openURLRequestExt( const KURL&, const QString ) ) );
     connect( this, SIGNAL( setMainCaption( const QString& ) ),
              signalCollection, SIGNAL( setMainCaption( const QString& ) ) );
     connect( this, SIGNAL( closeThreadTab( const KURL& ) ),
index 191b6a2..ce63e68 100644 (file)
@@ -126,10 +126,7 @@ signals:
     void showThreadCompleted(); /* to KitaThreadPart */
     void closeThreadTab( const KURL& url );
     void closeCurrentTab(); /* to KitaThreadTabWidget */
-    void openURLRequestExt( const KURL& url, const KParts::URLArgs& args = KParts::URLArgs(),
-                            QString mimetype = QString::null,
-                            int usr1 = 0,
-                            const KURL& usrUrl1 = KURL() );
+    void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
 
     void showWriteView( const KURL& , const QString& );
     void activateThreadView( const KURL& );
index d8ec5ac..1317533 100644 (file)
@@ -96,12 +96,8 @@ void KitaPreviewPart::connectSignals()
     connect( signalCollection, SIGNAL( windowDeactivated() ), SLOT( slotHideChildPopup() ) );
 
     /* click */
-    connect( this, SIGNAL( openURLRequestExt(
-                               const KURL&, const KParts::URLArgs&, QString, int,
-                               const KURL& ) ),
-             signalCollection, SIGNAL( openURLRequestExt(
-                                           const KURL& , const KParts::URLArgs&, QString, int,
-                                           const KURL& ) ) );
+    connect( this, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
+             signalCollection, SIGNAL( openURLRequestExt( const KURL&, const QString ) ) );
 }
 
 void KitaPreviewPart::createHTMLDocument()
index 39560d1..fa1101b 100644 (file)
@@ -92,10 +92,7 @@ private slots:
 
 signals:
 
-    void openURLRequestExt( const KURL& url, const KParts::URLArgs& args = KParts::URLArgs(),
-                            QString mimetype = QString::null,
-                            int usr1 = 0,
-                            const KURL& usrUrl1 = KURL() );
+    void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
     void mousePressed(); /* to KitaThreadView */
 
     /* res popup */
index 17a945f..31b01b1 100644 (file)
@@ -95,12 +95,8 @@ void KitaWriteView::initUI()
     connect( buttonCancel, SIGNAL( clicked() ),
              SLOT( slotCancel() ) );
 
-    connect( this, SIGNAL( openURLRequestExt(
-                               const KURL&, const KParts::URLArgs&, QString, int,
-                               const KURL& ) ),
-             signalCollection, SIGNAL( openURLRequestExt(
-                         const KURL& , const KParts::URLArgs&, QString, int,
-                         const KURL& ) ) );
+    connect( this, SIGNAL( openURLRequestExt( const KURL&, const QString ) ),
+             signalCollection, SIGNAL( openURLRequestExt( const KURL&, const QString ) ) );
     connect( this, SIGNAL( openThread( const KURL& ) ), signalCollection, SIGNAL( openThread( const KURL& ) ) );
 
     connect( faceCombo, SIGNAL( activated( const QString& ) ),
index 6a0a2f5..ef9b5b0 100644 (file)
@@ -103,10 +103,7 @@ protected slots:
 
 signals:
 
-    void openURLRequestExt( const KURL& url, const KParts::URLArgs& args = KParts::URLArgs(),
-                            QString mimetype = QString::null,
-                            int usr1 = 0,
-                            const KURL& usrUrl1 = KURL() );
+    void openURLRequestExt( const KURL& url, const QString mimetype = QString::null );
     void openThread( const KURL& url );
     void closeCurrentTab();
 };