logsui/logscntfinder/src/logscntentry.cpp
changeset 15 76d2cf7a585e
parent 4 e52d42f9500c
child 17 90fe74753f71
--- a/logsui/logscntfinder/src/logscntentry.cpp	Fri Aug 06 14:57:47 2010 +0300
+++ b/logsui/logscntfinder/src/logscntentry.cpp	Mon Aug 23 18:14:51 2010 +0300
@@ -343,15 +343,17 @@
 bool LogsCntEntry::match( const QString& pattern ) const
 {
     bool match = false;
-    LogsPredictiveTranslator* translator = LogsPredictiveTranslator::instance();
-    
-    //direct match with phone number is enough
-    match = ( type() == EntryTypeHistory && 
-              mPhoneNumber.mTranslatedText.startsWith( pattern ) ) ||
-            doSimpleMatch( pattern );
-    
-    match = !match && translator->hasPatternSeparators( pattern ) ? 
-            doComplexMatch( translator->patternTokens( pattern) ) : match;
+    if ( pattern.length() > 0 ) {
+        LogsPredictiveTranslator* translator = LogsPredictiveTranslator::instance();
+        
+        //direct match with phone number is enough
+        match = ( type() == EntryTypeHistory && 
+                  mPhoneNumber.mTranslatedText.startsWith( pattern ) ) ||
+                doSimpleMatch( pattern );
+        
+        match = !match && translator->hasPatternSeparators( pattern ) ? 
+                doComplexMatch( translator->patternTokens( pattern) ) : match;
+    }
     
     return match;
 }