diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2020-10-15 17:05:51 +0300 |
---|---|---|
committer | Kevin Ottens <kevin.ottens@nextcloud.com> | 2020-12-15 12:59:25 +0300 |
commit | f6faba48e2e751c082b56c70a98b0c244523ae9e (patch) | |
tree | abdf8991828a7fbec51ea9ec522cece5dda7d6f3 /test | |
parent | b4cb3ecb5a958e00143f385294a58e41f1eda6a0 (diff) |
Don`t block main thread when displaying all files removed dialog
Fixes: #8170
Diffstat (limited to 'test')
-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 61a3f77a0..3536bdadd 100644 --- a/test/testallfilesdeleted.cpp +++ b/test/testallfilesdeleted.cpp @@ -61,11 +61,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 }); @@ -102,11 +102,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(); @@ -161,11 +161,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 @@ -280,7 +280,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"); }); @@ -305,7 +305,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"); }); |