Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Replaced CardDAV with CardDAV* in the activity manager, improving memory usage.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 30 Nov 2015 10:31:18 +0000 (10:31 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 30 Nov 2015 10:31:18 +0000 (10:31 +0000)
source/common/timers.cpp
source/common/timers.h
source/frmActivityMgr.cpp
source/frmActivityMgr.h

index 3f0b181..c3ed546 100644 (file)
@@ -313,6 +313,12 @@ void wxActListProcTimer::Notify(){
         
         ActListFinDTPtr->insert(std::make_pair(iter->first, adt));
         
         
         ActListFinDTPtr->insert(std::make_pair(iter->first, adt));
         
+       // Delete the connection object.
+       
+       std::map<int, CardDAV*>::iterator ConnObject = ActListConnPtr->find(iter->first);
+       delete ConnObject->second;
+       ConnObject->second = NULL;
+       
     }
     
     if (ClearupProcessed == TRUE){
     }
     
     if (ClearupProcessed == TRUE){
@@ -342,7 +348,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,wxString> *ActListDetail, bool *TasksActive,
                                        wxListCtrl *lstActivity, wxStaticText *lblDetails, wxGauge *GauProgress,
                                        void *ActMgr, wxActTimer *ActTimer, wxActProcessTimer *ActProcessTimer,
-                                       std::map<int,wxDateTime> *ActListFinDT){
+                                       std::map<int,wxDateTime> *ActListFinDT, std::map<int, CardDAV*> *ActListConn){
     
     ActListPtr = ActList;
     ActListUIPtr = ActListUI;
     
     ActListPtr = ActList;
     ActListUIPtr = ActListUI;
@@ -355,6 +361,7 @@ void wxActListProcTimer::SetupPointers(std::map<int,int> *ActList, std::map<int,
     ActTimerPtr = ActTimer;
     ActProcessTimerPtr = ActProcessTimer;
     ActListFinDTPtr = ActListFinDT;
     ActTimerPtr = ActTimer;
     ActProcessTimerPtr = ActProcessTimer;
     ActListFinDTPtr = ActListFinDT;
+    ActListConnPtr = ActListConn;
     
 }
 
     
 }
 
index abb0e33..aa5bc8f 100644 (file)
@@ -75,6 +75,7 @@ private:
     std::map<int,int> *ActListPtr;
     std::map<int,long> *ActListUIPtr;
     std::map<int,wxString> *ActListDetailPtr;
     std::map<int,int> *ActListPtr;
     std::map<int,long> *ActListUIPtr;
     std::map<int,wxString> *ActListDetailPtr;
+    std::map<int,CardDAV*> *ActListConnPtr;
     wxListCtrl *lstActivityPtr;
     wxStaticText *lblDetailsPtr;
     bool *TasksActivePtr;
     wxListCtrl *lstActivityPtr;
     wxStaticText *lblDetailsPtr;
     bool *TasksActivePtr;
@@ -95,7 +96,7 @@ public:
                        std::map<int,wxString> *ActListDetail, bool *TasksActive,
                        wxListCtrl *lstActivity, wxStaticText *lblDetails, wxGauge *GauProgress,
                        void *ActMgr, wxActTimer *ActTimer, wxActProcessTimer *ActProcessTimer,
                        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,wxDateTime> *ActListFinDT, std::map<int, CardDAV*> *ActListConn);
     void EnableClearup();
     
 };
     void EnableClearup();
     
 };
index f26e00f..69ae3c7 100644 (file)
@@ -82,7 +82,7 @@ frmActivityMgrADT( parent )
        
        ActListProcTimer.SetupPointers(&ActivityList, &ActivityListIndex, &ActivityListTaskDetail, 
                                        &TasksActive, lstActivity, lblDetails, GauProgress, this, &AnimationTimer,
        
        ActListProcTimer.SetupPointers(&ActivityList, &ActivityListIndex, &ActivityListTaskDetail, 
                                        &TasksActive, lstActivity, lblDetails, GauProgress, this, &AnimationTimer,
-                                       &ActProcessTimer, &ActivityListFinDate);
+                                       &ActProcessTimer, &ActivityListFinDate, &ActivityListConn);
        
        AnimationTimer.SetBitmap(bmpActivity);
        AnimationTimer.SetSleepBitmap(&SleepBitmap);
        
        AnimationTimer.SetBitmap(bmpActivity);
        AnimationTimer.SetSleepBitmap(&SleepBitmap);
