logsui/logsengine/src/logsevent.cpp
changeset 10 b04270301d3b
parent 6 41c0a814d878
child 15 76d2cf7a585e
equal deleted inserted replaced
6:41c0a814d878 10:b04270301d3b
   640 //
   640 //
   641 QString LogsEvent::parseContactName(const QContactName& name)
   641 QString LogsEvent::parseContactName(const QContactName& name)
   642 {
   642 {
   643     QString firstName = name.value(QContactName::FieldFirstName);
   643     QString firstName = name.value(QContactName::FieldFirstName);
   644     QString lastName = name.value(QContactName::FieldLastName);
   644     QString lastName = name.value(QContactName::FieldLastName);
   645     QString parsedName;
   645     QString parsedName = firstName;    
   646     if (!lastName.isEmpty()) {
   646     if (!parsedName.isEmpty() && !lastName.isEmpty()) {
   647         if (!firstName.isEmpty()) {
   647         parsedName.append(" ");
   648             parsedName = 
   648     }
   649                 QString(QLatin1String("%1 %2")).arg(firstName).arg(lastName);
   649     parsedName.append(lastName);
   650         } 
       
   651         else {
       
   652             parsedName = lastName;
       
   653         }
       
   654     } else if (!firstName.isEmpty()) {
       
   655         parsedName = firstName;
       
   656     }
       
   657     return parsedName;
   650     return parsedName;
   658 }
   651 }
   659 
   652 
   660 // ----------------------------------------------------------------------------
   653 // ----------------------------------------------------------------------------
   661 //
   654 //