X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2FfrmMain.cpp;h=228c7a6c28bb1c9493af3a4fd55afeba761db1df;hp=f21a0beda3f45927727addeb6ea825522f4524a4;hb=555c893cfd58230b494c33bbfedc1daaf9ca3a77;hpb=2a30393d59c892349cffec18ec16907c2358fd0f diff --git a/source/frmMain.cpp b/source/frmMain.cpp index f21a0be..228c7a6 100644 --- a/source/frmMain.cpp +++ b/source/frmMain.cpp @@ -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; @@ -1438,6 +1436,13 @@ void frmMain::LoadPreferences(bool skipWindowSizeReload){ XABPreferences preferences(preffilename); + // Clear the active account/filename information and account list. + + ActiveAccount = ""; + ActiveAccountType = ""; + ActiveFilename = ""; + lstContacts->DeleteAllItems(); + // Setup the main window position (if needed). bool SaveWindowPos = preferences.GetBoolData(wxT("SaveWindowPosition")); @@ -1708,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){