@@ -180,7 +180,7 @@ int frmActivityMgr::AddTask(int TaskType, wxString TaskDetail, wxString TaskAcco
 
        wxListItem coldata;
        long itemindex = -1;
 
        wxListItem coldata;
        long itemindex = -1;
-       CardDAV CardDAVConn;
+       CardDAV* CardDAVConn = new CardDAV;
 
        coldata.SetId(ActivityTaskID);
        coldata.SetData(ActivityTaskID);
 
        coldata.SetId(ActivityTaskID);
        coldata.SetData(ActivityTaskID);
@@ -233,9 +233,9 @@ int frmActivityMgr::AddTask(int TaskType, wxString TaskDetail, wxString TaskAcco
        
        }
        
        
        }
        
-       CardDAVConn.SetupConnection(AccountAddress, AccountPort, AccountUsername, AccountPassword, AccountSSL, AccountPrefix, AccountDir);
-       CardDAVConn.SetupVariables(&ActivityList, ActivityTaskID);
-       CardDAVConn.SetupResultBools(&BlankBool, &BlankBool);           
+       CardDAVConn->SetupConnection(AccountAddress, AccountPort, AccountUsername, AccountPassword, AccountSSL, AccountPrefix, AccountDir);
+       CardDAVConn->SetupVariables(&ActivityList, ActivityTaskID);
+       CardDAVConn->SetupResultBools(&BlankBool, &BlankBool);          
 
        // TaskType:
        // 0 - Add a contact.
 
        // TaskType:
        // 0 - Add a contact.
@@ -251,8 +251,8 @@ int frmActivityMgr::AddTask(int TaskType, wxString TaskDetail, wxString TaskAcco
                lstActivity->SetItem(itemindex, 1, AccountName);
                lstActivity->SetItem(itemindex, 2, _("Queued"));
                
                lstActivity->SetItem(itemindex, 1, AccountName);
                lstActivity->SetItem(itemindex, 2, _("Queued"));
                
-               CardDAVConn.SetUploadMode(TRUE);
-               CardDAVConn.SetupData(wxT("PUT"), TaskURL, TaskData);
+               CardDAVConn->SetUploadMode(TRUE);
+               CardDAVConn->SetupData(wxT("PUT"), TaskURL, TaskData);
                
                // Setup all of the task details.
 
                
                // Setup all of the task details.
 
@@ -279,9 +279,9 @@ int frmActivityMgr::AddTask(int TaskType, wxString TaskDetail, wxString TaskAcco
                lstActivity->SetItem(itemindex, 1, AccountName);
                lstActivity->SetItem(itemindex, 2, _("Queued"));
                
                lstActivity->SetItem(itemindex, 1, AccountName);
                lstActivity->SetItem(itemindex, 2, _("Queued"));
                
-               CardDAVConn.SetUploadMode(TRUE);
-               CardDAVConn.SetupData(wxT("PUT"), TaskURL, TaskData);
-               CardDAVConn.SetEditMode(TRUE);
+               CardDAVConn->SetUploadMode(TRUE);
+               CardDAVConn->SetupData(wxT("PUT"), TaskURL, TaskData);
+               CardDAVConn->SetEditMode(TRUE);
                
                ETagDB *ETagDBPtr = ETagTmrPtr->GetPointer(AccountDir);
                
                
                ETagDB *ETagDBPtr = ETagTmrPtr->GetPointer(AccountDir);
                
@@ -378,11 +378,11 @@ void frmActivityMgr::StopTask( wxCommandEvent& event ){
                return;
        }
        
                return;
        }
        
-       std::map<int,CardDAV>::iterator CDAVter;
+       std::map<int,CardDAV*>::iterator CDAVter;
        
        CDAVter = ActivityListConn.find(intSelectedData);
        
        
        CDAVter = ActivityListConn.find(intSelectedData);
        
-       CDAVter->second.Abort();
+       CDAVter->second->Abort();
        
        lstActivity->SetItem(longSelected, 2, _("Stopped"));
 
        
        lstActivity->SetItem(longSelected, 2, _("Stopped"));
 
@@ -407,11 +407,11 @@ void frmActivityMgr::StopAllTasks( wxCommandEvent& event ){
                return;
        }
        
                return;
        }
        
