X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcommon%2Ftimers.cpp;h=88bbb3e2501a64bd5af2d82bf219d39db7aae325;hb=2b8ca7c8528a738a40d099e2cce5b974bc741699;hp=640997ab807d37746b5ca412a638cc90aaec1a4e;hpb=2c0502228cdf4e5b42aa966c6a9b596b41003ebb;p=xestiaab%2F.git diff --git a/source/common/timers.cpp b/source/common/timers.cpp index 640997a..88bbb3e 100644 --- a/source/common/timers.cpp +++ b/source/common/timers.cpp @@ -32,6 +32,8 @@ void wxActTimer::Notify(){ + // Notify function for wxActTimer. + frmMain *frmMainPtrProc = static_cast(frmMainPtr); wxCommandEvent shuffleevent(ACTMGR_SHUFFLE); @@ -153,6 +155,8 @@ void wxActTimer::Notify(){ void wxActTimer::SetBitmap(wxStaticBitmap *bitmap) { + // Set the bitmap for wxActTimer. + bmpActivity = bitmap; } @@ -160,6 +164,8 @@ void wxActTimer::SetBitmap(wxStaticBitmap *bitmap) void wxActTimer::SetSleepBitmap(wxBitmap *SleepBitmap) { + // Set the sleep bitmap for wxActTimer. + SleepBitmapPtr = SleepBitmap; } @@ -185,7 +191,6 @@ void wxActTimer::StartAnimation() frmMain *frmMainPtrProc = static_cast(frmMainPtr); wxCommandEvent actstart(ACTMGR_START); wxPostEvent(frmMainPtrProc, actstart); - //frmMainPtrProc->ActivityIconStart(); this->ResetBitmap(); this->Start(50, FALSE); @@ -195,6 +200,8 @@ void wxActTimer::StartAnimation() void wxActTimer::ResetBitmap() { + // Reset the bitmap for wxActTimer. + intActivityProgress = 0; } @@ -202,6 +209,8 @@ void wxActTimer::ResetBitmap() void wxActTimer::SetupPointer(void *frmMainPtrIn) { + // Setup the pointer for wxActTimer. + frmMainPtr = frmMainPtrIn; } @@ -209,6 +218,8 @@ void wxActTimer::SetupPointer(void *frmMainPtrIn) void wxActProcessTimer::Notify() { + // Notify function for wxActProcessTimer. + // Pause the timer whilst processing to avoid problems. this->Stop(); @@ -222,12 +233,16 @@ void wxActProcessTimer::Notify() void wxActProcessTimer::SetupPointers(void *ActMgr){ + // Setup pointers for the wxActProcessTimer. + ActMgrPtr = ActMgr; } void wxActListProcTimer::Notify(){ + // Notify function for wxActListProcTimer. + // Setup Label and get task data (update SetupPointers subroutine). this->Stop(); @@ -276,8 +291,6 @@ void wxActListProcTimer::Notify(){ wxPostEvent(static_cast(ActMgrPtr), uevent); iter->second = 5; - //lstActivityPtr->SetItem(LongIter->second, 2, _("Failed")); - } else if (iter->second == 3){ ueventdata->ItemIndex = LongIter->second; @@ -286,9 +299,6 @@ void wxActListProcTimer::Notify(){ wxPostEvent(static_cast(ActMgrPtr), uevent); iter->second = 5; - //lstActivityPtr->SetItem(LongIter->second, 2, _("Stopped")); - //iter->second = 6; - } else if (iter->second == 4){ ueventdata->ItemIndex = LongIter->second; @@ -296,9 +306,6 @@ void wxActListProcTimer::Notify(){ wxPostEvent(static_cast(ActMgrPtr), uevent); iter->second = 8; - - //lstActivityPtr->SetItem(LongIter->second, 2, _("Completed")); - //iter->second = 8; } @@ -308,13 +315,7 @@ void wxActListProcTimer::Notify(){ adt = adt.Now(); ActListFinDTPtr->insert(std::make_pair(iter->first, adt)); - - // Delete the connection object. - - std::map::iterator ConnObject = ActListConnPtr->find(iter->first); - delete ConnObject->second; - ConnObject->second = NULL; - + } if (ClearupProcessed == TRUE){ @@ -346,6 +347,8 @@ void wxActListProcTimer::SetupPointers(std::map *ActList, std::map *ActListFinDT, std::map *ActListConn){ + // Setup the pointers for wxActListProcTimer. + ActListPtr = ActList; ActListUIPtr = ActListUI; ActListDetailPtr = ActListDetail; @@ -363,12 +366,16 @@ void wxActListProcTimer::SetupPointers(std::map *ActList, std::map::iterator ETagIter; @@ -416,13 +423,13 @@ void wxETagProcessTimer::ReloadAccounts(){ AccountDir = PrefData.accounts.GetAccountDirectory(i); AccountType = PrefData.accounts.GetAccountType(i); - + if (AccountDir.IsEmpty()){ continue; } - if (AccountType == wxT("Local") || AccountType == wxT("local")){ - continue; + if (AccountType != wxT("CardDAV") && AccountType != wxT("carddav")){ + continue; } AccountDir.Trim(); @@ -444,6 +451,8 @@ void wxETagProcessTimer::ReloadAccounts(){ ETagDB* wxETagProcessTimer::GetPointer(wxString AccountName){ + // Get the pointer of the ETag Database. + ETagDB *ETagDBPtr = NULL; std::map::iterator ETagIter; @@ -462,6 +471,8 @@ ETagDB* wxETagProcessTimer::GetPointer(wxString AccountName){ void wxContactFileMonitorTimer::Notify(){ + // Notify function for wxContactFileMonitorTimer. + if (Filename.IsEmpty()){ return; @@ -487,6 +498,8 @@ void wxContactFileMonitorTimer::Notify(){ void wxContactFileMonitorTimer::SetFilename(wxString FilenameInc){ + // Set the filename for the wxContactFileMonitorTimer object. + Filename = FilenameInc; wxFileName FileCheck(Filename); @@ -496,12 +509,16 @@ void wxContactFileMonitorTimer::SetFilename(wxString FilenameInc){ void wxContactFileMonitorTimer::SetupPointers(frmContactEditor *frmCEPtrInc){ + // Setup the pointers for the wxContactFileMonitorTimer object. + frmCEPtr = frmCEPtrInc; } void wxContactFileMonitorTimer::UpdateTimestamp(){ + // Update the timestamp for the wxContactFileMonitorTimer object. + wxFileName FileCheck(Filename); FileDateTime = FileCheck.GetModificationTime(); @@ -509,35 +526,22 @@ void wxContactFileMonitorTimer::UpdateTimestamp(){ void wxContactWindowMonitor::Notify(){ - // Look through the list of windows and see if any have - // closed. IF they have closed then delete and free the - // memory (also delete from the map). - - /*for(std::map::iterator iter = ContactWindowListPtr->begin(); - iter != ContactWindowListPtr->end(); iter++){ - - frmContact *ContactPtr = (frmContact*)iter->second; - - // Check if open. - - if ( - - // Delete the form. - - // Delete the data from the map. - - }*/ + // Notify function for the wxContactWindowMonitor object. } void wxContactWindowMonitor::SetupPointers(std::map *ContactWindowListPtrInc){ + // Setup pointers for the wxContactWindowMonitor. + ContactWindowListPtr = ContactWindowListPtrInc; } void wxAccountSyncTimer::Notify(){ + // Notify function for the wxAccountSyncTimer. + frmActivityMgr *ActMgrPtrProc = static_cast(frmActMgrPtr); // Disable the timer. (Don't go updating unless needed). @@ -567,6 +571,8 @@ void wxAccountSyncTimer::Notify(){ void wxAccountSyncTimer::SetupData(wxString AccNameInc, wxString AccNameFullInc){ + // Setup the data for the wxAccountSyncTimer object. + // Set the account name. AccName = AccNameInc; @@ -577,7 +583,7 @@ void wxAccountSyncTimer::SetupData(wxString AccNameInc, void wxAccountSyncTimer::SetupPointers(void *frmMainPtrInc, void *frmActMgrPtrInc, ETagDB *ETagDBPtrInc){ - // Set the pointers. + // Setup the pointers for the wxAccountSyncTimer object. frmMainPtr = frmMainPtrInc; frmActMgrPtr = frmActMgrPtrInc; @@ -587,6 +593,8 @@ void wxAccountSyncTimer::SetupPointers(void *frmMainPtrInc, void SleepFor(unsigned long longSleepNanoSecs){ + // Sleep for specified nano seconds. + #ifdef __WIN32__ ::Sleep((longSleepNanoSecs / 1000000)); #elif __HAIKU__