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 (MemberData.Left(9) == wxT("urn:uuid:")){
+ if (MemberData.Left(9) == wxT("urn:uuid:")){
- wxString NewPropValue;
- NewPropValue = MemberData.Mid(9, wxString::npos);
- MemberData = NewPropValue;
+ wxString NewPropValue;
+ NewPropValue = MemberData.Mid(9, wxString::npos);
+ MemberData = NewPropValue;
- }
+ }
- 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;
-
- if (PersonUID != MemberData){
+ wxString PersonName = Person.Get(wxT("N"));
+ wxString PersonUID = Person.Get(wxT("UID"));
+ wxString PersonFilename = vCardFilenameFull;
+
+ if (PersonUID != MemberData){
- vCardFilename.Clear();
- vCardFilenameFull.Clear();
- vCardDataString.Clear();
- ProcFiles = vcardaccdir.GetNext(&vCardFilename);
- continue;
+ vCardFilename.Clear();
+ vCardFilenameFull.Clear();
+ vCardDataString.Clear();
+ ProcFiles = vcardaccdir.GetNext(&vCardFilename);
+ continue;
- } else {
- FoundContact = TRUE;
- }
+ } else {
+
+ FoundContact = TRUE;
+
+ }
- //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, PersonUID));
+
+ } else {
+
+ vCardNamesDsc.insert(std::make_pair(vCardDataString, PersonUID));
+
+ }
- if (XVMData.AscendingMode == TRUE){
- vCardNamesAsc.insert(std::make_pair(vCardDataString, PersonUID));
} else {
- vCardNamesDsc.insert(std::make_pair(vCardDataString, PersonUID));
- }
-
- } else {
-
- }
-
+ }
}
vCardDataString.Clear();
ProcFiles = vcardaccdir.GetNext(&vCardFilename);
- }
+ }
- if (FoundContact == FALSE){
+ if (FoundContact == FALSE){
+
if (XVMData.AscendingMode == TRUE){
- vCardNamesAsc.insert(std::make_pair(MemberIter->second, MemberIter->second));
+
+ vCardNamesAsc.insert(std::make_pair(MemberIter->second, MemberIter->second));
+
} else {
- vCardNamesDsc.insert(std::make_pair(MemberIter->second, MemberIter->second));
+
+ vCardNamesDsc.insert(std::make_pair(MemberIter->second, MemberIter->second));
+
}
- }
- if (XVMData.AscendingMode == TRUE){
+ }
+
+ if (XVMData.AscendingMode == TRUE){
for (std::map<wxString,wxString>::iterator iter = vCardNamesAsc.begin();
- iter != vCardNamesAsc.end(); ++iter){
+ iter != vCardNamesAsc.end(); ++iter){
wxListItem ItemData;
ItemData.SetId(0);
ItemData.SetText(iter->first);
-
lboGroups->InsertItem(ItemData);
}
-
- } else {
+ } else {
for (std::map<wxString,wxString>::iterator iter = vCardNamesDsc.begin();
- iter != vCardNamesDsc.end(); ++iter){
+ iter != vCardNamesDsc.end(); ++iter){
wxListItem ItemData;
ItemData.SetId(0);
ItemData.SetText(iter->first);
-
+
lboGroups->InsertItem(ItemData);
- }
+ }
}