summaryrefslogtreecommitdiffstats
path: root/tools/assistant/index.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/assistant/index.cpp')
-rw-r--r--tools/assistant/index.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/tools/assistant/index.cpp b/tools/assistant/index.cpp
index 37de8a85a..d41a744eb 100644
--- a/tools/assistant/index.cpp
+++ b/tools/assistant/index.cpp
@@ -67,8 +67,8 @@ TQDataStream &operator<<( TQDataStream &s, const Document &l )
Index::Index( const TQString &dp, const TQString &hp )
: TQObject( 0, 0 ), dict( 8999 ), docPath( dp )
{
- alreadyHaveDocList = FALSE;
- lastWindowClosed = FALSE;
+ alreadyHaveDocList = false;
+ lastWindowClosed = false;
connect( tqApp, TQ_SIGNAL( lastWindowClosed() ),
this, TQ_SLOT( setLastWinClosed() ) );
}
@@ -77,15 +77,15 @@ Index::Index( const TQStringList &dl, const TQString &hp )
: TQObject( 0, 0 ), dict( 8999 )
{
docList = dl;
- alreadyHaveDocList = TRUE;
- lastWindowClosed = FALSE;
+ alreadyHaveDocList = true;
+ lastWindowClosed = false;
connect( tqApp, TQ_SIGNAL( lastWindowClosed() ),
this, TQ_SLOT( setLastWinClosed() ) );
}
void Index::setLastWinClosed()
{
- lastWindowClosed = TRUE;
+ lastWindowClosed = true;
}
void Index::setDictionaryFile( const TQString &f )
@@ -167,7 +167,7 @@ void Index::parseDocument( const TQString &filename, int docNum )
if (text.isNull())
return;
- bool valid = TRUE;
+ bool valid = true;
const TQChar *buf = text.unicode();
TQChar str[64];
TQChar c = buf[0];
@@ -175,7 +175,7 @@ void Index::parseDocument( const TQString &filename, int docNum )
int i = 0;
while ( (uint)j < text.length() ) {
if ( c == '<' || c == '&' ) {
- valid = FALSE;
+ valid = false;
if ( i > 1 )
insertInDict( TQString(str,i), docNum );
i = 0;
@@ -183,7 +183,7 @@ void Index::parseDocument( const TQString &filename, int docNum )
continue;
}
if ( ( c == '>' || c == ';' ) && !valid ) {
- valid = TRUE;
+ valid = true;
c = buf[++j];
continue;
}
@@ -291,11 +291,11 @@ TQStringList Index::query( const TQStringList &terms, const TQStringList &termSe
TQValueList<Document> docs = t->documents;
C = minDocs.begin();
while ( C != minDocs.end() ) {
- bool found = FALSE;
+ bool found = false;
for ( It = docs.begin(); It != docs.end(); ++It ) {
if ( (*C).docNumber == (*It).docNumber ) {
(*C).frequency += (*It).frequency;
- found = TRUE;
+ found = true;
break;
}
}
@@ -333,8 +333,8 @@ TQString Index::getDocumentTitle( const TQString &fileName )
TQTextStream s( &file );
TQString text = s.read();
- int start = text.find( "<title>", 0, FALSE ) + 7;
- int end = text.find( "</title>", 0, FALSE );
+ int start = text.find( "<title>", 0, false ) + 7;
+ int end = text.find( "</title>", 0, false );
TQString title = ( end - start <= 0 ? tr("Untitled") : text.mid( start, end - start ) );
return title;
@@ -349,31 +349,31 @@ TQStringList Index::getWildcardTerms( const TQString &term )
TQDictIterator<Entry> it( dict );
for( ; it.current(); ++it ) {
int index = 0;
- bool found = FALSE;
+ bool found = false;
TQString text( it.currentKey() );
for ( iter = terms.begin(); iter != terms.end(); ++iter ) {
if ( *iter == "*" ) {
- found = TRUE;
+ found = true;
continue;
}
if ( iter == terms.begin() && (*iter)[0] != text[0] ) {
- found = FALSE;
+ found = false;
break;
}
index = text.find( *iter, index );
if ( *iter == terms.last() && index != (int)text.length()-1 ) {
index = text.findRev( *iter );
if ( index != (int)text.length() - (int)(*iter).length() ) {
- found = FALSE;
+ found = false;
break;
}
}
if ( index != -1 ) {
- found = TRUE;
+ found = true;
index += (*iter).length();
continue;
} else {
- found = FALSE;
+ found = false;
break;
}
}
@@ -451,7 +451,7 @@ bool Index::searchForPattern( const TQStringList &patterns, const TQStringList &
TQFile file( fileName );
if ( !file.open( IO_ReadOnly ) ) {
tqWarning( "cannot open file " + fileName );
- return FALSE;
+ return false;
}
wordNum = 3;
@@ -462,7 +462,7 @@ bool Index::searchForPattern( const TQStringList &patterns, const TQStringList &
TQTextStream s( &file );
TQString text = s.read();
- bool valid = TRUE;
+ bool valid = true;
const TQChar *buf = text.unicode();
TQChar str[64];
TQChar c = buf[0];
@@ -470,7 +470,7 @@ bool Index::searchForPattern( const TQStringList &patterns, const TQStringList &
int i = 0;
while ( (uint)j < text.length() ) {
if ( c == '<' || c == '&' ) {
- valid = FALSE;
+ valid = false;
if ( i > 1 )
buildMiniDict( TQString(str,i) );
i = 0;
@@ -478,7 +478,7 @@ bool Index::searchForPattern( const TQStringList &patterns, const TQStringList &
continue;
}
if ( ( c == '>' || c == ';' ) && !valid ) {
- valid = TRUE;
+ valid = true;
c = buf[++j];
continue;
}
@@ -521,6 +521,6 @@ bool Index::searchForPattern( const TQStringList &patterns, const TQStringList &
}
}
if ( a.count() )
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}