-       std::map<int,CardDAV>::iterator CDAVter;
+       std::map<int,CardDAV*>::iterator CDAVter;
        
        CDAVter = ActivityListConn.find(intSelectedData);
        
        
        CDAVter = ActivityListConn.find(intSelectedData);
        
-       CDAVter->second.Abort();
+       CDAVter->second->Abort();
        
        lstActivity->SetItem(longSelected, 2, _("Stopped"));
        AnimationTimer.StopAnimation();
        
        lstActivity->SetItem(longSelected, 2, _("Stopped"));
        AnimationTimer.StopAnimation();
@@ -437,7 +437,7 @@ void frmActivityMgr::RetryTask( wxCommandEvent& event ){
                return;
        }
        
                return;
        }
        
-       std::map<int,CardDAV>::iterator CDAVter;
+       std::map<int,CardDAV*>::iterator CDAVter;
        
        CDAVter = ActivityListConn.find(intSelectedData);
        
        
        CDAVter = ActivityListConn.find(intSelectedData);
        
@@ -498,7 +498,7 @@ void frmActivityMgr::ProcessTasksThread()
        std::map<int,wxString>::iterator StringTaskDetailIter;
        std::map<int,wxString>::iterator StringETagIter;
        std::map<int,wxString>::iterator StringETagOrigIter;
        std::map<int,wxString>::iterator StringTaskDetailIter;
        std::map<int,wxString>::iterator StringETagIter;
        std::map<int,wxString>::iterator StringETagOrigIter;
-       std::map<int,CardDAV>::iterator CardDAVIter;
+       std::map<int,CardDAV*>::iterator CardDAVIter;
        std::map<int,long>::iterator LongIter;
        bool TasksFoundProc = FALSE;
        wxString TaskDetail;
        std::map<int,long>::iterator LongIter;
        bool TasksFoundProc = FALSE;
        wxString TaskDetail;
@@ -549,8 +549,8 @@ void frmActivityMgr::ProcessTasksThread()
                        iter->second = 1;
                        
                        if (TypeIter->second == 1){
                        iter->second = 1;
                        
                        if (TypeIter->second == 1){
-                               CardDAVIter->second.GetServerETagValueThread();
-                               ETagServer = CardDAVIter->second.ETagValueResult();
+                               CardDAVIter->second->GetServerETagValueThread();
+                               ETagServer = CardDAVIter->second->ETagValueResult();
                        }
                        
                        // Compare the ETags and work out if a conflict has occured.
                        }
                        
                        // Compare the ETags and work out if a conflict has occured.
@@ -588,8 +588,8 @@ void frmActivityMgr::ProcessTasksThread()
                                        
                                                // Load the client data from the filename given.
                                        
                                        
                                                // Load the client data from the filename given.
                                        
-                                               CardDAVIter->second.GetServerContactData();
-                                               ServerContactData = CardDAVIter->second.GetPageData();
+                                               CardDAVIter->second->GetServerContactData();
+                                               ServerContactData = CardDAVIter->second->GetPageData();
                                                
                                                // Process v3 version into v4 version.
                                                
                                                
                                                // Process v3 version into v4 version.
                                                
@@ -650,7 +650,7 @@ void frmActivityMgr::ProcessTasksThread()
                                        
                                                        // Decided to use client version.
                                        
                                        
                                                        // Decided to use client version.
                                        
-                                                       CardDAVIter->second.ProcessData();
+                                                       CardDAVIter->second->ProcessData();
                                                
                                                        iter->second = 4;
                                        
                                                
                                                        iter->second = 4;
                                        
@@ -670,7 +670,7 @@ void frmActivityMgr::ProcessTasksThread()
                                
                                                // Update the data to the server.
                                        
                                
                                                // Update the data to the server.
                                        
-                                               CardDAVIter->second.ProcessData();
+                                               CardDAVIter->second->ProcessData();
                                
                                        }
                        
                                
                                        }
                        
