From: ikemo Date: Fri, 2 Jan 2004 16:26:49 +0000 (+0000) Subject: url line works. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=9a4901b827a4e975f6cbf776c752313977b2ad1e;p=kita%2Fkita.git url line works. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@773 56b19765-1e22-0410-a548-a0f45d66c51a --- diff --git a/kita/src/kita.cpp b/kita/src/kita.cpp index d6ec32b..8db503e 100644 --- a/kita/src/kita.cpp +++ b/kita/src/kita.cpp @@ -19,6 +19,7 @@ #include "libkita/thread.h" #include "libkita/favoritethreads.h" +#include "libkita/kita_misc.h" #include #include @@ -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( 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 ) diff --git a/kita/src/kitathreadtabwidget.cpp b/kita/src/kitathreadtabwidget.cpp index 1c4e664..c9f2739 100644 --- a/kita/src/kitathreadtabwidget.cpp +++ b/kita/src/kitathreadtabwidget.cpp @@ -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" ); diff --git a/kita/src/kitathreadtabwidget.h b/kita/src/kitathreadtabwidget.h index 863bead..0e08615 100644 --- a/kita/src/kitathreadtabwidget.h +++ b/kita/src/kitathreadtabwidget.h @@ -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* );