| 29 | static const char* ONEDRIVE_CLIENT_SECRET = "qtyfaBBYA403=unZUP40~_#"; |
| 30 | |
| 31 | static void copyDir(const QString &src, const QString &dst, QJsonArray &undoOps, uint appId) |
| 32 | { |
| 33 | QDir().mkpath(dst); |
| 34 | QDirIterator it(src, QDir::Files | QDir::NoDotAndDotDot, QDirIterator::Subdirectories); |
| 35 | while (it.hasNext()) { |
| 36 | it.next(); |
| 37 | QString relPath = QDir(src).relativeFilePath(it.filePath()); |
| 38 | QString dstPath = dst + "/" + relPath; |
| 39 | QDir().mkpath(QFileInfo(dstPath).absolutePath()); |
| 40 | if (!QFile::copy(it.filePath(), dstPath)) |
| 41 | continue; // Skip failed copies - don't record in undo log |
| 42 | |
| 43 | QJsonObject op; |
| 44 | op["type"] = "file_copy"; |
| 45 | op["source"] = it.filePath(); |
| 46 | op["dest"] = dstPath; |
| 47 | op["appId"] = (int)appId; |
| 48 | undoOps.append(op); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | static QString backupRootForAccount(const QString &accountId) |
| 53 | { |