@@ -695,8 +695,8 @@ void frmActivityMgr::ProcessTasksThread()
                                        
                                                // Load the client data from the filename given.
                                        
                                        
                                                // Load the client data from the filename given.
                                        
-                                               CardDAVIter->second.GetServerContactData();
-                                               ServerContactData = CardDAVIter->second.GetPageData();
+                                               CardDAVIter->second->GetServerContactData();
+                                               ServerContactData = CardDAVIter->second->GetPageData();
                                                ClientData.LoadFile(FullFilename);
                                                
                                                // Process v3 version into v4 version.
                                                ClientData.LoadFile(FullFilename);
                                                
                                                // Process v3 version into v4 version.
@@ -748,7 +748,7 @@ void frmActivityMgr::ProcessTasksThread()
                                        
                                                        // Decided to use client version.
                                        
                                        
                                                        // Decided to use client version.
                                        
-                                                       CardDAVIter->second.ProcessData();
+                                                       CardDAVIter->second->ProcessData();
                                                        //ETagServer = CardDAVIter->second.GetServerETagValueThread();
                                                        //ETagDBPtr->UpdateETag(ContactFilename, ETagServer, ETagServer);
                                                
                                                        //ETagServer = CardDAVIter->second.GetServerETagValueThread();
                                                        //ETagDBPtr->UpdateETag(ContactFilename, ETagServer, ETagServer);
                                                
@@ -770,7 +770,7 @@ void frmActivityMgr::ProcessTasksThread()
                                
                                                // Update the data to the server.
                                        
                                
                                                // Update the data to the server.
                                        
-                                               CardDAVIter->second.ProcessData();
+                                               CardDAVIter->second->ProcessData();
                                
                                        }
                        
                                
                                        }
                        
@@ -778,11 +778,12 @@ void frmActivityMgr::ProcessTasksThread()
                                
                                // Update the ETag DB.
                                
                                
                                // Update the ETag DB.
                                
-                               CardDAVIter->second.GetServerETagValueThread();
-                               ETagServer = CardDAVIter->second.ETagValueResult();
+                               CardDAVIter->second->GetServerETagValueThread();
+                               ETagServer = CardDAVIter->second->ETagValueResult();
                                ETagDBPtr->UpdateETag(ContactFilename, ETagServer, ETagServer);
                        
                                iter->second = 4;
                                ETagDBPtr->UpdateETag(ContactFilename, ETagServer, ETagServer);
                        
                                iter->second = 4;
