From b6cfc76dade74fbf1b72d53701638b85ce8a121e Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 2 Aug 2015 20:40:33 +0100 Subject: [PATCH] Removed unused variables, using correct types and converting as needed. --- source/frmMain.cpp | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/source/frmMain.cpp b/source/frmMain.cpp index b9ae291..8e6ec60 100644 --- a/source/frmMain.cpp +++ b/source/frmMain.cpp @@ -196,7 +196,6 @@ frmMainADT( parent ) AccCtrl->SetPopupMinWidth(250); treAccounts->AssignImageList(AccImgList); //bmpIcon->Hide(); - wxRect AccTextCtrlSize = AccCtrl->GetTextRect(); /*wxStaticBitmap* BeepBoop = new wxStaticBitmap(AccCtrl, wxID_ANY, wxNullBitmap, wxPoint(AccTextCtrlSize.GetX() + 3, AccTextCtrlSize.GetY() + 2), wxDefaultSize, 0); @@ -405,7 +404,7 @@ void frmMain::QuitApp() // wxCommandEvent Accepts a referenced event command. //------------------------------------------------------------------- - Close(this); + Close(); } @@ -523,7 +522,6 @@ void frmMain::LoadContactList( wxTreeEvent& event ) if (ActiveItemIcon == 2){ std::multimap::iterator AGTiter = AccountGroupTreeId.find(ActiveItemId); - std::multimap::iterator AGFiter = AccountGroupFilename.find(AGTiter->second); std::multimap::iterator AGLiter = AccountGroupList.find(AGTiter->second); int ActiveAccountG = AGLiter->second; @@ -869,7 +867,6 @@ void frmMain::ShowContactInfo( wxListEvent& event ) { long intSelected = -1; - int intSelectedData = 0; long ContactSeekNum = -1; // intSelected = lstContacts->GetSelection(); @@ -918,9 +915,9 @@ void frmMain::ShowContactInfo( wxListEvent& event ) wxString ContactLine; vCard Person; - int ContactLineLen; + size_t ContactLineLen; bool ExtraLineSeek = FALSE; - int QuoteBreakPoint; + int QuoteBreakPoint = 0; bool PropertyFind = FALSE; bool QuoteMode = FALSE; @@ -1142,7 +1139,6 @@ void frmMain::ShowContactEditorEdit( wxCommandEvent& event ) // Check if a contact has been selected. long intSelected = -1; - int intSelectedData = 0; long intContactSeekNum = -1; // intSelected = lstContacts->GetSelection(); @@ -1238,7 +1234,6 @@ void frmMain::OpenContactInfo( wxListEvent& event ) wxString nextchar; long intSelected = -1; - int intSelectedData = 0; long intContactSeekNum = -1; intSelected = lstContacts->GetNextItem(intSelected, @@ -1298,10 +1293,6 @@ void frmMain::OpenContactInfo( wxCommandEvent& event ) wxString nextchar; //std::fstream vcardfile; - long intSelected = -1; - int intSelectedData = 0; - long intContactSeekNum = -1; - Person.LoadFile(uc->ContactFilename); wxMemoryInputStream istream(bigimgs_contactpersonicon48_png, sizeof(bigimgs_contactpersonicon48_png)); @@ -1439,7 +1430,7 @@ void frmMain::LoadPreferences(){ ActTmrPtr->SetupData(AccDirFull, AccName); ActTmrPtr->SetupPointers(this, ActMgrPtr, ETagProcTimer.GetPointer(AccDirFull)); - ActTmrPtr->Start(preferences.accounts.GetAccountRefresh(i) * 1000); + ActTmrPtr->Start((int)(preferences.accounts.GetAccountRefresh(i) * 1000)); ActTmrPtr->SetOwner(this); ActTmrPtr->Notify(); @@ -1585,7 +1576,7 @@ void frmMain::UpdateContactList(wxCommandEvent& event){ } - intSelectedData = lstContacts->GetItemData(longSelected); + intSelectedData = (int)lstContacts->GetItemData(longSelected); if (ucd->ContactFilename == ContactsFileIndex[intSelectedData]){ @@ -1873,7 +1864,7 @@ void frmMain::RevealContact(wxCommandEvent& event){ } - intSelectedData = lstContacts->GetItemData(longSelected); + intSelectedData = (int)lstContacts->GetItemData(longSelected); // Compare the filename with the one received. // If they match then select it. @@ -1898,7 +1889,6 @@ void frmMain::DeleteContact(wxCommandEvent& event){ // Check if a contact is selected. long intSelected = -1; - int intSelectedData = 0; long intContactSeekNum = -1; wxString wxSContactName; @@ -2050,6 +2040,12 @@ void frmMain::EmptyServerDialog(wxCommandEvent& event){ int QResponse = wxMessageBox(_("The list of contacts on the server is empty. Upload all locally stored contacts for this account now?"), _("No contacts on server"), wxYES_NO, this); + if (QResponse == wxNO){ + + return; + + } + wxCommandEvent event2(ACTMGR_RESUMEPROC); event2.SetInt(*qrn->QResponse); event2.SetClientData(qrn->PausePtr); @@ -2087,7 +2083,7 @@ void frmMain::DeleteContactSync(wxString &Account, wxString &Filename){ } - intSelectedData = lstContacts->GetItemData(longSelected); + intSelectedData = (int)lstContacts->GetItemData(longSelected); // Compare the filename with the one received. // If they match then select it. @@ -2322,10 +2318,6 @@ void frmMain::WindowEdit( wxCommandEvent &event ){ if (WData->DataType == 0){ - // Contact Window - - int intID = mnuContactWindows->GetId(); - // Get the window title and use that. frmContact *frmContactPtr = static_cast(WData->WindowPointer); @@ -2346,10 +2338,6 @@ void frmMain::WindowEdit( wxCommandEvent &event ){ } else if (WData->DataType == 1){ - // Contact Editor Window - - int intID = mnuContactEditorWindows->GetId(); - // Get the window title and use that. frmContactEditor *frmCEPtr = static_cast(WData->WindowPointer); @@ -2687,7 +2675,7 @@ void frmMain::OpenExportDialog( wxCommandEvent& event ){ } - int FileID = lstContacts->GetItemData(longSelected); + int FileID = (int)lstContacts->GetItemData(longSelected); ArrData.Insert(ContactsFileIndex[FileID], ContactsCollected, 1); @@ -2742,7 +2730,7 @@ void frmMain::GetSelectedList( wxCommandEvent& event ){ // Get the file information and add to the list. - int FileID = lstContacts->GetItemData(longSelected); + int FileID = (int)lstContacts->GetItemData(longSelected); ArrData->Insert(ContactsFileIndex[FileID], ContactsCollected, 1); -- 2.39.5