message-poller.cpp (seafile-client-9.0.2) | : | message-poller.cpp (seafile-client-9.0.2-1) | ||
---|---|---|---|---|
#include <QTimer> | #include <QTimer> | |||
#include <QDateTime> | #include <QDateTime> | |||
#include <QJsonDocument> | #include <QJsonDocument> | |||
#include <QRegularExpression> | ||||
#include <QJsonObject> | ||||
#include "utils/utils.h" | #include "utils/utils.h" | |||
#include "utils/translate-commit-desc.h" | #include "utils/translate-commit-desc.h" | |||
#include "utils/json-utils.h" | #include "utils/json-utils.h" | |||
#include "utils/file-utils.h" | #include "utils/file-utils.h" | |||
#include "seafile-applet.h" | #include "seafile-applet.h" | |||
#include "daemon-mgr.h" | #include "daemon-mgr.h" | |||
#include "settings-mgr.h" | #include "settings-mgr.h" | |||
#include "rpc/rpc-client.h" | #include "rpc/rpc-client.h" | |||
#include "rpc/sync-error.h" | #include "rpc/sync-error.h" | |||
skipping to change at line 238 | skipping to change at line 236 | |||
if (doc.isNull()) { | if (doc.isNull()) { | |||
qWarning() << "Failed to parse json:" << error.errorString(); | qWarning() << "Failed to parse json:" << error.errorString(); | |||
return; | return; | |||
} else if (!doc.isObject()) { | } else if (!doc.isObject()) { | |||
qWarning() << "Malformed json string:" << content; | qWarning() << "Malformed json string:" << content; | |||
return; | return; | |||
} | } | |||
QString text; | QString text; | |||
QRegularExpression re("Deleted \"(.+)\" and (.+) more files."); | QRegularExpression re("Deleted \"(.+)\" and (.+) more files."); | |||
auto match = re.match(doc.object().value("delete_files").toString().trim med()); | auto match = re.match(doc["delete_files"].toString().trimmed()); | |||
if (match.hasMatch()) { | if (match.hasMatch()) { | |||
text = tr("Deleted \"%1\" and %2 more files.") | text = tr("Deleted \"%1\" and %2 more files.") | |||
.arg(match.captured(1)).arg(match.captured(2)); | .arg(match.captured(1)).arg(match.captured(2)); | |||
} | } | |||
QString info = tr("Do you want to delete files in library \"%1\" ?") | QString info = tr("Do you want to delete files in library \"%1\" ?") | |||
.arg(doc.object().value("repo_name").toString().trimme d()); | .arg(doc["repo_name"].toString().trimmed()); | |||
if (seafApplet->deletingConfirmationBox(text, info)) { | if (seafApplet->deletingConfirmationBox(text, info)) { | |||
rpc_client_->addDelConfirmation(doc.object().value("confirmation_id" ).toString(), false); | rpc_client_->addDelConfirmation(doc["confirmation_id"].toString(), f alse); | |||
} else { | } else { | |||
rpc_client_->addDelConfirmation(doc.object().value("confirmation_id" ).toString(), true); | rpc_client_->addDelConfirmation(doc["confirmation_id"].toString(), t rue); | |||
} | } | |||
} | } | |||
} | } | |||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 4 lines changed or added |