ActListProcTimer.SetupPointers(&ActivityList, &ActivityListIndex, &ActivityListTaskDetail,
&TasksActive, lstActivity, lblDetails, GauProgress, this, &AnimationTimer,
- &ActProcessTimer, &ActivityListFinDate);
+ &ActProcessTimer, &ActivityListFinDate, &ActivityListConn);
AnimationTimer.SetBitmap(bmpActivity);
AnimationTimer.SetSleepBitmap(&SleepBitmap);
wxListItem coldata;
long itemindex = -1;
- CardDAV CardDAVConn;
+ CardDAV* CardDAVConn = new CardDAV;
coldata.SetId(ActivityTaskID);
coldata.SetData(ActivityTaskID);
}
- 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.
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.
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);
return;
}
- std::map<int,CardDAV>::iterator CDAVter;
+ std::map<int,CardDAV*>::iterator CDAVter;
CDAVter = ActivityListConn.find(intSelectedData);
- CDAVter->second.Abort();
+ CDAVter->second->Abort();
lstActivity->SetItem(longSelected, 2, _("Stopped"));
return;
}
- std::map<int,CardDAV>::iterator CDAVter;
+ std::map<int,CardDAV*>::iterator CDAVter;
CDAVter = ActivityListConn.find(intSelectedData);
- CDAVter->second.Abort();
+ CDAVter->second->Abort();
lstActivity->SetItem(longSelected, 2, _("Stopped"));
AnimationTimer.StopAnimation();
return;
}
- std::map<int,CardDAV>::iterator CDAVter;
+ std::map<int,CardDAV*>::iterator CDAVter;
CDAVter = ActivityListConn.find(intSelectedData);
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;
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.
// 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.
// Decided to use client version.
- CardDAVIter->second.ProcessData();
+ CardDAVIter->second->ProcessData();
iter->second = 4;
// Update the data to the server.
- CardDAVIter->second.ProcessData();
+ CardDAVIter->second->ProcessData();
}
// 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.
// Decided to use client version.
- CardDAVIter->second.ProcessData();
+ CardDAVIter->second->ProcessData();
//ETagServer = CardDAVIter->second.GetServerETagValueThread();
//ETagDBPtr->UpdateETag(ContactFilename, ETagServer, ETagServer);
// Update the data to the server.
- CardDAVIter->second.ProcessData();
+ CardDAVIter->second->ProcessData();
}
// 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;
+ CardDAVIter->second = NULL;
} else if (TypeIter->second == 2) {
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.ProcessData();
+ CardDAVIter->second->ProcessData();
ETagDBPtr->RemoveETag(ContactFilename);
iter->second = 4;
+ CardDAVIter->second = NULL;
} else if (TypeIter->second == 3) {
std::map<wxString,ETagData> ETagDBData = ETagDBPtr->GetETagData();
- CardDAV CardDAVInstance = CardDAVIter->second;
-
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>.
// Check if any errors have occured whilst getting the data.
- int ErrorCode = CardDAVIter->second.GetResultCode();
+ int ErrorCode = CardDAVIter->second->GetResultCode();
if (ErrorCode != 0){
// 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.
- frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, CardDAVIter->second.GetCertificateData());
+ frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, CardDAVIter->second->GetCertificateData());
iter->second = 2;
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
// 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);
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);
// 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.
// Update the ETagDB.
wxString ServerETag;
- CardDAVIter->second.GetServerETagValueThread();
- ServerETag = CardDAVIter->second.ETagValueResult();
+ CardDAVIter->second->GetServerETagValueThread();
+ ServerETag = CardDAVIter->second->ETagValueResult();
// Add to the ETag Database.
// 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){
// 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.
// Decided to use client version.
- CardDAVIter->second.ProcessData();
+ CardDAVIter->second->ProcessData();
iter->second = 4;
// 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.
- 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);
// 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.
// Decided to use client version.
- CardDAVIter->second.ProcessData();
+ CardDAVIter->second->ProcessData();
//ETagServer = CardDAVIter->second.GetServerETagValueThread();
//ETagDBPtr->UpdateETag(ContactFilename, ETagServer, ETagServer);
// 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.
- 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);
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.
// Update the data to the server.
- CardDAVIter->second.ProcessData();
+ CardDAVIter->second->ProcessData();
iter->second = 4;
continue;
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);
}
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);
}