+                               CardDAVIter->second = NULL;
                        
                        } else if (TypeIter->second == 2) {
                        
                        
                        } else if (TypeIter->second == 2) {
                        
@@ -793,13 +794,14 @@ void frmActivityMgr::ProcessTasksThread()
                                                                
                                ETagDB *ETagDBPtr = ETagTmrPtr->GetPointer(AccountDir);
                                
                                                                
                                ETagDB *ETagDBPtr = ETagTmrPtr->GetPointer(AccountDir);
                                
-                               CardDAVIter->second.SetUploadMode(FALSE);
-                               CardDAVIter->second.SetupData(wxT("DELETE"), ContactFilename, wxT(""));
+                               CardDAVIter->second->SetUploadMode(FALSE);
+                               CardDAVIter->second->SetupData(wxT("DELETE"), ContactFilename, wxT(""));
                                //CardDAVIter->second.SetServerFilename();
                                //CardDAVIter->second.SetServerFilename();
-                               CardDAVIter->second.ProcessData();
+                               CardDAVIter->second->ProcessData();
                                ETagDBPtr->RemoveETag(ContactFilename);
                                
                                iter->second = 4;
                                ETagDBPtr->RemoveETag(ContactFilename);
                                
                                iter->second = 4;
+                               CardDAVIter->second = NULL;
                        
                        } else if (TypeIter->second == 3) {
                        
                        
                        } else if (TypeIter->second == 3) {
                        
@@ -894,17 +896,14 @@ void frmActivityMgr::ProcessTasksThread()
                                
                                        std::map<wxString,ETagData> ETagDBData = ETagDBPtr->GetETagData();
                                        
                                
                                        std::map<wxString,ETagData> ETagDBData = ETagDBPtr->GetETagData();
                                        
-                                       CardDAV CardDAVInstance = CardDAVIter->second;
-                                       
                                        bool ExitLoop = FALSE;
 
                                        std::map<wxString,FileSyncData> *SCListData = NULL;
                                        
                                        while (ExitLoop == FALSE){
                                        
                                        bool ExitLoop = FALSE;
 
                                        std::map<wxString,FileSyncData> *SCListData = NULL;
                                        
                                        while (ExitLoop == FALSE){
                                        
-                                               //ServerContactList = CardDAVInstance.GetContactList(SyncTokenLoad.ToUTF8());
-                                               ServerContactList = CardDAVIter->second.GetContactList(SyncTokenLoad.ToUTF8());
-                                               SSLCertCollection certcol = CardDAVIter->second.GetCertificateData();
+                                               ServerContactList = CardDAVIter->second->GetContactList(SyncTokenLoad.ToUTF8());
+                                               SSLCertCollection certcol = CardDAVIter->second->GetCertificateData();
                                
                                                // Create a pointer for the std::map<wxString,FileSyncData>.
                                
                                
                                                // Create a pointer for the std::map<wxString,FileSyncData>.
                                
@@ -912,7 +911,7 @@ void frmActivityMgr::ProcessTasksThread()
                                
                                                // Check if any errors have occured whilst getting the data.
                                
                                
                                                // Check if any errors have occured whilst getting the data.
                                
-                                               int ErrorCode = CardDAVIter->second.GetResultCode();
+                                               int ErrorCode = CardDAVIter->second->GetResultCode();
                                
                                                if (ErrorCode != 0){
                                        
                                
                                                if (ErrorCode != 0){
                                        
@@ -964,14 +963,14 @@ void frmActivityMgr::ProcessTasksThread()
                                                                        // Accept the certificate. Write the certificate into the account
                                                                        // directory (as server.crt) - will overwrite old certificate.
 
                                                                        // Accept the certificate. Write the certificate into the account
                                                                        // directory (as server.crt) - will overwrite old certificate.
 
-                                                                       frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, CardDAVIter->second.GetCertificateData());
-                                                                       WriteServerCertificate(AccountDir, CardDAVIter->second.GetCertificateData());
+                                                                       frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, CardDAVIter->second->GetCertificateData());
+                                                                       WriteServerCertificate(AccountDir, CardDAVIter->second->GetCertificateData());
                                                                
                                                                } else if (SSLResult == 2){
                                                                
                                                                        // Reject the certificate, abort the task and mark as failed.
 
                                                                
                                                                } else if (SSLResult == 2){
                                                                
                                                                        // Reject the certificate, abort the task and mark as failed.
 
-                                                                       frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, CardDAVIter->second.GetCertificateData());
+                                                                       frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, CardDAVIter->second->GetCertificateData());
                                                                        iter->second = 2;
                                                                        break;
                                                                
                                                                        iter->second = 2;
                                                                        break;
                                                                
@@ -1000,7 +999,7 @@ void frmActivityMgr::ProcessTasksThread()
                                                break;
                                        }
                                
                                                break;
                                        }
                                
-                                       frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, CardDAVIter->second.GetCertificateData());
+                                       frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, CardDAVIter->second->GetCertificateData());
                                
                                        // Look in directory and see which vCards to add and delete
                                
                                
                                        // Look in directory and see which vCards to add and delete
                                
@@ -1113,9 +1112,9 @@ void frmActivityMgr::ProcessTasksThread()
                                                        
                                                                // Get the server contact data for comparison.
                                                        
                                                        
                                                                // Get the server contact data for comparison.
                                                        
-                                                               CardDAVIter->second.SetServerFilename(srviter->first);
-                                                               CardDAVIter->second.GetServerContactData();
-                                                               ServerContactData = CardDAVIter->second.GetPageData();
+                                                               CardDAVIter->second->SetServerFilename(srviter->first);
+                                                               CardDAVIter->second->GetServerContactData();
+                                                               ServerContactData = CardDAVIter->second->GetPageData();
                                                        
                                                                FullFilename = CreateFilenamePath(AccountDirFinal, srviter->first);
                                                        
                                                        
                                                                FullFilename = CreateFilenamePath(AccountDirFinal, srviter->first);
                                                        
