void CWizDocumentEditStatusSyncThread::documentSaved(const QString& strUserAlias, const QString& strKbGUID, const QString& strGUID) { // qDebug() << "EditStatusSyncThread document saved : kbguid : " << strKbGUID << " guid : " << strGUID; QString strObjID = combineObjID(strKbGUID, strGUID); if (strObjID.isEmpty()) return; m_mutext.lock(); if (m_doneMap.contains(strObjID)) { m_doneMap.remove(strObjID); } m_modifiedMap.insert(strObjID, strUserAlias); m_mutext.unlock(); }
void WizDocumentEditStatusSyncThread::startEditingDocument(const QString& strUserAlias, const QString& strKbGUID, const QString& strGUID) { QString strObjID = combineObjID(strKbGUID, strGUID); if (strObjID.isEmpty()) return; m_mutex.lock(); if (m_doneMap.contains(strObjID)) { m_doneMap.remove(strObjID); } m_editingMap.insert(strObjID, strUserAlias); m_wait.wakeAll(); m_mutex.unlock(); }
void CWizDocumentEditStatusSyncThread::documentUploaded(const QString& strKbGUID, const QString& strGUID) { QString strObjID = combineObjID(strKbGUID, strGUID); if (strObjID.isEmpty()) return; m_mutext.lock(); if (m_modifiedMap.contains(strObjID)) { if (!m_editingMap.contains(strObjID)) { m_doneMap.insert(strObjID, m_modifiedMap.value(strObjID)); m_sendNow = true; } m_modifiedMap.remove(strObjID); } m_mutext.unlock(); }
void CWizDocumentEditStatusSyncThread::stopEditingDocument(const QString& strKbGUID, \ const QString& strGUID, bool bModified) { // qDebug() << "stop editing document , guid " << strGUID << " modified : " << bModified; QString strObjID = combineObjID(strKbGUID, strGUID); if (strObjID.isEmpty()) return; m_mutext.lock(); if (m_editingMap.contains(strObjID)) { if (bModified) { m_modifiedMap.insert(strObjID, m_editingMap.value(strObjID)); } else if (!m_modifiedMap.contains(strObjID)) { m_doneMap.insert(strObjID, m_editingMap.value(strObjID)); m_sendNow = true; } m_editingMap.remove(strObjID); } m_mutext.unlock(); }