Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Property idented frmContactEditorGroups
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 13 Mar 2016 10:35:33 +0000 (10:35 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 13 Mar 2016 10:35:33 +0000 (10:35 +0000)
source/contacteditor/frmContactEditorGroups.cpp

index 094347f..0016987 100755 (executable)
@@ -37,152 +37,154 @@ void frmContactEditorGroup::FetchContacts( wxInitDialogEvent& event )
 \r
        // Ignore contacts which have KIND:group set.\r
        \r
-    wxString AccountDirFinal = GetAccountDir(AccName, FALSE);\r
+       wxString AccountDirFinal = GetAccountDir(AccName, FALSE);\r
 \r
-    //wxString vcardfilenamewxs;\r
-    wxString vCardFilename;\r
-    wxString vCardFilenameFull;\r
-    wxString vCardDataString;\r
-    //wxStringTokenizer vcardfileline;\r
-    wxString lwxs;\r
-    wxString setname, setvalue;\r
-    //vCardNames = new std::map<wxString, wxString, std::greater<wxString>>;\r
-    std::multimap<wxString, ContactData, std::greater<wxString>> vCardNamesAsc;\r
-    std::multimap<wxString, ContactData, std::less<wxString>> vCardNamesDsc;\r
-    int ContactIndex = 0;\r
+       //wxString vcardfilenamewxs;\r
+       wxString vCardFilename;\r
+       wxString vCardFilenameFull;\r
+       wxString vCardDataString;\r
+       //wxStringTokenizer vcardfileline;\r
+       wxString lwxs;\r
+       wxString setname, setvalue;\r
+       //vCardNames = new std::map<wxString, wxString, std::greater<wxString>>;\r
+       std::multimap<wxString, ContactData, std::greater<wxString>> vCardNamesAsc;\r
+       std::multimap<wxString, ContactData, std::less<wxString>> vCardNamesDsc;\r
+       int ContactIndex = 0;\r
     \r
-    wxDir vcardaccdir(AccountDirFinal);\r
+       wxDir vcardaccdir(AccountDirFinal);\r
     \r
-    bool ProcFiles = vcardaccdir.GetFirst(&vCardFilename, wxEmptyString, wxDIR_FILES);\r
-    while(ProcFiles){\r
+       bool ProcFiles = vcardaccdir.GetFirst(&vCardFilename, wxEmptyString, wxDIR_FILES);\r
+       while(ProcFiles){\r
     \r
-       if (vCardFilename.Right(4) == wxT(".vcf") || \r
-           vCardFilename.Right(4) == wxT(".VCF") || \r
-           vCardFilename.Right(5) == wxT(".vcard") || \r
-           vCardFilename.Right(5) == wxT(".VCARD")){\r
+               if (vCardFilename.Right(4) == wxT(".vcf") || \r
+                       vCardFilename.Right(4) == wxT(".VCF") || \r
+                       vCardFilename.Right(5) == wxT(".vcard") || \r
+                       vCardFilename.Right(5) == wxT(".VCARD")){\r
        \r
-           vCard Person;\r
+                       vCard Person;\r
                \r
-           vCardFilenameFull.Append(AccountDirFinal);\r
-           vCardFilenameFull.Append(wxT("/"));\r
-           vCardFilenameFull.Append(vCardFilename);\r
+                       vCardFilenameFull.Append(AccountDirFinal);\r
+                       vCardFilenameFull.Append(wxT("/"));\r
+                       vCardFilenameFull.Append(vCardFilename);\r
                \r
-           Person.LoadFile(vCardFilenameFull);\r
+                       Person.LoadFile(vCardFilenameFull);\r
                \r
-           if (Person.MeetBaseSpecification()){\r
+                       if (Person.MeetBaseSpecification()){\r
        \r
-               wxString KindStatus = Person.Get(wxT("KIND"));\r
+                               wxString KindStatus = Person.Get(wxT("KIND"));\r
                \r
-               if (KindStatus == wxT("group")){\r
+                               if (KindStatus == wxT("group")){\r
                \r
-                       vCardFilename.Clear();\r
-                       vCardFilenameFull.Clear();\r
-                       vCardDataString.Clear();\r
-                       ProcFiles = vcardaccdir.GetNext(&vCardFilename);\r
-                       continue;\r
+                               vCardFilename.Clear();\r
+                               vCardFilenameFull.Clear();\r
+                               vCardDataString.Clear();\r
+                               ProcFiles = vcardaccdir.GetNext(&vCardFilename);\r
+                               continue;\r
                \r
-               }\r
+                               }       \r
                \r
-               wxString PersonName = Person.Get(wxT("N"));\r
-               wxString PersonUID = Person.Get(wxT("UID"));\r
-               wxString PersonFilename = vCardFilenameFull;\r
+                               wxString PersonName = Person.Get(wxT("N"));\r
+                               wxString PersonUID = Person.Get(wxT("UID"));\r
+                               wxString PersonFilename = vCardFilenameFull;\r
                \r
-               ContactData PersonData;\r
+                               ContactData PersonData;\r
                \r
-               PersonData.ContactName = PersonName;\r
-               PersonData.ContactUID = PersonUID;\r
-               PersonData.ContactFilename = PersonFilename;\r
+                               PersonData.ContactName = PersonName;\r
+                               PersonData.ContactUID = PersonUID;\r
+                               PersonData.ContactFilename = PersonFilename;\r
                \r
-               //ContactsNames.insert(std::make_pair(PersonName, ContactIndex));\r
-               //ContactsUIDs.insert(std::make_pair(ContactIndex, PersonUID));\r
+                               //ContactsNames.insert(std::make_pair(PersonName, ContactIndex));\r
+                               //ContactsUIDs.insert(std::make_pair(ContactIndex, PersonUID));\r
        \r
-               if (XVMData.SortMode == 1){\r
+                               if (XVMData.SortMode == 1){\r
 \r
-                   // Split the name into sections.\r
+                                       // Split the name into sections.\r
                        \r
-                   vCardDataString = Person.Get(wxT("N"));\r
+                                       vCardDataString = Person.Get(wxT("N"));\r
 \r
-                   vCardName NameData = Person.GetName();\r
+                                       vCardName NameData = Person.GetName();\r
                    \r
-                   vCardDataString = NameData.Forename + wxT(" ") + NameData.Surname;\r
+                                       vCardDataString = NameData.Forename + wxT(" ") + NameData.Surname;\r
                    \r
-               } else if (XVMData.SortMode == 2){\r
+                               } else if (XVMData.SortMode == 2){\r
                    \r
-                   // Split the name into sections.\r
+                                       // Split the name into sections.\r
                    \r
-                   vCardName NameData = Person.GetName();    \r
+                                       vCardName NameData = Person.GetName();    \r
                    \r
-                   vCardDataString = NameData.Surname + wxT(", ") + NameData.Forename;\r
+                                       vCardDataString = NameData.Surname + wxT(", ") + NameData.Forename;\r
                    \r
-               } else if (XVMData.SortMode == 3){\r
+                               } else if (XVMData.SortMode == 3){\r
                    \r
-                   // Check and make sure that the top most nickname is used.\r
+                                       // Check and make sure that the top most nickname is used.\r
                    \r
-                   vCardDataString = Person.Get(wxT("NICKNAME"));\r
+                                       vCardDataString = Person.Get(wxT("NICKNAME"));\r
                    \r
-                   if (vCardDataString.IsEmpty()){\r
+                                       if (vCardDataString.IsEmpty()){\r
                        \r
-                       vCardDataString = wxT("(no nickname)");\r
+                                               vCardDataString = wxT("(no nickname)");\r
                        \r
-                   }\r
+                                       }\r
                    \r
-               } else if (XVMData.SortMode == 4){\r
+                               } else if (XVMData.SortMode == 4){\r
                    \r
-                   vCardDataString = Person.Get(wxT("FN"));\r
+                                       vCardDataString = Person.Get(wxT("FN"));\r
                    \r
-               }\r
+                               }\r
        \r
-               if (XVMData.AscendingMode == TRUE){\r
-                   vCardNamesAsc.insert(std::make_pair(vCardDataString, PersonData));\r
-               } else {\r
-                   vCardNamesDsc.insert(std::make_pair(vCardDataString, PersonData));\r
-               }\r
+                               if (XVMData.AscendingMode == TRUE){\r
+                               \r
+                                       vCardNamesAsc.insert(std::make_pair(vCardDataString, PersonData));\r
+                               \r
+                               } else {\r
+                               \r
+                                       vCardNamesDsc.insert(std::make_pair(vCardDataString, PersonData));\r
+                               \r
+                               }\r
                \r
-           } else {\r
+                       } else {\r
        \r
-           }\r
-           \r
+                       }\r
            \r
+               }\r
        \r
-       }\r
-       \r
-       vCardFilename.Clear();\r
-       vCardFilenameFull.Clear();\r
-       vCardDataString.Clear();\r
-       ProcFiles = vcardaccdir.GetNext(&vCardFilename);\r
+               vCardFilename.Clear();\r
+               vCardFilenameFull.Clear();\r
+               vCardDataString.Clear();\r
+               ProcFiles = vcardaccdir.GetNext(&vCardFilename);\r
        \r
-    }\r
+       }\r
     \r
-    if (XVMData.AscendingMode == TRUE){\r
+       if (XVMData.AscendingMode == TRUE){\r
             \r
-       for (std::map<wxString,ContactData>::iterator iter = vCardNamesAsc.begin(); \r
-       iter != vCardNamesAsc.end(); ++iter){\r
+               for (std::map<wxString,ContactData>::iterator iter = vCardNamesAsc.begin(); \r
+                       iter != vCardNamesAsc.end(); ++iter){\r
 \r
-          chkContacts->InsertItems(1, &iter->first, 0);\r
+                       chkContacts->InsertItems(1, &iter->first, 0);\r
        \r
-          ContactNamesData.insert(std::make_pair(ContactIndex, iter->second));         \r
+                       ContactNamesData.insert(std::make_pair(ContactIndex, iter->second));            \r
        \r
-          ContactIndex++;\r
+                       ContactIndex++;\r
                        \r
-       }\r
+               }\r
                \r
                \r
-    } else {\r
+       } else {\r
                \r
-        ContactIndex = (int)(vCardNamesDsc.size() - 1);\r
+               ContactIndex = (int)(vCardNamesDsc.size() - 1);\r
                \r
-        for (std::map<wxString,ContactData>::iterator iter = vCardNamesDsc.begin();\r
-             iter != vCardNamesDsc.end(); ++iter){\r
+               for (std::map<wxString,ContactData>::iterator iter = vCardNamesDsc.begin();\r
+                       iter != vCardNamesDsc.end(); ++iter){\r
 \r
-            chkContacts->InsertItems(1, &iter->first, 0);\r
+                       chkContacts->InsertItems(1, &iter->first, 0);\r
 \r
-            ContactNamesData.insert(std::make_pair(ContactIndex, iter->second));\r
-        \r
-            ContactIndex--;\r
+                       ContactNamesData.insert(std::make_pair(ContactIndex, iter->second));\r
+               \r
+                       ContactIndex--;\r
 \r
-        }\r
+               }\r
        \r
-    }\r
+       }\r
 \r
 }\r
 \r
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