@@ -1249,9 +1248,9 @@ void frmActivityMgr::ProcessTasksThread()
                                        
                                                        vCard34Conv vCard34Obj;
                                                
                                        
                                                        vCard34Conv vCard34Obj;
                                                
-                                                       CardDAVIter->second.SetServerFilename(additer->first);
-                                                       CardDAVIter->second.GetServerContactData();
-                                                       vCardInputData = CardDAVIter->second.GetPageData();
+                                                       CardDAVIter->second->SetServerFilename(additer->first);
+                                                       CardDAVIter->second->GetServerContactData();
+                                                       vCardInputData = CardDAVIter->second->GetPageData();
                                                
                                                        vCard34Obj.ConvertToV4(&vCardInputData, &ConvertedV4Data);
                                                
                                                
                                                        vCard34Obj.ConvertToV4(&vCardInputData, &ConvertedV4Data);
                                                
@@ -1271,8 +1270,8 @@ void frmActivityMgr::ProcessTasksThread()
                                                        // Get the server ETag.
                                                
                                                        wxString ServerETag;
                                                        // Get the server ETag.
                                                
                                                        wxString ServerETag;
-                                                       CardDAVIter->second.GetServerETagValueThread();
-                                                       ServerETag = CardDAVIter->second.ETagValueResult();
+                                                       CardDAVIter->second->GetServerETagValueThread();
+                                                       ServerETag = CardDAVIter->second->ETagValueResult();
                                                
                                                        // Add to the ETag Database.
                                                
                                                
                                                        // Add to the ETag Database.
                                                
@@ -1297,8 +1296,8 @@ void frmActivityMgr::ProcessTasksThread()
                                                        // Update the ETagDB.
 
                                                        wxString ServerETag;
                                                        // Update the ETagDB.
 
                                                        wxString ServerETag;
-                                                       CardDAVIter->second.GetServerETagValueThread();
-                                                       ServerETag = CardDAVIter->second.ETagValueResult();
+                                                       CardDAVIter->second->GetServerETagValueThread();
+                                                       ServerETag = CardDAVIter->second->ETagValueResult();
                                                
                                                        // Add to the ETag Database.
                                                
                                                
                                                        // Add to the ETag Database.
                                                
@@ -1362,9 +1361,9 @@ void frmActivityMgr::ProcessTasksThread()
                        
                                                        // Compare the ETag with the Server ETag.
                                                
                        
                                                        // Compare the ETag with the Server ETag.
                                                
