summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-05-25 11:00:37 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-05-25 11:00:37 +0900
commitd3e7e1e0fe492ea9890eb1cd7af3ca9609ae3d1c (patch)
tree5eacfa5feed346e9eb2fc51e396ab34ef1d5f352
parent8f878546e0a859e78dfc2c6ff7f08507347a76ea (diff)
downloadtdepim-issue/tde-236.tar.gz
tdepim-issue/tde-236.zip
Test commitissue/tde-236
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r--kmail/index.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/kmail/index.cpp b/kmail/index.cpp
index f9b157d2..2d1ef081 100644
--- a/kmail/index.cpp
+++ b/kmail/index.cpp
@@ -451,19 +451,21 @@ bool KMMsgIndex::stopQuery( KMSearch* s ) {
std::vector<TQ_UINT32> KMMsgIndex::simpleSearch( TQString s, bool* ok ) const {
kdDebug( 5006 ) << "KMMsgIndex::simpleSearch( -" << s.latin1() << "- )" << endl;
+ if ( ok ) *ok = false;
if ( mState == s_error || mState == s_disabled ) {
- if ( ok ) *ok = false;
return std::vector<TQ_UINT32>();
}
std::vector<TQ_UINT32> res;
#ifdef HAVE_INDEXLIB
- assert( mIndex );
- std::vector<unsigned> residx = mIndex->search( s.latin1() )->list();
- res.reserve( residx.size() );
- for ( std::vector<unsigned>::const_iterator first = residx.begin(), past = residx.end();first != past; ++first ) {
- res.push_back( std::atoi( mIndex->lookup_docname( *first ).c_str() ) );
+ if (mIndex)
+ {
+ std::vector<unsigned> residx = mIndex->search( s.latin1() )->list();
+ res.reserve( residx.size() );
+ for ( std::vector<unsigned>::const_iterator first = residx.begin(), past = residx.end();first != past; ++first ) {
+ res.push_back( std::atoi( mIndex->lookup_docname( *first ).c_str() ) );
+ }
+ if ( ok ) *ok = true;
}
- if ( ok ) *ok = true;
#endif
return res;
}