diff -r 84d9eb65b26f -r e4592d119491 messagingapp/msgnotifications/msgnotifier/src/msgnotifier.cpp --- a/messagingapp/msgnotifications/msgnotifier/src/msgnotifier.cpp Mon May 03 12:29:07 2010 +0300 +++ b/messagingapp/msgnotifications/msgnotifier/src/msgnotifier.cpp Fri May 14 15:49:35 2010 +0300 @@ -20,10 +20,7 @@ #include #include #include -#include -#include -#include -QTM_USE_NAMESPACE + //USER INCLUDES #include "msgnotifier.h" #include "msgnotifier_p.h" @@ -33,6 +30,8 @@ #include "ccsdefs.h" #include "unidatamodelloader.h" #include "unidatamodelplugininterface.h" +#include "msgcontacthandler.h" + #include "debugtraces.h" // LOCALIZATION CONSTANTS @@ -114,7 +113,8 @@ QString attachmentPath = attList[0]->path(); description = LOC_BUSINESS_CARD; description.append(CARD_SEPERATOR); - description.append(getVcardDisplayName(attachmentPath)); + description.append( + MsgContactHandler::getVCardDisplayName(attachmentPath)); } delete pluginLoader; } @@ -197,39 +197,4 @@ QDEBUG_WRITE("MsgNotifier::updateOutboxIndications Exit") } -//--------------------------------------------------------------- -// MsgNotifier::getVcardDisplayName -// @see header -//--------------------------------------------------------------- -QString MsgNotifier::getVcardDisplayName(const QString& filePath) -{ - QString displayName; - //open file for parsing - QFile file(filePath); - if (!file.open(QIODevice::ReadOnly)) { - return displayName; - } - // parse contents - QVersitReader reader; - reader.setDevice(&file); - if (reader.startReading()) { - if (reader.waitForFinished()) { - QList versitDocuments = reader.results(); - // Use the resulting document - if (versitDocuments.count() > 0) { - QVersitContactImporter importer; - QList contacts = importer.importContacts(versitDocuments); - // get display-name - if (contacts.count() > 0) { - QContactManager* contactManager = new QContactManager("symbian"); - displayName = contactManager->synthesizedDisplayLabel(contacts[0]); - delete contactManager; - } - } - } - } - file.close(); - return displayName; -} - //EOF