-                                                       CardDAVIter->second.SetServerFilename(vCardAdd[vi]);
-                                                       CardDAVIter->second.GetServerETagValueThread();
-                                                       ETagServer = CardDAVIter->second.ETagValueResult();
+                                                       CardDAVIter->second->SetServerFilename(vCardAdd[vi]);
+                                                       CardDAVIter->second->GetServerETagValueThread();
+                                                       ETagServer = CardDAVIter->second->ETagValueResult();
                                
                                                        if (ETagOriginal != ETagServer){
                                
                                
                                                        if (ETagOriginal != ETagServer){
                                
@@ -1382,8 +1381,8 @@ void frmActivityMgr::ProcessTasksThread()
                                        
                                                                // Load the client data from the filename given.
                                        
                                        
                                                                // Load the client data from the filename given.
                                        
-                                                               CardDAVIter->second.GetServerContactData();
-                                                               ServerContactData = CardDAVIter->second.GetPageData();
+                                                               CardDAVIter->second->GetServerContactData();
+                                                               ServerContactData = CardDAVIter->second->GetPageData();
                                                
                                                                // Process v3 version into v4 version.
                                                
                                                
                                                                // Process v3 version into v4 version.
                                                
@@ -1444,7 +1443,7 @@ void frmActivityMgr::ProcessTasksThread()
                                        
                                                                        // Decided to use client version.
                                        
                                        
                                                                        // Decided to use client version.
                                        
-                                                                       CardDAVIter->second.ProcessData();
+                                                                       CardDAVIter->second->ProcessData();
                                                
                                                                        iter->second = 4;
                                        
                                                
                                                                        iter->second = 4;
                                        
@@ -1493,15 +1492,15 @@ void frmActivityMgr::ProcessTasksThread()
 
                                                                // Upload the data to the server.
                                        
 
                                                                // Upload the data to the server.
                                        
-                                                               CardDAVIter->second.SetUploadMode(TRUE);
-                                                               CardDAVIter->second.SetupData(wxT("PUT"), vCardAdd[vi], TaskData);
-                                                               CardDAVIter->second.ProcessData();
+                                                               CardDAVIter->second->SetUploadMode(TRUE);
+                                                               CardDAVIter->second->SetupData(wxT("PUT"), vCardAdd[vi], TaskData);
+                                                               CardDAVIter->second->ProcessData();
                                                        
                                                                // Get the Server ETag and put it in the ETag database.
                                                        
                                                        
                                                                // Get the Server ETag and put it in the ETag database.
                                                        
-                                                               CardDAVIter->second.SetServerFilename(vCardAdd[vi]);
-                                                               CardDAVIter->second.GetServerETagValueThread();
-                                                               ETagServer = CardDAVIter->second.ETagValueResult();
+                                                               CardDAVIter->second->SetServerFilename(vCardAdd[vi]);
+                                                               CardDAVIter->second->GetServerETagValueThread();
+                                                               ETagServer = CardDAVIter->second->ETagValueResult();
                                
                                                                ETagDBPtr->AddETag(vCardAdd[vi], ETagServer, ETagServer);
                                
                                
                                                                ETagDBPtr->AddETag(vCardAdd[vi], ETagServer, ETagServer);
                                
@@ -1528,8 +1527,8 @@ void frmActivityMgr::ProcessTasksThread()
                                        
                                                                // Load the client data from the filename given.
                                        
                                        
                                                                // Load the client data from the filename given.
                                        
-                                                               CardDAVIter->second.GetServerContactData();
-                                                               ServerContactData = CardDAVIter->second.GetPageData();
+                                                               CardDAVIter->second->GetServerContactData();
+                                                               ServerContactData = CardDAVIter->second->GetPageData();
                                                                ClientData.LoadFile(FullFilename);
                                                
                                                                // Process v3 version into v4 version.
                                                                ClientData.LoadFile(FullFilename);
                                                
                                                                // Process v3 version into v4 version.
@@ -1581,7 +1580,7 @@ void frmActivityMgr::ProcessTasksThread()
                                        
                                                                        // Decided to use client version.
                                                                
                                        
                                                                        // Decided to use client version.
                                                                
-                                                                       CardDAVIter->second.ProcessData();
+                                                                       CardDAVIter->second->ProcessData();
                                                                        //ETagServer = CardDAVIter->second.GetServerETagValueThread();
                                                                        //ETagDBPtr->UpdateETag(ContactFilename, ETagServer, ETagServer);
                                                
                                                                        //ETagServer = CardDAVIter->second.GetServerETagValueThread();
                                                                        //ETagDBPtr->UpdateETag(ContactFilename, ETagServer, ETagServer);
                                                
@@ -1632,15 +1631,15 @@ void frmActivityMgr::ProcessTasksThread()
 
                                                                // Upload the data to the server.
                                        
 
                                                                // Upload the data to the server.
                                        
-                                                               CardDAVIter->second.SetUploadMode(TRUE);
-                                                               CardDAVIter->second.SetupData(wxT("PUT"), vCardAdd[vi], TaskData);
-                                                               CardDAVIter->second.ProcessData();
+                                                               CardDAVIter->second->SetUploadMode(TRUE);
+                                                               CardDAVIter->second->SetupData(wxT("PUT"), vCardAdd[vi], TaskData);
+                                                               CardDAVIter->second->ProcessData();
                                                        
                                                                // Get the Server ETag and put it in the ETag database.
                                                        
                                                        
                                                                // Get the Server ETag and put it in the ETag database.
                                                        
-                                                               CardDAVIter->second.SetServerFilename(vCardAdd[vi]);
-                                                               CardDAVIter->second.GetServerETagValueThread();
-                                                               ETagServer = CardDAVIter->second.ETagValueResult();
+                                                               CardDAVIter->second->SetServerFilename(vCardAdd[vi]);
+                                                               CardDAVIter->second->GetServerETagValueThread();
+                                                               ETagServer = CardDAVIter->second->ETagValueResult();
                                
                                
                                                                ETagDBPtr->AddETag(vCardAdd[vi], ETagServer, ETagServer);
                                
                                
                                                                ETagDBPtr->AddETag(vCardAdd[vi], ETagServer, ETagServer);
@@ -1677,9 +1676,9 @@ void frmActivityMgr::ProcessTasksThread()
                                        
                                                if (deliter->second == wxT("DELETED")){
 
                                        
                                                if (deliter->second == wxT("DELETED")){
 
-                                                       CardDAVIter->second.SetUploadMode(FALSE);
-                                                       CardDAVIter->second.SetupData(wxT("DELETE"), deliter->first, wxT(""));
-                                                       CardDAVIter->second.ProcessData();
+                                                       CardDAVIter->second->SetUploadMode(FALSE);
+                                                       CardDAVIter->second->SetupData(wxT("DELETE"), deliter->first, wxT(""));
+                                                       CardDAVIter->second->ProcessData();
                                        
                                                        // Delete the ETag as the file has now been deleted.
                                        
                                        
                                                        // Delete the ETag as the file has now been deleted.
                                        
@@ -1737,7 +1736,7 @@ void frmActivityMgr::ProcessTasksThread()
                        
                                // Update the data to the server.
                                        
                        
                                // Update the data to the server.
                                        
-                               CardDAVIter->second.ProcessData();
+                               CardDAVIter->second->ProcessData();
                                iter->second = 4;
                                continue;
                        
                                iter->second = 4;
                                continue;
                        
@@ -1761,8 +1760,8 @@ void frmActivityMgr::ProcessTasksThread()
                                AccountDir = StringAccountIter->second;
                                ETagDB *ETagDBPtr = ETagTmrPtr->GetPointer(AccountDir);
                                
                                AccountDir = StringAccountIter->second;
                                ETagDB *ETagDBPtr = ETagTmrPtr->GetPointer(AccountDir);
                                
-                               CardDAVIter->second.GetServerETagValueThread();
-                               ETagServer = CardDAVIter->second.ETagValueResult();
+                               CardDAVIter->second->GetServerETagValueThread();
+                               ETagServer = CardDAVIter->second->ETagValueResult();
                                ETagDBPtr->UpdateETag(ContactFilename, ETagServer, ETagServer);
                        
                        }
                                ETagDBPtr->UpdateETag(ContactFilename, ETagServer, ETagServer);
                        
                        }
@@ -1773,8 +1772,8 @@ void frmActivityMgr::ProcessTasksThread()
                                AccountDir = StringAccountIter->second;
                                ETagDB *ETagDBPtr = ETagTmrPtr->GetPointer(AccountDir);                 
 
                                AccountDir = StringAccountIter->second;
                                ETagDB *ETagDBPtr = ETagTmrPtr->GetPointer(AccountDir);                 
 
-                               CardDAVIter->second.GetServerETagValueThread();
-                               ETagServer = CardDAVIter->second.ETagValueResult();
+                               CardDAVIter->second->GetServerETagValueThread();
+                               ETagServer = CardDAVIter->second->ETagValueResult();
                                ETagDBPtr->UpdateETag(ContactFilename, ETagServer, ETagServer);
                        
                        }
                                ETagDBPtr->UpdateETag(ContactFilename, ETagServer, ETagServer);
                        
                        }
index c29e74a..f11bf79 100644 (file)
@@ -73,7 +73,7 @@ class frmActivityMgr : public frmActivityMgrADT
                std::map<int,wxString> ActivityListAccount;
                std::map<int,wxString> ActivityListFilename;
                std::map<int,wxString> ActivityListFullFilename;
                std::map<int,wxString> ActivityListAccount;
                std::map<int,wxString> ActivityListFilename;
                std::map<int,wxString> ActivityListFullFilename;
-               std::map<int,CardDAV> ActivityListConn;
+               std::map<int,CardDAV*> ActivityListConn;
                std::map<int,wxString> ActivityListETag;
                std::map<int,wxString> ActivityListETagOriginal;
                std::map<int,wxDateTime> ActivityListFinDate;
                std::map<int,wxString> ActivityListETag;
                std::map<int,wxString> ActivityListETagOriginal;
                std::map<int,wxDateTime> ActivityListFinDate;
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