logsui/logsengine/src/logsevent.cpp
changeset 4 e52d42f9500c
parent 2 7119b73b84d6
child 6 41c0a814d878
--- a/logsui/logsengine/src/logsevent.cpp	Fri May 14 15:52:41 2010 +0300
+++ b/logsui/logsengine/src/logsevent.cpp	Thu May 27 12:51:53 2010 +0300
@@ -257,9 +257,11 @@
 // LogsEvent::setEventType
 // ----------------------------------------------------------------------------
 //
-void LogsEvent::setEventType( LogsEventType eventType )
+bool LogsEvent::setEventType( LogsEventType eventType )
 {
+    bool changed( mEventType != eventType );
     mEventType = eventType;
+    return changed;
 }
 
 // ----------------------------------------------------------------------------
@@ -519,10 +521,9 @@
         phoneFilter.setValue(mLogsEventData->remoteUrl());
         phoneFilter.setMatchFlags(QContactFilter::MatchExactly);
     } else if ( !mNumber.isEmpty() ){
-         // remove non-significant parts from number for better matching
         phoneFilter.setDetailDefinitionName( QContactPhoneNumber::DefinitionName,  
                                              QContactPhoneNumber::FieldNumber);
-        phoneFilter.setValue(stripPhoneNumber(mNumber));
+        phoneFilter.setValue(mNumber);
         phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith);
     } else {
         // Searching not possible
@@ -553,39 +554,6 @@
     return contactNameStr;
 }
 
-
-// ----------------------------------------------------------------------------
-// LogsEvent::stripPhoneNumber
-// ----------------------------------------------------------------------------
-//
-QString LogsEvent::stripPhoneNumber(const QString& num)
-{
-    // Remove international part from beginning if starts with '+'
-    // and leading digit can be removed if doesn't start with '+'
-    // NOTE: since international part is not fixed length, this
-    // approach is not bulletproof (i.e. if international part is
-    // only one digit long, part of group identification code is ignored
-    // which might lead to incorrect matching in case where user
-    // would have two contacts with same subscriber number part but for
-    // different operator (quite unlikely).
-
-    if ( num.length() == 0 ){
-        return num;
-    }
-    QString modifiedNum( num );
-    if ( modifiedNum.at(0) == '+' ) {
-        // QString handles automatically case of removing too much
-        const int removePlusAndInternationalPart = 4;
-        modifiedNum.remove( 0, removePlusAndInternationalPart );
-    }
-    else {
-        const int removeFirstDigit = 1;
-        modifiedNum.remove( 0, removeFirstDigit );
-    }
-
-    return modifiedNum;
-}
-
 // ----------------------------------------------------------------------------
 // LogsEvent::parseContactName
 // ----------------------------------------------------------------------------