aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/help
diff options
context:
space:
mode:
authorGravatar Noldor2008-05-20 19:51:42 +0000
committerGravatar Noldor2008-05-20 19:51:42 +0000
commita8c698db5dd1be34ae0fddd6bd3f2649f520dc18 (patch)
treea2cd22b91ceced505470d012e9b63e1555ff8326 /src/modules/help
parentmore module help qt4 port (wip) (diff)
downloadKVIrc-a8c698db5dd1be34ae0fddd6bd3f2649f520dc18.tar.gz
KVIrc-a8c698db5dd1be34ae0fddd6bd3f2649f520dc18.tar.bz2
KVIrc-a8c698db5dd1be34ae0fddd6bd3f2649f520dc18.zip
fix
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1832 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/help')
-rw-r--r--src/modules/help/helpwindow.cpp14
-rw-r--r--src/modules/help/helpwindow.h4
2 files changed, 10 insertions, 8 deletions
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<int> 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();
};