From af73251aa2b0dc2107ca867e2f4688193d01dbe4 Mon Sep 17 00:00:00 2001 From: Szymon Tomasz Stefanek Date: Tue, 6 Mar 2007 02:37:37 +0000 Subject: Icons and some Qt4 fixes git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@410 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/help/index.cpp | 48 +++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 22 deletions(-) (limited to 'src/modules/help/index.cpp') diff --git a/src/modules/help/index.cpp b/src/modules/help/index.cpp index d4ca466d9..540273d0e 100755 --- a/src/modules/help/index.cpp +++ b/src/modules/help/index.cpp @@ -54,7 +54,7 @@ -#include +#include "kvi_file.h" #include @@ -64,7 +64,7 @@ #include - +#include #include @@ -265,8 +265,8 @@ void Index::insertInDict( const QString &str, int docNum ) void Index::parseDocument( const QString &filename, int docNum ) { - QFile file( filename ); - if ( !file.open( IO_ReadOnly ) ) { + KviFile file( filename ); + if ( !file.openForReading() ) { qWarning( "can not open file " + filename ); return; } @@ -339,9 +339,9 @@ void Index::writeDict() KviDictIterator it( dict ); - QFile f( dictFile ); + KviFile f( dictFile ); - if ( !f.open( IO_WriteOnly | IO_Truncate ) ) + if ( !f.openForWriting() ) return; @@ -368,15 +368,15 @@ void Index::writeDict() void Index::writeDocumentList() { - QFile f( docListFile ); - if ( !f.open( IO_WriteOnly | IO_Truncate ) ) + KviFile f( docListFile ); + if ( !f.openForWriting() ) return; QTextStream s( &f ); QString docs = docList.join("[#item#]"); s << docs; - QFile f1( docListFile+".titles" ); - if ( !f1.open( IO_WriteOnly | IO_Truncate ) ) + KviFile f1( docListFile+".titles" ); + if ( !f1.openForWriting() ) return; QTextStream s1( &f1 ); docs = titleList.join("[#item#]"); @@ -388,8 +388,8 @@ void Index::writeDocumentList() void Index::readDict() { - QFile f( dictFile ); - if ( !f.open( IO_ReadOnly ) ) + KviFile f( dictFile ); + if ( !f.openForReading() ) return; dict.clear(); QDataStream s( &f ); @@ -409,15 +409,15 @@ void Index::readDict() void Index::readDocumentList() { //reading docs - QFile f( docListFile ); - if ( !f.open( IO_ReadOnly ) ) + KviFile f( docListFile ); + if ( !f.openForReading() ) return; QTextStream s( &f ); docList = QStringList::split("[#item#]",s.read()); //reading titles - QFile f1( docListFile+".titles" ); - if ( !f1.open( IO_ReadOnly ) ) + KviFile f1( docListFile+".titles" ); + if ( !f1.openForReading() ) return; QTextStream s1( &f1 ); titleList = QStringList::split("[#item#]",s1.read()); @@ -522,8 +522,9 @@ QStringList Index::query( const QStringList &terms, const QStringList &termSeq, QStringList results; +#ifndef COMPILE_USE_QT4 qHeapSort( minDocs ); - +#endif if ( termSeq.isEmpty() ) { for ( C = minDocs.begin(); C != minDocs.end(); ++C ) @@ -558,9 +559,9 @@ QString Index::getDocumentTitle( const QString &fileName ) { - QFile file( fileName ); + KviFile file( fileName ); - if ( !file.open( IO_ReadOnly ) ) { + if ( !file.openForReading() ) { qWarning( "cannot open file " + fileName ); @@ -596,8 +597,11 @@ QStringList Index::getWildcardTerms( const QString &term ) QStringList terms = split( term ); +#ifdef COMPILE_USE_QT4 + QStringList::Iterator iter; +#else KviValueList::iterator iter; - +#endif KviDictIterator it( dict ); @@ -804,9 +808,9 @@ bool Index::searchForPattern( const QStringList &patterns, const QStringList &wo { - QFile file( fileName ); + KviFile file( fileName ); - if ( !file.open( IO_ReadOnly ) ) { + if ( !file.openForReading() ) { qWarning( "cannot open file " + fileName ); -- cgit v1.3.1-10-gc9f91