diff options
Diffstat (limited to 'src/modules/help')
| -rw-r--r-- | src/modules/help/helpwindow.cpp | 30 | ||||
| -rwxr-xr-x | src/modules/help/index.cpp | 24 | ||||
| -rwxr-xr-x | src/modules/help/index.h | 14 |
3 files changed, 34 insertions, 34 deletions
diff --git a/src/modules/help/helpwindow.cpp b/src/modules/help/helpwindow.cpp index b10db335b..ceae44f98 100644 --- a/src/modules/help/helpwindow.cpp +++ b/src/modules/help/helpwindow.cpp @@ -30,9 +30,9 @@ #include "kvi_locale.h" #include "kvi_module.h" #include "kvi_config.h" -#include "kvi_valuelist.h" #include "kvi_sourcesdate.h" +#include <QList> #include <QFileInfo> #include <QSplitter> #include <QLineEdit> @@ -51,10 +51,10 @@ KviHelpWindow::KviHelpWindow(KviFrame * lpFrm,const char * name) if(!g_bIndexingDone) { QString szDoclist,szDict; - + g_pApp->getLocalKvircDirectory(szDoclist,KviApp::Help,"help.doclist." KVI_SOURCES_DATE); g_pApp->getLocalKvircDirectory(szDict,KviApp::Help,"help.dict." KVI_SOURCES_DATE); - + if ( QFileInfo( szDoclist ).exists() && QFileInfo( szDict ).exists() ) { g_pDocIndex->readDict(); } else { @@ -67,7 +67,7 @@ KviHelpWindow::KviHelpWindow(KviFrame * lpFrm,const char * name) } g_bIndexingDone=TRUE; } - + g_pHelpWindowList->append(this); m_pSplitter = new QSplitter(Qt::Horizontal,this); m_pSplitter->setObjectName("main_splitter"); @@ -76,41 +76,41 @@ KviHelpWindow::KviHelpWindow(KviFrame * lpFrm,const char * name) m_pToolBar=new KviTalVBox(m_pSplitter); m_pTabWidget = new QTabWidget(m_pToolBar); - + m_pIndexTab = new KviTalVBox(m_pTabWidget); m_pTabWidget->addTab(m_pIndexTab,__tr2qs("Index")); - + KviTalHBox* pSearchBox = new KviTalHBox(m_pIndexTab); m_pIndexSearch = new QLineEdit(pSearchBox); connect( m_pIndexSearch, SIGNAL( textChanged(const QString&) ), this, SLOT( searchInIndex(const QString&) ) ); connect( m_pIndexSearch, SIGNAL( returnPressed() ), this, SLOT( showIndexTopic() ) ); - + QToolButton* pBtnRefreshIndex = new QToolButton(pSearchBox); pBtnRefreshIndex->setIcon(*g_pIconManager->getBigIcon(KVI_REFRESH_IMAGE_NAME)); connect(pBtnRefreshIndex,SIGNAL(clicked()),this,SLOT(refreshIndex())); pBtnRefreshIndex->setToolTip(__tr2qs("Refresh index") ); - + m_pIndexListWidget = new KviTalListWidget(m_pIndexTab); QStringList docList=g_pDocIndex->titlesList(); m_pIndexListWidget->addItems(docList); connect(m_pIndexListWidget,SIGNAL(itemActivated(QListWidgetItem *)),this,SLOT(indexSelected (QListWidgetItem * ))); m_pIndexListWidget->sortItems(); - + m_pSearchTab = new KviTalVBox(m_pTabWidget); m_pTabWidget->addTab(m_pSearchTab,__tr2qs("Search")); - + m_pTermsEdit = new QLineEdit(m_pSearchTab); /* connect( m_pTermsEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( searchInIndex(const QString&) ) );*/ connect( m_pTermsEdit, SIGNAL( returnPressed() ), this, SLOT( startSearch() ) ); - + m_pResultBox = new KviTalListWidget(m_pSearchTab); connect(m_pResultBox,SIGNAL(itemActivated(QListWidgetItem *)),this,SLOT(searchSelected (QListWidgetItem *))); - - KviValueList<int> li; + + QList<int> li; li.append(width()-80); li.append(80); m_pSplitter->setSizes(li); @@ -130,7 +130,7 @@ void KviHelpWindow::saveProperties(KviConfig *cfg) void KviHelpWindow::loadProperties(KviConfig *cfg) { - KviValueList<int> def; + QList<int> def; int w = width(); def.append((w * 82) / 100); def.append((w * 18) / 100); @@ -201,7 +201,7 @@ void KviHelpWindow::startSearch() setCursor( Qt::WaitCursor ); m_foundDocs.clear(); m_foundDocs = g_pDocIndex->query( m_terms, termSeq, seqWords ); - + m_pResultBox->clear(); for ( it = m_foundDocs.begin(); it != m_foundDocs.end(); ++it ) m_pResultBox->addItem( g_pDocIndex->getDocumentTitle( *it ) ); diff --git a/src/modules/help/index.cpp b/src/modules/help/index.cpp index a7648b8f5..2ab2dbe3c 100755 --- a/src/modules/help/index.cpp +++ b/src/modules/help/index.cpp @@ -234,7 +234,7 @@ void Index::readDict() dict.clear(); QDataStream s( &f ); QString key; - KviValueList<Document> docs; + QList<Document> docs; while ( !s.atEnd() ) { s >> key; s >> docs; @@ -268,7 +268,7 @@ QStringList Index::query( const QStringList &terms, const QStringList &termSeq, for ( it = terms.begin(); it != terms.end(); ++it ) { Entry *e = 0; if ( (*it).contains( '*' ) ) { - KviValueList<Document> wcts = setupDummyTerm( getWildcardTerms( *it ) ); + QList<Document> wcts = setupDummyTerm( getWildcardTerms( *it ) ); termList.append( new Term( "dummy", wcts.count(), wcts ) ); } else if ( dict[ *it ] ) { e = dict[ *it ]; @@ -284,14 +284,14 @@ QStringList Index::query( const QStringList &terms, const QStringList &termSeq, termList.removeFirst(); - KviValueList<Document> minDocs = minTerm->documents; - KviValueList<Document>::iterator C; - KviValueList<Document>::ConstIterator It; + QList<Document> minDocs = minTerm->documents; + QList<Document>::iterator C; + QList<Document>::ConstIterator It; Term *t = termList.first(); for ( ; t; t = termList.next() ) { - KviValueList<Document> docs = t->documents; + QList<Document> docs = t->documents; C = minDocs.begin(); @@ -425,7 +425,7 @@ QStringList Index::split( const QString &str ) return lst; } -KviValueList<Document> Index::setupDummyTerm( const QStringList &terms ) +QList<Document> Index::setupDummyTerm( const QStringList &terms ) { TermList termList; QStringList::ConstIterator it = terms.begin(); @@ -441,17 +441,17 @@ KviValueList<Document> Index::setupDummyTerm( const QStringList &terms ) termList.sort(); - KviValueList<Document> maxList; + QList<Document> maxList; if ( !termList.count() ) return maxList; maxList = termList.last()->documents; termList.removeLast(); - KviValueList<Document>::iterator docIt; + QList<Document>::iterator docIt; Term *t = termList.first(); while ( t ) { - KviValueList<Document> docs = t->documents; + QList<Document> docs = t->documents; for ( docIt = docs.begin(); docIt != docs.end(); ++docIt ) { if ( maxList.indexOf( *docIt ) == -1 ) maxList.append( *docIt ); @@ -532,8 +532,8 @@ bool Index::searchForPattern( const QStringList &patterns, const QStringList &wo QStringList::ConstIterator patIt = patterns.begin(); QStringList wordLst; - KviValueList<uint> a, b; - KviValueList<uint>::iterator aIt; + QList<uint> a, b; + QList<uint>::iterator aIt; for ( ; patIt != patterns.end(); ++patIt ) { QString tmp=*patIt; diff --git a/src/modules/help/index.h b/src/modules/help/index.h index c2ede4756..791c11275 100755 --- a/src/modules/help/index.h +++ b/src/modules/help/index.h @@ -28,8 +28,8 @@ #include "kvi_pointerhashtable.h" #include "kvi_pointerlist.h" -#include "kvi_valuelist.h" +#include <QList> #include <QDataStream> #include <QObject> #include <QStringList> @@ -62,12 +62,12 @@ class Index : public QObject public: struct Entry { Entry( int d ) { documents.append( Document( d, 1 ) ); } - Entry( KviValueList<Document> l ) : documents( l ) {} - KviValueList<Document> documents; + Entry( QList<Document> l ) : documents( l ) {} + QList<Document> documents; }; struct PosEntry { PosEntry( int p ) { positions.append( p ); } - KviValueList<uint> positions; + QList<uint> positions; }; Index( const QString &dp, const QString &hp ); Index( const QStringList &dl, const QString &hp ); @@ -92,7 +92,7 @@ private: void insertInDict( const QString&, int ); QStringList getWildcardTerms( const QString& ); QStringList split( const QString& ); - KviValueList<Document> setupDummyTerm( const QStringList& ); + QList<Document> setupDummyTerm( const QStringList& ); bool searchForPattern( const QStringList&, const QStringList&, const QString& ); void buildMiniDict( const QString& ); QStringList docList; @@ -107,11 +107,11 @@ private: }; struct Term { - Term( const QString &t, int f, KviValueList<Document> l ) + Term( const QString &t, int f, QList<Document> l ) : term( t ), frequency( f ), documents( l ) {} QString term; int frequency; - KviValueList<Document>documents; + QList<Document>documents; }; #define TermList KviPointerList<Term> |
