Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Move INSTALL, LICENSE, README, THANKS and TODO into root directory
[xestiaab/.git] / source / common / timers.cpp
index e95347e..6e49cab 100644 (file)
 // You should have received a copy of the GNU General Public License along
 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
 
-#include "../actmgr/frmActivityMgr.h"
-#include "../frmContact.h"
-#include "../frmMain.h"
-#include <wx/mstream.h>
-#include <wx/file.h>
-#include <wx/ffile.h>
-#include <wx/filename.h>
-#include <wx/tokenzr.h>
-#include "../bitmaps.h"
-#include "../enums.h"
-#include "../common/preferences.h"
-#include "../common/etag.h"
-#include "../common/dirs.h"
+#include "timers.h"
 
 void wxActTimer::Notify(){
 
@@ -297,7 +285,7 @@ void wxActListProcTimer::Notify(){
                        ueventdata->ItemLabel = _("Stopped");
            
                        wxPostEvent(static_cast<frmActivityMgr*>(ActMgrPtr), uevent);
-                       iter->second = 5;
+                       iter->second = 6;
             
                } else if (iter->second == 4){
             
@@ -309,6 +297,17 @@ void wxActListProcTimer::Notify(){
             
                }
         
+               // Delete the connection object if finished.
+               
+               if (iter->second > 4){
+               
+                       std::map<int,ConnectionObject*>::iterator ConnObjectIter = ActListConnObjectsPtr->find(iter->first);
+               
+                       delete ConnObjectIter->second;
+                       ConnObjectIter->second = nullptr;
+                       
+               }
+               
                // Insert a finish date.
        
                wxDateTime adt;
@@ -345,7 +344,7 @@ void wxActListProcTimer::SetupPointers(std::map<int,int> *ActList, std::map<int,
                                        std::map<int,wxString> *ActListDetail, bool *TasksActive,
                                        wxListCtrl *lstActivity, wxStaticText *lblDetails, wxGauge *GauProgress,
                                        void *ActMgr, wxActTimer *ActTimer, wxActProcessTimer *ActProcessTimer,
-                                       std::map<int,wxDateTime> *ActListFinDT, std::map<int, CardDAV*> *ActListConn){
+                                       std::map<int,wxDateTime> *ActListFinDT, std::map<int,ConnectionObject*> *ActListConnObjects){
     
        // Setup the pointers for wxActListProcTimer.
     
@@ -360,7 +359,7 @@ void wxActListProcTimer::SetupPointers(std::map<int,int> *ActList, std::map<int,
        ActTimerPtr = ActTimer;
        ActProcessTimerPtr = ActProcessTimer;
        ActListFinDTPtr = ActListFinDT;
-       ActListConnPtr = ActListConn;
+       ActListConnObjectsPtr = ActListConnObjects;
     
 }
 
@@ -391,7 +390,6 @@ void wxETagProcessTimer::Notify(){
         
        }
     
-    
 }
 
 void wxETagProcessTimer::ReloadAccounts(){
@@ -423,13 +421,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();
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