OSDN Git Service

url line works.
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Fri, 2 Jan 2004 16:26:49 +0000 (16:26 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Fri, 2 Jan 2004 16:26:49 +0000 (16:26 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@773 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/kita.cpp
kita/src/kitathreadtabwidget.cpp
kita/src/kitathreadtabwidget.h

index d6ec32b..8db503e 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "libkita/thread.h"
 #include "libkita/favoritethreads.h"
+#include "libkita/kita_misc.h"
 
 #include <qdragobject.h>
 #include <qtextcodec.h>
@@ -117,6 +118,9 @@ KitaMainWindow::KitaMainWindow()
     connect( m_threadView, SIGNAL( bookmarked( const Kita::Thread*, bool ) ),
              SLOT( bookmark( const Kita::Thread*, bool ) ) );
 
+    connect( m_urlLine, SIGNAL( returnPressed() ),
+             SLOT( slotUrlLine() ) );
+
     QPopupMenu* popup = static_cast<QPopupMenu *>( factory() ->container( "window", this ) );
     connect( popup, SIGNAL( aboutToShow() ),
              SLOT( windowMenuAboutToShow() ) );
@@ -236,7 +240,9 @@ void KitaMainWindow::setupActions()
 
 void KitaMainWindow::slotUrlLine()
 {
-    kdDebug() << __func__;
+    QString text = m_urlLine->text();
+    QString datURL = Kita::threadToDat( text );
+    m_threadView->showThread( datURL );
 }
 
 void KitaMainWindow::writeConfig( KConfig* config )
index 1c4e664..c9f2739 100644 (file)
@@ -54,6 +54,16 @@ void KitaThreadTabWidget::showThread( const Kita::Thread* thread )
     setTabToolTip( currentPage(), thread->name() );
 }
 
+void KitaThreadTabWidget::showThread( const QString& datURL, bool withNewTab )
+{
+    Kita::Thread* thread = Kita::Thread::getByURL( datURL );
+    if ( withNewTab ) {
+        showThreadWithNewTab( thread );
+    } else {
+        showThread( thread );
+    }
+}
+
 KitaThreadView* KitaThreadTabWidget::createView()
 {
     KLibFactory * factory = KLibLoader::self() ->factory( "libkitapart" );
index 863bead..0e08615 100644 (file)
@@ -40,6 +40,7 @@ public:
 
 public slots:
     void showThread( const Kita::Thread* thread );
+    void showThread( const QString& datURL, bool withNewTab = false );
     void showThreadWithNewTab( const Kita::Thread* thread ); // ad-hoc
     void deleteView( KitaThreadView* );