messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp
changeset 67 fc91263aee62
parent 62 fdbe8253b596
child 73 ecf6a73a9186
--- a/messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp	Tue Sep 14 22:54:56 2010 +0530
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp	Fri Sep 17 20:01:45 2010 +0530
@@ -75,6 +75,10 @@
 const QString ATTACH_ICON("qtg_mono_attach");
 // temporary folder for unieditor
 const QString UNIFIED_EDITOR_TEMP_FOLDER("unifiededitor");
+// invalid chars in vcard
+const QString INVALID_FILENAME_CHARS("[?*<>/\"|\\:]");
+// replacement char for invalid char
+const QChar REPLACE_CHAR('_');
 
 const int INVALID_MSGID = -1;
 // vcard file extn.
@@ -1346,7 +1350,10 @@
         {
             // generate file name
             QString displayLabel = contactList.at(i).displayLabel();
+            displayLabel.replace(QRegExp(INVALID_FILENAME_CHARS), REPLACE_CHAR);
             QString filepath = generateFileName(displayLabel);
+            
+            // create file
             QFile file(filepath);
             if(file.open(QIODevice::WriteOnly))
             {