emailuis/nmailui/src/nmrecipientfield.cpp
changeset 47 f83bd4ae1fe3
parent 44 c2d07d913565
child 57 ae34e1715e21
--- a/emailuis/nmailui/src/nmrecipientfield.cpp	Fri Jun 11 16:42:02 2010 +0300
+++ b/emailuis/nmailui/src/nmrecipientfield.cpp	Thu Jun 24 14:32:18 2010 +0300
@@ -17,11 +17,11 @@
 
 #include "nmuiheaders.h"
 
-static const QString ContactsServiceName = "com.nokia.services.phonebookservices";
-static const QString ContactsInterfaceName = "Fetch";
-static const QString ContactsOperationName = "fetch(QString,QString,QString)";
+static const QString NmContactsServiceName = "com.nokia.services.phonebookservices";
+static const QString NmContactsInterfaceName = "Fetch";
+static const QString NmContactsOperationName = "fetch(QString,QString,QString)";
 
-static const int MaxRows = 10000;
+static const int NmMaxRows = 10000;
 
 /*!
    widget is created using AD/docml
@@ -46,12 +46,15 @@
 
     mRecipientsEditor = qobject_cast<NmRecipientLineEdit *>
         (mDocumentLoader.findWidget(mObjectPrefix + "Edit"));
-    mRecipientsEditor->setMaxRows(MaxRows);
+    if (mRecipientsEditor) {
+        mRecipientsEditor->setMaxRows(NmMaxRows);    
+    }
 
     mLaunchContactsPickerButton = qobject_cast<HbPushButton *>
         (mDocumentLoader.findWidget(mObjectPrefix + "Button"));
-
-    mLaunchContactsPickerButton->setIcon(NmIcons::getIcon(NmIcons::NmIconContacts));
+    if (mLaunchContactsPickerButton) {
+        mLaunchContactsPickerButton->setIcon(NmIcons::getIcon(NmIcons::NmIconContacts));    
+    }
 
     createConnections();
 }
@@ -73,10 +76,8 @@
         this, SIGNAL(selectionChanged()));
     connect(mLaunchContactsPickerButton, SIGNAL(pressed()),
             this, SIGNAL(launchContactsPickerButtonClicked()));
-
-#ifdef Q_OS_SYMBIAN
-    connect(mLaunchContactsPickerButton, SIGNAL(pressed()), this, SLOT(launchContactsPicker()));
-#endif
+    connect(mLaunchContactsPickerButton, SIGNAL(pressed()), 
+            this, SLOT(launchContactsPicker()));
 }
 
 
@@ -134,7 +135,6 @@
 }
 
 
-#ifdef Q_OS_SYMBIAN
 /*!
    This Slot launches the contacts-picker
 */
@@ -146,12 +146,12 @@
     XQAiwRequest *launchContactsPickerRequest;
     
     bool isEmbeded = true;
-    launchContactsPickerRequest = mAppmgr.create(ContactsServiceName, ContactsInterfaceName, 
-                                                 ContactsOperationName, isEmbeded);
+    launchContactsPickerRequest = mAppmgr.create(NmContactsServiceName, NmContactsInterfaceName, 
+                                                 NmContactsOperationName, isEmbeded);
     
     if (launchContactsPickerRequest) {
         connect(launchContactsPickerRequest, SIGNAL(requestOk(QVariant)),
-                mRecipientsEditor, SLOT(insertSelectedContacts(QVariant)));
+                mRecipientsEditor, SLOT(addSelectedContacts(QVariant)));
     }
     else {
         // Failed creating request 
@@ -172,6 +172,5 @@
     }
         
     delete launchContactsPickerRequest;
-    launchContactsPickerRequest = 0;
+    launchContactsPickerRequest = NULL;
 }
-#endif