From b4083f350dc3d68e1fcec9275ac188327b014e0e Mon Sep 17 00:00:00 2001 From: Noldor Date: Tue, 20 May 2008 17:57:07 +0000 Subject: more QT4 port/fix git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1830 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/help/index.cpp | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 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 8cc7f3ed3..d5e6961fe 100755 --- a/src/modules/help/index.cpp +++ b/src/modules/help/index.cpp @@ -53,13 +53,13 @@ QDataStream &operator>>( QDataStream &s, Document &l ) QDataStream &operator<<( QDataStream &s, const Document &l ) { - s << (Q_INT16)l.docNumber; - s << (Q_INT16)l.frequency; + s << (qint16)l.docNumber; + s << (qint16)l.frequency; return s; } Index::Index( const QString &dp, const QString &hp ) -: QObject( 0, 0 ), dict( 8999 ), docPath( dp ) +: QObject( 0), dict( 8999 ), docPath( dp ) { alreadyHaveDocList = FALSE; lastWindowClosed = FALSE; @@ -67,7 +67,7 @@ Index::Index( const QString &dp, const QString &hp ) } Index::Index( const QStringList &dl, const QString &hp ) -: QObject( 0, 0 ), dict( 8999 ) +: QObject( 0), dict( 8999 ) { docList = dl; alreadyHaveDocList = TRUE; @@ -116,7 +116,7 @@ void Index::setupDocumentList() titleList.clear(); QDir d( docPath ); QString szCur; - QStringList lst = d.entryList( "*.html" ); + QStringList lst = d.entryList( QStringList("*.html") ); QStringList::ConstIterator it = lst.begin(); for ( ; it != lst.end(); ++it ) { @@ -151,7 +151,7 @@ void Index::parseDocument( const QString &filename, int docNum ) return; } QTextStream s( &file ); - QString text = s.read(); + QString text = s.readAll(); if (text.isNull()) return; bool valid = TRUE; const QChar *buf = text.unicode(); @@ -180,7 +180,7 @@ void Index::parseDocument( const QString &filename, int docNum ) } if ( ( c.isLetterOrNumber() || c == '_' ) && i < 63 ) { - str[i] = c.lower(); + str[i] = c.toLower(); ++i; } else { if ( i > 1 ) insertInDict( QString(str,i), docNum ); @@ -250,13 +250,13 @@ void Index::readDocumentList() KviFile f( docListFile ); if ( !f.openForReading() ) return; QTextStream s( &f ); - docList = QStringList::split("[#item#]",s.read()); + docList = s.readAll().split("[#item#]",QString::SkipEmptyParts,Qt::CaseInsensitive); //reading titles KviFile f1( docListFile+".titles" ); if ( !f1.openForReading() ) return; QTextStream s1( &f1 ); - titleList = QStringList::split("[#item#]",s1.read()); + titleList = s1.readAll().split("[#item#]",QString::SkipEmptyParts,Qt::CaseInsensitive); // qDebug(titleList); } @@ -306,7 +306,7 @@ QStringList Index::query( const QStringList &terms, const QStringList &termSeq, } } - if ( !found ) C = minDocs.remove( C ); + if ( !found ) C = minDocs.erase( C ); else ++C; } } @@ -340,10 +340,10 @@ QString Index::getDocumentTitle( const QString &fileName ) } QTextStream s( &file ); - QString text = s.read(); + QString text = s.readAll(); - int start = text.find( "