Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorallexzander <blackslayer4@gmail.com>2022-08-05 13:07:55 +0300
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>2022-09-17 10:47:15 +0300
commitb40c2dfe01e7bd8dd4756cb9db1a0390909538f9 (patch)
treeeaad07d760f680362052264129f7bd98ecc01ccc /src/common
parentd425005a29301f1b34c438937b7c7cdf9d25155c (diff)
Revert "Remove behavior changes."
This reverts commit 84d06ce9906df7bb6d87bf7093dd11fac6a6057a. Signed-off-by: allexzander <blackslayer4@gmail.com>
Diffstat (limited to 'src/common')
-rw-r--r--src/common/syncjournaldb.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/common/syncjournaldb.cpp b/src/common/syncjournaldb.cpp
index 964a20f0d..801aa5f50 100644
--- a/src/common/syncjournaldb.cpp
+++ b/src/common/syncjournaldb.cpp
@@ -1722,7 +1722,7 @@ void SyncJournalDb::deleteStaleFlagsEntries()
SqlQuery delQuery("DELETE FROM flags WHERE path != '' AND path NOT IN (SELECT path from metadata);", _db);
if (!delQuery.exec()) {
- qCWarning(lcDb) << QStringLiteral("deleteStaleFlagsEntries") << delQuery.error();
+ sqlFail(QStringLiteral("deleteStaleFlagsEntries"), delQuery);
}
}
@@ -1865,7 +1865,7 @@ void SyncJournalDb::setPollInfo(const SyncJournalDb::PollInfo &info)
SqlQuery query("DELETE FROM async_poll WHERE path=?", _db);
query.bindValue(1, info._file);
if (!query.exec()) {
- qCWarning(lcDb) << QStringLiteral("setPollInfo DELETE FROM async_poll") << query.error();
+ sqlFail(QStringLiteral("setPollInfo DELETE FROM async_poll"), query);
}
} else {
SqlQuery query("INSERT OR REPLACE INTO async_poll (path, modtime, filesize, pollpath) VALUES( ? , ? , ? , ? )", _db);
@@ -1874,7 +1874,7 @@ void SyncJournalDb::setPollInfo(const SyncJournalDb::PollInfo &info)
query.bindValue(3, info._fileSize);
query.bindValue(4, info._url);
if (!query.exec()) {
- qCWarning(lcDb) << QStringLiteral("setPollInfo INSERT OR REPLACE INTO async_poll") << query.error();
+ sqlFail(QStringLiteral("setPollInfo INSERT OR REPLACE INTO async_poll"), query);
}
}
}
@@ -1963,7 +1963,7 @@ void SyncJournalDb::avoidRenamesOnNextSync(const QByteArray &path)
query.bindValue(1, path);
if (!query.exec()) {
- qCWarning(lcDb) << QStringLiteral("avoidRenamesOnNextSync path: %1").arg(QString::fromUtf8(path)) << query.error();
+ sqlFail(QStringLiteral("avoidRenamesOnNextSync path: %1").arg(QString::fromUtf8(path)), query);
}
// We also need to remove the ETags so the update phase refreshes the directory paths
@@ -1991,7 +1991,7 @@ void SyncJournalDb::schedulePathForRemoteDiscovery(const QByteArray &fileName)
query.bindValue(1, argument);
if (!query.exec()) {
- qCWarning(lcDb) << QStringLiteral("schedulePathForRemoteDiscovery path: %11").arg(QString::fromUtf8(fileName)) << query.error();
+ sqlFail(QStringLiteral("schedulePathForRemoteDiscovery path: %1").arg(QString::fromUtf8(fileName)), query);
}
// Prevent future overwrite of the etags of this folder and all
@@ -2023,7 +2023,7 @@ void SyncJournalDb::forceRemoteDiscoveryNextSyncLocked()
deleteRemoteFolderEtagsQuery.prepare("UPDATE metadata SET md5='_invalid_' WHERE type=2;");
if (!deleteRemoteFolderEtagsQuery.exec()) {
- qCWarning(lcDb) << QStringLiteral("forceRemoteDiscoveryNextSyncLocked") << deleteRemoteFolderEtagsQuery.error();
+ sqlFail(QStringLiteral("forceRemoteDiscoveryNextSyncLocked"), deleteRemoteFolderEtagsQuery);
}
}
@@ -2233,7 +2233,7 @@ void SyncJournalDb::clearFileTable()
query.prepare("DELETE FROM metadata;");
if (!query.exec()) {
- qCWarning(lcDb) << QStringLiteral("clearFileTable") << query.error();
+ sqlFail(QStringLiteral("clearFileTable"), query);
}
}
@@ -2250,7 +2250,7 @@ void SyncJournalDb::markVirtualFileForDownloadRecursively(const QByteArray &path
query.bindValue(1, path);
if (!query.exec()) {
- qCWarning(lcDb) << QStringLiteral("markVirtualFileForDownloadRecursively UPDATE metadata SET type=5 path: %1").arg(QString::fromUtf8(path)) << query.error();
+ sqlFail(QStringLiteral("markVirtualFileForDownloadRecursively UPDATE metadata SET type=5 path: %1").arg(QString::fromUtf8(path)), query);
}
// We also must make sure we do not read the files from the database (same logic as in schedulePathForRemoteDiscovery)
@@ -2261,7 +2261,7 @@ void SyncJournalDb::markVirtualFileForDownloadRecursively(const QByteArray &path
query.bindValue(1, path);
if (!query.exec()) {
- qCWarning(lcDb) << QStringLiteral("markVirtualFileForDownloadRecursively UPDATE metadata SET md5='_invalid_' path: %1").arg(QString::fromUtf8(path)) << query.error();
+ sqlFail(QStringLiteral("markVirtualFileForDownloadRecursively UPDATE metadata SET md5='_invalid_' path: %1").arg(QString::fromUtf8(path)), query);
}
}
@@ -2395,6 +2395,8 @@ SyncJournalDb::PinStateInterface::rawList()
if (!query.exec()) {
qCWarning(lcDb) << "SQL Error" << "PinStateInterface::rawList" << query.error();
+ _db->close();
+ ASSERT(false);
}
QVector<QPair<QByteArray, PinState>> result;