From 06903ae1bd1efe17b7fa5fbc355b2f361820d8fa Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 10 Jan 2016 20:48:59 +0000 Subject: [PATCH] Added support for saving REV, XML, CLIENTPIDMAP and SOURCE properties. --- .../contacteditor/frmContactEditor-Save.cpp | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/source/contacteditor/frmContactEditor-Save.cpp b/source/contacteditor/frmContactEditor-Save.cpp index d7cac2c..e05199d 100644 --- a/source/contacteditor/frmContactEditor-Save.cpp +++ b/source/contacteditor/frmContactEditor-Save.cpp @@ -173,6 +173,87 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) ContactData.Add(wxT("PRODID"), strValue, FALSE); + // Process the REV property. + + wxDateTime DateTimeSave; + DateTimeSave = DateTimeSave.SetToCurrent(); + wxString DateTimeSaveValue; + + DateTimeSaveValue += wxString::Format("%04i", DateTimeSave.GetYear()); + DateTimeSaveValue += wxString::Format("%02i", (DateTimeSave.GetMonth() + 1)); + DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetDay()); + DateTimeSaveValue += "T"; + DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetHour()); + DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetMinute()); + DateTimeSaveValue += wxString::Format("%02i", DateTimeSave.GetSecond()); + + if (!ContactEditorData.RevisionTokens.IsEmpty()){ + ContactData.AddRaw("REV;" + ContactEditorData.RevisionTokens, DateTimeSaveValue); + } else { + ContactData.AddRaw("REV", DateTimeSaveValue); + } + // Process the XML properties. + + for (std::map::iterator iter = ContactEditorData.XMLList.begin(); + iter != ContactEditorData.XMLList.end(); ++iter){ + + wxString strOrigValue; + + strOrigValue = ContactEditorData.XMLList.find(iter->first)->second; + + ResetUnusedString(&strOrigValue); + + ProcessSaveData(wxT("XML"), &strValue2, &boolValue2, &boolValue, + &iter, &strOrigValue, &ContactData, + wxT("ALTID"), &ContactEditorData.XMLListAltID ); + + ResetSaveProcessData(); + + } + + // Process the CLIENTPIDMAP properties. + + for (std::map::iterator iter = ContactEditorData.ClientPIDList.begin(); + iter != ContactEditorData.ClientPIDList.end(); ++iter){ + + wxString strOrigValue; + + strOrigValue = ContactEditorData.ClientPIDList.find(iter->first)->second; + + ResetUnusedString(&strOrigValue); + + ProcessSaveData(wxT("CLIENTPIDMAP"), &strValue2, &boolValue2, &boolValue, + &iter, &strOrigValue, &ContactData, + wxT(""), &ContactEditorData.ClientPIDListTokens ); + + ResetSaveProcessData(); + + } + + // Process the SOURCE properties. + + for (std::map::iterator iter = ContactEditorData.SourceList.begin(); + iter != ContactEditorData.SourceList.end(); ++iter){ + + wxString strOrigValue; + + strOrigValue = ContactEditorData.SourceList.find(iter->first)->second; + + ResetUnusedString(&strOrigValue); + + ProcessSaveData(wxT("SOURCE"), &strValue2, &boolValue2, &boolValue, + &iter, &strOrigValue, &ContactData, + wxT("ALTID"), &ContactEditorData.SourceListAltID, + wxT("PID"), &ContactEditorData.SourceListPID, + wxT("TYPE"), &ContactEditorData.SourceListType, + wxT("PREF"), &ContactEditorData.SourceListPref, + wxT("MEDIATYPE"), &ContactEditorData.SourceListMediatype, + wxT(""), &ContactEditorData.SourceListTokens ); + + ResetSaveProcessData(); + + } + // Setup the name. strValue.Clear(); -- 2.39.2