From 98ae7159050703d38f8a2b57cf9680e5a416e1f7 Mon Sep 17 00:00:00 2001 From: allexzander Date: Fri, 23 Jul 2021 14:26:04 +0300 Subject: [PATCH 1/2] Fix crash in Folder::isSyncRunning() Signed-off-by: allexzander --- src/gui/folder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 475c313d0..18908dd69 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -252,7 +252,7 @@ bool Folder::isBusy() const bool Folder::isSyncRunning() const { - return _engine->isSyncRunning() || _vfs->isHydrating(); + return _engine->isSyncRunning() || (_vfs && _vfs->isHydrating()); } QString Folder::remotePath() const From 88d18fd5f31380387e30792d86607cfa7b4fd792 Mon Sep 17 00:00:00 2001 From: allexzander Date: Wed, 28 Jul 2021 08:48:38 +0300 Subject: [PATCH 2/2] Invoke 'bool Folder::isSyncRunning() const' from tests. Signed-off-by: allexzander --- test/testfolderman.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/testfolderman.cpp b/test/testfolderman.cpp index 66db0128b..7a2b3135e 100644 --- a/test/testfolderman.cpp +++ b/test/testfolderman.cpp @@ -57,6 +57,12 @@ private slots: QVERIFY(folderman->addFolder(newAccountState.data(), folderDefinition(dirPath + "/sub/ownCloud1"))); QVERIFY(folderman->addFolder(newAccountState.data(), folderDefinition(dirPath + "/ownCloud2"))); + const auto folderList = folderman->map(); + + for (const auto &folder : folderList) { + QVERIFY(!folder->isSyncRunning()); + } + // those should be allowed // QString FolderMan::checkPathValidityForNewFolder(const QString& path, const QUrl &serverUrl, bool forNewDirectory)