void CWizDownloadObjectData::startDownload() { Q_ASSERT(m_bInited); QString strUserId = m_dbMgr.db().getUserId(); QString strPasswd = m_dbMgr.db().getPassword(); setKbUrl(WIZ_API_URL); callClientLogin(strUserId, strPasswd); }
void CWizDownloadObjectData::onClientLogin(const WIZUSERINFO& userInfo) { Q_UNUSED(userInfo); // user private document if (m_data.strKbGUID == userInfo.strKbGUID) { setKbUrl(userInfo.strDatabaseServer); startDownloadObjectData(); return; } // group document QString strKbUrl = m_dbMgr.db(m_data.strKbGUID).server(); if (strKbUrl.isEmpty()) { callGetGroupList(); } else { setKbUrl(strKbUrl); startDownloadObjectData(); } }
void CWizDownloadObjectData::onGetGroupList(const CWizGroupDataArray& arrayGroup) { CWizGroupDataArray::const_iterator it; for (it = arrayGroup.begin(); it != arrayGroup.end(); it++) { const WIZGROUPDATA& group = *it; if (group.strGroupGUID == m_data.strKbGUID) { setKbUrl(group.strDatabaseServer); startDownloadObjectData(); return; } } }
void CWizKbSync::startSync(const QString& strKbGUID) { Q_ASSERT(!strKbGUID.isEmpty()); if (m_bSyncStarted) return; m_bSyncStarted = true; m_error = false; m_bChained = false; m_arrayAllDeletedsDownloaded.clear(); m_arrayAllDeletedsNeedToBeUploaded.clear(); m_arrayAllTagsDownloaded.clear(); m_arrayAllTagsNeedToBeUploaded.clear(); m_arrayAllStylesDownloaded.clear(); m_arrayAllStylesNeedToBeUploaded.clear(); m_arrayAllDocumentsNeedToBeDownloaded.clear(); m_nDocumentMaxVersion = -1; m_bDocumentInfoError = false; m_arrayAllDocumentsNeedToBeUploaded.clear(); m_currentUploadDocument = WIZDOCUMENTDATAEX(); m_arrayAllAttachmentsDownloaded.clear(); m_arrayAllAttachmentsNeedToBeUploaded.clear(); m_currentUploadAttachment = WIZDOCUMENTATTACHMENTDATAEX(); m_arrayAllObjectsNeedToBeDownloaded.clear(); Q_EMIT progressChanged(progressStart); setKbUrl(database()->server()); if (!strKbGUID.isEmpty()) setKbGUID(strKbGUID); startUploadDeleteds(); }
void CWizKbSync::startSync(const QString& strKbGUID) { Q_ASSERT(!strKbGUID.isEmpty()); if (m_bSyncStarted) return; m_bSyncStarted = true; m_error = false; m_arrayAllDeletedsDownloaded.clear(); m_arrayAllDeletedsNeedToBeUploaded.clear(); m_arrayAllTagsDownloaded.clear(); m_arrayAllTagsNeedToBeUploaded.clear(); m_arrayAllStylesDownloaded.clear(); m_arrayAllStylesNeedToBeUploaded.clear(); m_arrayAllDocumentsNeedToBeDownloaded.clear(); m_nDocumentMaxVersion = -1; m_bDocumentInfoError = false; m_arrayAllDocumentsNeedToBeUploaded.clear(); m_currentUploadDocument = WIZDOCUMENTDATAEX(); m_arrayAllAttachmentsDownloaded.clear(); m_arrayAllAttachmentsNeedToBeUploaded.clear(); m_currentUploadAttachment = WIZDOCUMENTATTACHMENTDATAEX(); m_arrayAllObjectsNeedToBeDownloaded.clear(); setKbUrl(database()->server()); if (!strKbGUID.isEmpty()) setKbGUID(strKbGUID); qDebug() << "\n\n[Syncing]Begin Syncing, database: " << database()->name(); startUploadDeleteds(); }