Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
frmMain: Use Display As name if no first/last name exists
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Fri, 12 Jan 2018 00:12:26 +0000 (00:12 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Fri, 12 Jan 2018 00:12:26 +0000 (00:12 +0000)
source/frmMain.cpp

index c32e61d..228c7a6 100644 (file)
@@ -737,8 +737,6 @@ void frmMain::LoadContactList( wxTreeEvent& event )
                         
                                                // Split the name into sections.
                         
-                                               vCardDataString = Person.Get(wxT("N"));
-                        
                                                vCardName NameData = Person.GetName();
                         
                                                vCardDataString = NameData.Forename + wxT(" ") + NameData.Surname;
@@ -1715,19 +1713,40 @@ void frmMain::UpdateContactList(wxCommandEvent& event){
                     
                                        // First Name, Last Name.
                     
-                                       lstContacts->SetItem(longSelected, 0, ucd->ContactNameArray.Forename + wxT(" ") + ucd->ContactNameArray.Surname);
+                                       if (ucd->ContactNameArray.Forename == wxT("") && ucd->ContactNameArray.Surname == wxT(""))
+                                       {
+                                               lstContacts->SetItem(longSelected, 0, ucd->ContactName);
+                                       }
+                                       else
+                                       {
+                                               lstContacts->SetItem(longSelected, 0, ucd->ContactNameArray.Forename + wxT(" ") + ucd->ContactNameArray.Surname);
+                                       }
                     
                                } else if (SortMode == 2){
                     
                                        // Last Name, First Name.
-                    
-                                       lstContacts->SetItem(longSelected, 0, ucd->ContactNameArray.Surname + wxT(", ") + ucd->ContactNameArray.Forename);
+
+                                       if (ucd->ContactNameArray.Forename == wxT("") && ucd->ContactNameArray.Surname == wxT(""))
+                                       {
+                                               lstContacts->SetItem(longSelected, 0, wxT(", ") + ucd->ContactName);
+                                       }
+                                       else
+                                       {
+                                               lstContacts->SetItem(longSelected, 0, ucd->ContactNameArray.Surname + wxT(", ") + ucd->ContactNameArray.Forename);
+                                       }
                     
                                } else if (SortMode == 3){
                     
                                        // Nickname.
                     
-                                       lstContacts->SetItem(longSelected, 0, ucd->ContactNickname);
+                                       if (ucd->ContactNickname == wxT(""))
+                                       {
+                                               lstContacts->SetItem(longSelected, 0, _("(no nickname)"));
+                                       }
+                                       else
+                                       {
+                                               lstContacts->SetItem(longSelected, 0, ucd->ContactNickname);
+                                       }
                     
                                } else if (SortMode == 4){
                     
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