From 5dc7381334ba760443a08c4ee47bfc1ed859eca1 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sat, 9 Jul 2016 10:43:59 +0100 Subject: [PATCH] Code cleanup and move of XABPreferences object creation to outside of the for loop in frmActivityMgr --- source/actmgr/frmActivityMgr.cpp | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/source/actmgr/frmActivityMgr.cpp b/source/actmgr/frmActivityMgr.cpp index 63755f8..546795a 100644 --- a/source/actmgr/frmActivityMgr.cpp +++ b/source/actmgr/frmActivityMgr.cpp @@ -218,6 +218,7 @@ void frmActivityMgr::ProcessTasksThread() std::map::iterator LongIter; bool TasksFoundProc = FALSE; wxString TaskDetail; + XABPreferences PrefData(GetUserPrefDir()); for (std::map::iterator iter = ActivityList.begin(); iter != ActivityList.end(); ++iter){ @@ -268,7 +269,6 @@ void frmActivityMgr::ProcessTasksThread() // 8 = Completed. (UI Updated). frmMain *frmMainPtrGet = static_cast(frmMainPtr); - XABPreferences PrefData(GetUserPrefDir()); if (iter->second == 0){ @@ -1221,13 +1221,6 @@ void frmActivityMgr::ProcessTasksThread() event.SetClientData(&SSLICNProcData); wxPostEvent(frmMainPtrGet, event); - /*timespec n1, n2; - - // Fall asleep until we get an response. - - n1.tv_sec = 0; - n1.tv_nsec = 250000000L;*/ - while (*PauseMode == TRUE){ //nanosleep(&n1, &n2); SleepFor(250000000); @@ -1466,11 +1459,6 @@ void frmActivityMgr::ProcessTasksThread() event.SetClientData(&vCardProcData); wxPostEvent(frmMainPtrGet, event); - /*timespec n1, n2; - - n1.tv_sec = 0; - n1.tv_nsec = 250000000L;*/ - while (*PauseMode == TRUE){ //nanosleep(&n1, &n2); SleepFor(250000000); @@ -1735,11 +1723,6 @@ void frmActivityMgr::ProcessTasksThread() event.SetClientData(&vCardProcData); wxPostEvent(frmMainPtrGet, event); - /*timespec n1, n2; - - n1.tv_sec = 0; - n1.tv_nsec = 250000000L;*/ - while (*PauseMode == TRUE){ //nanosleep(&n1, &n2); SleepFor(250000000); @@ -1872,11 +1855,6 @@ void frmActivityMgr::ProcessTasksThread() event.SetClientData(&vCardProcData); wxPostEvent(frmMainPtrGet, event); - /*timespec n1, n2; - - n1.tv_sec = 0; - n1.tv_nsec = 250000000L;*/ - while (*PauseMode == TRUE){ //nanosleep(&n1, &n2); SleepFor(250000000); @@ -2041,11 +2019,11 @@ void frmActivityMgr::ProcessTasksThread() KeepUpdating = FALSE; } - + } - + // Mark as completed. - + wxString AccountNameFinal; AccountNameFinal = PrefData.accounts.GetAccountDirectory(AccountID); AccountNameFinal.Append(wxT(".carddav")); @@ -2053,7 +2031,7 @@ void frmActivityMgr::ProcessTasksThread() wxCommandEvent reloadevent(RELOADCONTACTLIST); reloadevent.SetString(AccountNameFinal); wxPostEvent(this->GetParent(), reloadevent); - + iter->second = 4; continue; -- 2.39.5