From 4655e242645fc9a758e85d45d53179aa4fb7c9cd Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 13 Mar 2016 10:35:33 +0000 Subject: [PATCH] Property idented frmContactEditorGroups --- .../contacteditor/frmContactEditorGroups.cpp | 186 +++++++++--------- 1 file changed, 94 insertions(+), 92 deletions(-) diff --git a/source/contacteditor/frmContactEditorGroups.cpp b/source/contacteditor/frmContactEditorGroups.cpp index 094347f..0016987 100755 --- a/source/contacteditor/frmContactEditorGroups.cpp +++ b/source/contacteditor/frmContactEditorGroups.cpp @@ -37,152 +37,154 @@ void frmContactEditorGroup::FetchContacts( wxInitDialogEvent& event ) // Ignore contacts which have KIND:group set. - wxString AccountDirFinal = GetAccountDir(AccName, FALSE); + wxString AccountDirFinal = GetAccountDir(AccName, FALSE); - //wxString vcardfilenamewxs; - wxString vCardFilename; - wxString vCardFilenameFull; - wxString vCardDataString; - //wxStringTokenizer vcardfileline; - wxString lwxs; - wxString setname, setvalue; - //vCardNames = new std::map>; - std::multimap> vCardNamesAsc; - std::multimap> vCardNamesDsc; - int ContactIndex = 0; + //wxString vcardfilenamewxs; + wxString vCardFilename; + wxString vCardFilenameFull; + wxString vCardDataString; + //wxStringTokenizer vcardfileline; + wxString lwxs; + wxString setname, setvalue; + //vCardNames = new std::map>; + std::multimap> vCardNamesAsc; + std::multimap> vCardNamesDsc; + int ContactIndex = 0; - wxDir vcardaccdir(AccountDirFinal); + wxDir vcardaccdir(AccountDirFinal); - bool ProcFiles = vcardaccdir.GetFirst(&vCardFilename, wxEmptyString, wxDIR_FILES); - while(ProcFiles){ + bool ProcFiles = vcardaccdir.GetFirst(&vCardFilename, wxEmptyString, wxDIR_FILES); + while(ProcFiles){ - if (vCardFilename.Right(4) == wxT(".vcf") || - vCardFilename.Right(4) == wxT(".VCF") || - vCardFilename.Right(5) == wxT(".vcard") || - vCardFilename.Right(5) == wxT(".VCARD")){ + if (vCardFilename.Right(4) == wxT(".vcf") || + vCardFilename.Right(4) == wxT(".VCF") || + vCardFilename.Right(5) == wxT(".vcard") || + vCardFilename.Right(5) == wxT(".VCARD")){ - vCard Person; + vCard Person; - vCardFilenameFull.Append(AccountDirFinal); - vCardFilenameFull.Append(wxT("/")); - vCardFilenameFull.Append(vCardFilename); + vCardFilenameFull.Append(AccountDirFinal); + vCardFilenameFull.Append(wxT("/")); + vCardFilenameFull.Append(vCardFilename); - Person.LoadFile(vCardFilenameFull); + Person.LoadFile(vCardFilenameFull); - if (Person.MeetBaseSpecification()){ + if (Person.MeetBaseSpecification()){ - wxString KindStatus = Person.Get(wxT("KIND")); + wxString KindStatus = Person.Get(wxT("KIND")); - if (KindStatus == wxT("group")){ + if (KindStatus == wxT("group")){ - vCardFilename.Clear(); - vCardFilenameFull.Clear(); - vCardDataString.Clear(); - ProcFiles = vcardaccdir.GetNext(&vCardFilename); - continue; + vCardFilename.Clear(); + vCardFilenameFull.Clear(); + vCardDataString.Clear(); + ProcFiles = vcardaccdir.GetNext(&vCardFilename); + continue; - } + } - wxString PersonName = Person.Get(wxT("N")); - wxString PersonUID = Person.Get(wxT("UID")); - wxString PersonFilename = vCardFilenameFull; + wxString PersonName = Person.Get(wxT("N")); + wxString PersonUID = Person.Get(wxT("UID")); + wxString PersonFilename = vCardFilenameFull; - ContactData PersonData; + ContactData PersonData; - PersonData.ContactName = PersonName; - PersonData.ContactUID = PersonUID; - PersonData.ContactFilename = PersonFilename; + PersonData.ContactName = PersonName; + PersonData.ContactUID = PersonUID; + PersonData.ContactFilename = PersonFilename; - //ContactsNames.insert(std::make_pair(PersonName, ContactIndex)); - //ContactsUIDs.insert(std::make_pair(ContactIndex, PersonUID)); + //ContactsNames.insert(std::make_pair(PersonName, ContactIndex)); + //ContactsUIDs.insert(std::make_pair(ContactIndex, PersonUID)); - if (XVMData.SortMode == 1){ + if (XVMData.SortMode == 1){ - // Split the name into sections. + // Split the name into sections. - vCardDataString = Person.Get(wxT("N")); + vCardDataString = Person.Get(wxT("N")); - vCardName NameData = Person.GetName(); + vCardName NameData = Person.GetName(); - vCardDataString = NameData.Forename + wxT(" ") + NameData.Surname; + vCardDataString = NameData.Forename + wxT(" ") + NameData.Surname; - } else if (XVMData.SortMode == 2){ + } else if (XVMData.SortMode == 2){ - // Split the name into sections. + // Split the name into sections. - vCardName NameData = Person.GetName(); + vCardName NameData = Person.GetName(); - vCardDataString = NameData.Surname + wxT(", ") + NameData.Forename; + vCardDataString = NameData.Surname + wxT(", ") + NameData.Forename; - } else if (XVMData.SortMode == 3){ + } else if (XVMData.SortMode == 3){ - // Check and make sure that the top most nickname is used. + // Check and make sure that the top most nickname is used. - vCardDataString = Person.Get(wxT("NICKNAME")); + vCardDataString = Person.Get(wxT("NICKNAME")); - if (vCardDataString.IsEmpty()){ + if (vCardDataString.IsEmpty()){ - vCardDataString = wxT("(no nickname)"); + vCardDataString = wxT("(no nickname)"); - } + } - } else if (XVMData.SortMode == 4){ + } else if (XVMData.SortMode == 4){ - vCardDataString = Person.Get(wxT("FN")); + vCardDataString = Person.Get(wxT("FN")); - } + } - if (XVMData.AscendingMode == TRUE){ - vCardNamesAsc.insert(std::make_pair(vCardDataString, PersonData)); - } else { - vCardNamesDsc.insert(std::make_pair(vCardDataString, PersonData)); - } + if (XVMData.AscendingMode == TRUE){ + + vCardNamesAsc.insert(std::make_pair(vCardDataString, PersonData)); + + } else { + + vCardNamesDsc.insert(std::make_pair(vCardDataString, PersonData)); + + } - } else { + } else { - } - + } + } - } - - vCardFilename.Clear(); - vCardFilenameFull.Clear(); - vCardDataString.Clear(); - ProcFiles = vcardaccdir.GetNext(&vCardFilename); + vCardFilename.Clear(); + vCardFilenameFull.Clear(); + vCardDataString.Clear(); + ProcFiles = vcardaccdir.GetNext(&vCardFilename); - } + } - if (XVMData.AscendingMode == TRUE){ + if (XVMData.AscendingMode == TRUE){ - for (std::map::iterator iter = vCardNamesAsc.begin(); - iter != vCardNamesAsc.end(); ++iter){ + for (std::map::iterator iter = vCardNamesAsc.begin(); + iter != vCardNamesAsc.end(); ++iter){ - chkContacts->InsertItems(1, &iter->first, 0); + chkContacts->InsertItems(1, &iter->first, 0); - ContactNamesData.insert(std::make_pair(ContactIndex, iter->second)); + ContactNamesData.insert(std::make_pair(ContactIndex, iter->second)); - ContactIndex++; + ContactIndex++; - } + } - } else { + } else { - ContactIndex = (int)(vCardNamesDsc.size() - 1); + ContactIndex = (int)(vCardNamesDsc.size() - 1); - for (std::map::iterator iter = vCardNamesDsc.begin(); - iter != vCardNamesDsc.end(); ++iter){ + for (std::map::iterator iter = vCardNamesDsc.begin(); + iter != vCardNamesDsc.end(); ++iter){ - chkContacts->InsertItems(1, &iter->first, 0); + chkContacts->InsertItems(1, &iter->first, 0); - ContactNamesData.insert(std::make_pair(ContactIndex, iter->second)); - - ContactIndex--; + ContactNamesData.insert(std::make_pair(ContactIndex, iter->second)); + + ContactIndex--; - } + } - } + } } -- 2.39.5