Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added SOURCE to the SaveString function of ContactDataObject
[xestiaab/.git] / source / contacteditor / cdo / ContactDataObject-Save.cpp
index 73fb904..4cc5a6f 100644 (file)
@@ -78,7 +78,14 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){
                        break;
                
        }
-
+       
+       // Process SOURCE.
+       
+       SaveSource(&SourceList, &SourceListAltID, 
+               &SourceListPID, &SourceListType,
+               &SourceListMediatype, &SourceListPref, 
+               &SourceListTokens, SaveData);
+       
        // Process FN.
        
        for (std::map<int, wxString>::iterator FNIter = FullNamesList.begin();
@@ -253,4 +260,83 @@ void ContactDataObject::SaveTitle(map<int, wxString> *TitleList, map<int, wxStri
                        
        }
                
+}
+
+void ContactDataObject::SaveSource(map<int, wxString> *SourceList, map<int, wxString> *SourceListAltID, 
+       map<int, wxString> *SourceListPID, map<int, wxString> *SourceListType,
+       map<int, wxString> *SourceListMediatype, map<int, int> *SourceListPref, 
+       map<int, wxString> *SourceListTokens, wxString *SaveData){
+
+       wxString ProcessData = "";
+       
+       for (std::map<int, wxString>::iterator SourceIter = SourceList->begin();
+               SourceIter != SourceList->end(); SourceIter++){
+
+               ProcessData.Append("SOURCE");
+                       
+               // Check if there is a value for TYPE.
+               
+               if ((*SourceListType)[SourceIter->first].size() > 0){
+               
+                       ProcessData.Append(";TYPE=");
+                       ProcessData.Append((*SourceListType)[SourceIter->first]);
+                       
+               }
+               
+               // Check if there is a value for ALTID.
+               
+               if ((*SourceListAltID)[SourceIter->first].size() > 0){
+               
+                       ProcessData.Append(";ALTID=");
+                       ProcessData.Append((*SourceListAltID)[SourceIter->first]);
+                       
+               }
+
+               // Check if there is a value for LANGUAGE.
+               
+               if ((*SourceListMediatype)[SourceIter->first].size() > 0){
+               
+                       ProcessData.Append(";MEDIATYPE=");
+                       ProcessData.Append((*SourceListMediatype)[SourceIter->first]);
+                       
+               }
+               
+               // Check if there is a value for PID.
+
+               if ((*SourceListPID)[SourceIter->first].size() > 0){
+               
+                       ProcessData.Append(";PID=");
+                       ProcessData.Append((*SourceListPID)[SourceIter->first]);
+                       
+               }
+
+               // Check if there is a value for PREF.
+
+               if ((*SourceListPref)[SourceIter->first] > 0){
+               
+                       ProcessData.Append(";PREF=");
+                       ProcessData.Append(wxString::Format("%i", (*SourceListPref)[SourceIter->first]));
+                       
+               }
+
+               // Check if there is a value for tokens.
+
+               if ((*SourceListTokens)[SourceIter->first].size() > 0){
+               
+                       ProcessData.Append(";");
+                       ProcessData.Append((*SourceListTokens)[SourceIter->first]);
+                       
+               }
+                       
+               ProcessData.Append(":");
+               ProcessData.Append(SourceIter->second);
+               ProcessData.Append("\n");
+
+               ProcessData = OutputText(&ProcessData);
+                       
+               SaveData->Append(ProcessData);
+               ProcessData.clear();
+                       
+       }
+               
 }
\ No newline at end of file
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy