diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2020-10-15 17:05:51 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2020-10-21 16:22:12 +0300 |
commit | 7cb2e40edc969e870563490365dfdd0cfd16a805 (patch) | |
tree | bce8669312855065769fe09129227524785d4444 /test/testallfilesdeleted.cpp | |
parent | f4a8592efe3996f40d0a5e6a276ae7bbd9f3e23e (diff) |
Don`t block main thread when displaying all files removed dialog
Fixes: #8170
Diffstat (limited to 'test/testallfilesdeleted.cpp')
-rw-r--r-- | test/testallfilesdeleted.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/testallfilesdeleted.cpp b/test/testallfilesdeleted.cpp index e5505fb0f..4a4580a62 100644 --- a/test/testallfilesdeleted.cpp +++ b/test/testallfilesdeleted.cpp @@ -58,11 +58,11 @@ private slots: auto initialState = fakeFolder.currentLocalState(); int aboutToRemoveAllFilesCalled = 0; QObject::connect(&fakeFolder.syncEngine(), &SyncEngine::aboutToRemoveAllFiles, - [&](SyncFileItem::Direction dir, bool *cancel) { + [&](SyncFileItem::Direction dir, std::function<void(bool)> callback) { QCOMPARE(aboutToRemoveAllFilesCalled, 0); aboutToRemoveAllFilesCalled++; QCOMPARE(dir, deleteOnRemote ? SyncFileItem::Down : SyncFileItem::Up); - *cancel = true; + callback(true); fakeFolder.syncEngine().journal()->clearFileTable(); // That's what Folder is doing }); @@ -99,11 +99,11 @@ private slots: int aboutToRemoveAllFilesCalled = 0; QObject::connect(&fakeFolder.syncEngine(), &SyncEngine::aboutToRemoveAllFiles, - [&](SyncFileItem::Direction dir, bool *cancel) { + [&](SyncFileItem::Direction dir, std::function<void(bool)> callback) { QCOMPARE(aboutToRemoveAllFilesCalled, 0); aboutToRemoveAllFilesCalled++; QCOMPARE(dir, deleteOnRemote ? SyncFileItem::Down : SyncFileItem::Up); - *cancel = false; + callback(false); }); auto &modifier = deleteOnRemote ? fakeFolder.remoteModifier() : fakeFolder.localModifier(); @@ -158,11 +158,11 @@ private slots: int aboutToRemoveAllFilesCalled = 0; QObject::connect(&fakeFolder.syncEngine(), &SyncEngine::aboutToRemoveAllFiles, - [&](SyncFileItem::Direction dir, bool *cancel) { + [&](SyncFileItem::Direction dir, std::function<void(bool)> callback) { QCOMPARE(aboutToRemoveAllFilesCalled, 0); aboutToRemoveAllFilesCalled++; QCOMPARE(dir, SyncFileItem::Down); - *cancel = false; + callback(false); }); // Some small changes @@ -277,7 +277,7 @@ private slots: int aboutToRemoveAllFilesCalled = 0; QObject::connect(&fakeFolder.syncEngine(), &SyncEngine::aboutToRemoveAllFiles, - [&](SyncFileItem::Direction , bool *) { + [&](SyncFileItem::Direction , std::function<void(bool)> ) { aboutToRemoveAllFilesCalled++; QFAIL("should not be called"); }); @@ -302,7 +302,7 @@ private slots: int aboutToRemoveAllFilesCalled = 0; QObject::connect(&fakeFolder.syncEngine(), &SyncEngine::aboutToRemoveAllFiles, - [&](SyncFileItem::Direction , bool *) { + [&](SyncFileItem::Direction , std::function<void(bool)>) { aboutToRemoveAllFilesCalled++; QFAIL("should not be called"); }); |