From a8c698db5dd1be34ae0fddd6bd3f2649f520dc18 Mon Sep 17 00:00:00 2001 From: Noldor Date: Tue, 20 May 2008 19:51:42 +0000 Subject: fix git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1832 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/help/helpwindow.cpp | 14 ++++++++------ src/modules/help/helpwindow.h | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src/modules') diff --git a/src/modules/help/helpwindow.cpp b/src/modules/help/helpwindow.cpp index 7ffdb3cb2..fd0d0739c 100644 --- a/src/modules/help/helpwindow.cpp +++ b/src/modules/help/helpwindow.cpp @@ -96,7 +96,7 @@ KviHelpWindow::KviHelpWindow(KviFrame * lpFrm,const char * name) m_pIndexListWidget = new KviTalListWidget(m_pIndexTab); QStringList docList=g_pDocIndex->titlesList(); m_pIndexListWidget->addItems(docList); - connect(m_pIndexListWidget,SIGNAL(selected(int)),this,SLOT(indexSelected ( int ))); + connect(m_pIndexListWidget,SIGNAL(itemActivated(QListWidgetItem *)),this,SLOT(indexSelected (QListWidgetItem * ))); m_pIndexListWidget->sortItems(); m_pSearchTab = new KviTalVBox(m_pTabWidget); @@ -109,7 +109,7 @@ KviHelpWindow::KviHelpWindow(KviFrame * lpFrm,const char * name) this, SLOT( startSearch() ) ); m_pResultBox = new KviTalListWidget(m_pSearchTab); - connect(m_pResultBox,SIGNAL(selected(int)),this,SLOT(searchSelected ( int ))); + connect(m_pResultBox,SIGNAL(itemActivated(QListWidgetItem *)),this,SLOT(searchSelected (QListWidgetItem *))); KviValueList li; li.append(width()-80); @@ -261,15 +261,17 @@ void KviHelpWindow::searchInIndex( const QString &s ) } } -void KviHelpWindow::indexSelected ( int index ) +void KviHelpWindow::indexSelected ( QListWidgetItem *item ) { - int i=g_pDocIndex->titlesList().indexOf(m_pIndexListWidget->item(index)->text()); + if (!item) return; + int i=g_pDocIndex->titlesList().indexOf(item->text()); textBrowser()->setSource(QUrl(g_pDocIndex->documentList()[ i ])); } -void KviHelpWindow::searchSelected ( int index ) +void KviHelpWindow::searchSelected ( QListWidgetItem *item ) { - int i=g_pDocIndex->titlesList().findIndex(m_pResultBox->item(index)->text()); + if (!item) return; + int i=g_pDocIndex->titlesList().findIndex(item->text()); textBrowser()->setSource(QUrl(g_pDocIndex->documentList()[ i ])); } diff --git a/src/modules/help/helpwindow.h b/src/modules/help/helpwindow.h index fbe5c028b..888116d41 100644 --- a/src/modules/help/helpwindow.h +++ b/src/modules/help/helpwindow.h @@ -65,11 +65,11 @@ public: virtual QSize sizeHint() const; QTextBrowser * textBrowser(); public slots: - void indexSelected ( int ); + void indexSelected ( QListWidgetItem * ); void searchInIndex( const QString &s ); void showIndexTopic(); void startSearch(); - void searchSelected ( int index ); + void searchSelected ( QListWidgetItem * ); void refreshIndex(); }; -- cgit v1.3.1-10-gc9f91