| 92 | } |
| 93 | |
| 94 | bool WizKMSync::syncCore() |
| 95 | { |
| 96 | m_mapOldKeyValues.clear(); |
| 97 | m_pEvents->onSyncProgress(::GetSyncStartProgress(syncDatabaseLogin)); |
| 98 | m_pEvents->onStatus(QObject::tr("Connect to server")); |
| 99 | |
| 100 | if (m_pEvents->isStop()) |
| 101 | return FALSE; |
| 102 | |
| 103 | m_pEvents->onStatus(QObject::tr("Query server infomation")); |
| 104 | |
| 105 | if (!m_server.kb_getInfo()) |
| 106 | return false; |
| 107 | |
| 108 | QString kbInfoKey = m_bGroup ? m_userInfo.strKbGUID : ""; |
| 109 | m_pDatabase->setKbInfo(kbInfoKey, m_server.kbInfo()); |
| 110 | |
| 111 | if (m_pEvents->isStop()) |
| 112 | return FALSE; |
| 113 | |
| 114 | WIZKBINFO info = m_server.kbInfo(); |
| 115 | |
| 116 | m_pEvents->onStatus(QObject::tr("Query deleted objects list")); |
| 117 | if (!downloadDeletedList(info.nDeletedGUIDVersion)) |
| 118 | { |
| 119 | m_pEvents->onError(QObject::tr("Cannot download deleted objects list!")); |
| 120 | return FALSE; |
| 121 | } |
| 122 | |
| 123 | if (m_pEvents->isStop()) |
| 124 | return FALSE; |
| 125 | |
| 126 | m_pEvents->onStatus(QObject::tr("Upload deleted objects list")); |
| 127 | if (!uploadDeletedList()) |
| 128 | { |
| 129 | m_pEvents->onError(QObject::tr("Cannot upload deleted objects list!")); |
| 130 | //return FALSE; |
| 131 | } |
| 132 | |
| 133 | if (m_pEvents->isStop()) |
| 134 | return FALSE; |
| 135 | |
| 136 | m_pEvents->onStatus(QObject::tr("Upload tags")); |
| 137 | if (!uploadTagList()) |
| 138 | { |
| 139 | m_pEvents->onError(QObject::tr("Cannot upload tags!")); |
| 140 | return FALSE; |
| 141 | } |
| 142 | |
| 143 | if (m_pEvents->isStop()) |
| 144 | return FALSE; |
| 145 | |
| 146 | m_pEvents->onStatus(QObject::tr("Upload styles")); |
| 147 | if (!uploadStyleList()) |
| 148 | { |
| 149 | m_pEvents->onError(QObject::tr("Cannot upload styles!")); |
| 150 | return FALSE; |
| 151 | } |
nothing calls this directly
no test coverage detected