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

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2021-09-23 12:46:53 +0300
committerHannah von Reth <vonreth@kde.org>2021-09-28 18:26:47 +0300
commit367a480676abfc5861987e25a6a87ba303767707 (patch)
tree6e5b7a36aab465b89b0aeac9d6dacec2f700a93c
parent9226f7e165747fc6c0496f81beb4b666b3a8188c (diff)
Prevent recration of db after removal
-rw-r--r--changelog/unreleased/90577
-rw-r--r--src/gui/folder.cpp9
2 files changed, 15 insertions, 1 deletions
diff --git a/changelog/unreleased/9057 b/changelog/unreleased/9057
new file mode 100644
index 000000000..33943158a
--- /dev/null
+++ b/changelog/unreleased/9057
@@ -0,0 +1,7 @@
+Bugfix: When a folder is removed we leave a database behind
+
+We fixed a bug where we left an empty `sync_journal.db` behind, when we removed a folder/account.
+As we use the presence of `sync_journal.db` to determine whether the folder is used by a sync client this
+prevented using an old folder in a new setup.
+
+https://github.com/owncloud/client/issues/9057
diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp
index 55f0eb5d0..08fcc6496 100644
--- a/src/gui/folder.cpp
+++ b/src/gui/folder.cpp
@@ -793,6 +793,13 @@ void Folder::slotTerminateSync()
void Folder::wipeForRemoval()
{
+ // prevent interaction with the db etc
+ _vfsIsReady = false;
+
+ // stop reacting to changes
+ // especially the upcoming deletion of the db
+ _folderWatcher.reset();
+
// Delete files that have been partially downloaded.
slotDiscardDownloadProgress();
@@ -806,7 +813,7 @@ void Folder::wipeForRemoval()
QFile file(stateDbFile);
if (file.exists()) {
if (!file.remove()) {
- qCWarning(lcFolder) << "Failed to remove existing csync StateDB " << stateDbFile;
+ qCCritical(lcFolder) << "Failed to remove existing csync StateDB " << stateDbFile;
} else {
qCInfo(lcFolder) << "wipe: Removed csync StateDB " << stateDbFile;
}