diff --git a/src/common/vfs.h b/src/common/vfs.h index 7efde8ad768..28359e012b2 100644 --- a/src/common/vfs.h +++ b/src/common/vfs.h @@ -142,11 +142,11 @@ class OCSYNC_EXPORT Vfs : public QObject */ void start(const VfsSetupParams ¶ms); - /// Stop interaction with VFS provider. Like when the client application quits. - virtual void stop() = 0; + /// Stop interaction with VFS provider, because the client is going to quit. + virtual void stopForExit() = 0; - /// Deregister the folder with the sync provider, like when a folder is removed. - virtual void unregisterFolder() = 0; + /// Stop and deregister the folder with the sync provider, like when a folder is removed. + virtual void stopAndUnregisterFolder() = 0; /** Whether the socket api should show pin state options @@ -285,8 +285,8 @@ class OCSYNC_EXPORT VfsOff : public Vfs QString fileSuffix() const override { return QString(); } - void stop() override {} - void unregisterFolder() override {} + void stopForExit() override { } + void stopAndUnregisterFolder() override { } bool socketApiPinStateActionsShown() const override { return false; } bool isHydrating() const override { return false; } diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 2ac102159ee..2448ae4c672 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -458,7 +458,7 @@ void AccountSettings::slotFolderWizardAccepted() #ifdef Q_OS_WIN if (folderMan->navigationPaneHelper().showInExplorerNavigationPane()) - definition.navigationPaneClsid = QUuid::createUuid(); + definition.isInNavigationPane = true; #endif auto selectiveSyncBlackList = folderWizard->property("selectiveSyncBlackList").toStringList(); diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 186d0d3c871..2015beb1889 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -57,14 +57,22 @@ namespace { * 1\Folders\4\version=2 * 1\FoldersWithPlaceholders\3\version=3 */ -auto versionC() -{ - return QStringLiteral("version"); -} - -constexpr int WinVfsSettingsVersion = 4; -constexpr int SettingsVersion = 2; -} +const QLatin1String versionC("version"); + +constexpr int SettingsVersion = 5; + +// Settings keys: +const QLatin1String localPathC("localPath"); +const QLatin1String journalPathC("journalPath"); +const QLatin1String targetPathC("targetPath"); +const QLatin1String pausedC("paused"); +const QLatin1String ignoreHiddenFilesC("ignoreHiddenFiles"); +const QLatin1String virtualFilesModeC("virtualFilesMode"); +const QLatin1String navigationPaneClsidC("navigationPaneClsid"); +const QLatin1String uuidC("uuid"); +const QLatin1String isInNavigationPaneC("isInNavigationPane"); +const QLatin1String usePlaceholdersC("usePlaceholders"); +} // anonymous namespace namespace OCC { @@ -167,8 +175,9 @@ Folder::Folder(const FolderDefinition &definition, Folder::~Folder() { // If wipeForRemoval() was called the vfs has already shut down. - if (_vfs) - _vfs->stop(); + if (_vfs) { + _vfs->stopForExit(); + } // Reset then engine first as it will abort and try to access members of the Folder _engine.reset(); @@ -701,8 +710,7 @@ void Folder::setVirtualFilesEnabled(bool enabled) // TODO: Must wait for current sync to finish! SyncEngine::wipeVirtualFiles(path(), _journal, *_vfs); - _vfs->stop(); - _vfs->unregisterFolder(); + _vfs->stopAndUnregisterFolder(); disconnect(_vfs.data(), nullptr, this, nullptr); disconnect(&_engine->syncFileStatusTracker(), nullptr, _vfs.data(), nullptr); @@ -844,8 +852,7 @@ void Folder::wipeForRemoval() QFile::remove(stateDbFile + "-wal"); QFile::remove(stateDbFile + "-journal"); - _vfs->stop(); - _vfs->unregisterFolder(); + _vfs->stopAndUnregisterFolder(); _vfs.reset(nullptr); // warning: folder now in an invalid state } @@ -1306,60 +1313,78 @@ void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction dir, std::functio void FolderDefinition::save(QSettings &settings, const FolderDefinition &folder) { - settings.setValue(QLatin1String("localPath"), folder.localPath); - settings.setValue(QLatin1String("journalPath"), folder.journalPath); - settings.setValue(QLatin1String("targetPath"), folder.targetPath); - settings.setValue(QLatin1String("paused"), folder.paused); - settings.setValue(QLatin1String("ignoreHiddenFiles"), folder.ignoreHiddenFiles); + settings.setValue(localPathC, folder.localPath); + settings.setValue(journalPathC, folder.journalPath); + settings.setValue(targetPathC, folder.targetPath); + settings.setValue(pausedC, folder.paused); + settings.setValue(ignoreHiddenFilesC, folder.ignoreHiddenFiles); + settings.setValue(uuidC, folder.uuid); + settings.setValue(virtualFilesModeC, Vfs::modeToString(folder.virtualFilesMode)); - settings.setValue(QStringLiteral("virtualFilesMode"), Vfs::modeToString(folder.virtualFilesMode)); + Q_ASSERT(SettingsVersion <= maxSettingsVersion()); + settings.setValue(versionC, SettingsVersion); - // Ensure new vfs modes won't be attempted by older clients - const int version = folder.virtualFilesMode == Vfs::WindowsCfApi ? WinVfsSettingsVersion : SettingsVersion; - Q_ASSERT(version <= maxSettingsVersion()); - settings.setValue(versionC(), version); + if (settings.contains(navigationPaneClsidC)) { + // Migrate old navigationPaneClsid to new uuid + settings.remove(navigationPaneClsidC); + } - // Happens only on Windows when the explorer integration is enabled. - if (!folder.navigationPaneClsid.isNull()) - settings.setValue(QLatin1String("navigationPaneClsid"), folder.navigationPaneClsid); - else - settings.remove(QLatin1String("navigationPaneClsid")); + if (folder.isInNavigationPane) { + settings.setValue(isInNavigationPaneC, true); + } else { + settings.remove(isInNavigationPaneC); + } } -bool FolderDefinition::load(QSettings &settings, const QString &alias, - FolderDefinition *folder) -{ - folder->alias = FolderMan::unescapeAlias(alias); - folder->localPath = settings.value(QLatin1String("localPath")).toString(); - folder->journalPath = settings.value(QLatin1String("journalPath")).toString(); - folder->targetPath = settings.value(QLatin1String("targetPath")).toString(); - folder->paused = settings.value(QLatin1String("paused")).toBool(); - folder->ignoreHiddenFiles = settings.value(QLatin1String("ignoreHiddenFiles"), QVariant(true)).toBool(); - folder->navigationPaneClsid = settings.value(QLatin1String("navigationPaneClsid")).toUuid(); +FolderDefinition FolderDefinition::load(const QSettings &settings, const QString &alias) +{ + FolderDefinition folder; + folder.alias = FolderMan::unescapeAlias(alias); + folder.localPath = settings.value(localPathC).toString(); + folder.journalPath = settings.value(journalPathC).toString(); + folder.targetPath = settings.value(targetPathC).toString(); + folder.paused = settings.value(pausedC).toBool(); + folder.ignoreHiddenFiles = settings.value(ignoreHiddenFilesC, QVariant(true)).toBool(); + folder.isInNavigationPane = settings.value(isInNavigationPaneC, QVariant(true)).toBool(); + + if (settings.contains(uuidC)) { + folder.uuid = settings.value(uuidC).toUuid(); + } else if (settings.contains(navigationPaneClsidC)) { + // For backwards compatibility, will be changed when saved: + folder.uuid = settings.value(navigationPaneClsidC).toUuid(); + if (!folder.isInNavigationPane) { + folder.isInNavigationPane = true; + } + } - folder->virtualFilesMode = Vfs::Off; - QString vfsModeString = settings.value(QStringLiteral("virtualFilesMode")).toString(); + // Sanity check: + if (folder.uuid.isNull()) { + folder.uuid = QUuid::createUuid(); + } + + folder.virtualFilesMode = Vfs::Off; + QString vfsModeString = settings.value(virtualFilesModeC).toString(); if (!vfsModeString.isEmpty()) { if (auto mode = Vfs::modeFromString(vfsModeString)) { - folder->virtualFilesMode = *mode; + folder.virtualFilesMode = *mode; } else { qCWarning(lcFolder) << "Unknown virtualFilesMode:" << vfsModeString << "assuming 'off'"; } } else { - if (settings.value(QLatin1String("usePlaceholders")).toBool()) { - folder->virtualFilesMode = Vfs::WithSuffix; - folder->upgradeVfsMode = true; // maybe winvfs is available? + if (settings.value(usePlaceholdersC).toBool()) { + folder.virtualFilesMode = Vfs::WithSuffix; + folder.upgradeVfsMode = true; // maybe winvfs is available? } } // Old settings can contain paths with native separators. In the rest of the // code we assume /, so clean it up now. - folder->localPath = prepareLocalPath(folder->localPath); + folder.localPath = prepareLocalPath(folder.localPath); // Target paths also have a convention - folder->targetPath = prepareTargetPath(folder->targetPath); + folder.targetPath = prepareTargetPath(folder.targetPath); - return true; + return folder; } QString FolderDefinition::prepareLocalPath(const QString &path) diff --git a/src/gui/folder.h b/src/gui/folder.h index adc64659ece..4ec7534c620 100644 --- a/src/gui/folder.h +++ b/src/gui/folder.h @@ -71,8 +71,12 @@ class FolderDefinition bool ignoreHiddenFiles; /// Which virtual files setting the folder uses Vfs::Mode virtualFilesMode = Vfs::Off; - /// The CLSID where this folder appears in registry for the Explorer navigation pane entry. - QUuid navigationPaneClsid; + + /// The (always valid) UUID for the folder. This can be overwritten when read from the settings. + QUuid uuid = QUuid::createUuid(); + + /// Is shown in Windows Explorer navigation pane + bool isInNavigationPane = false; /// Whether the vfs mode shall silently be updated if possible bool upgradeVfsMode = false; @@ -81,8 +85,7 @@ class FolderDefinition static void save(QSettings &settings, const FolderDefinition &folder); /// Reads a folder definition from the current settings group. - static bool load(QSettings &settings, const QString &alias, - FolderDefinition *folder); + static FolderDefinition load(const QSettings &settings, const QString &alias); /** The highest version in the settings that load() can read * @@ -91,8 +94,9 @@ class FolderDefinition * (version remains readable by 2.5.1) * Version 3: introduction of new windows vfs mode in 2.6.0 * Version 4: until 2.9.1 windows vfs tried to unregister folders with a different id from windows. + * Version 5: renamed navigationPaneClsid to uuid in the settings for FolderDefinition */ - static int maxSettingsVersion() { return 4; } + static int maxSettingsVersion() { return 5; } /// Ensure / as separator and trailing /. static QString prepareLocalPath(const QString &path); @@ -163,8 +167,24 @@ class Folder : public QObject */ QString remotePathTrailingSlash() const; - void setNavigationPaneClsid(const QUuid &clsid) { _definition.navigationPaneClsid = clsid; } - QUuid navigationPaneClsid() const { return _definition.navigationPaneClsid; } + /** + * UUID for the folder + */ + QUuid uuid() const { return _definition.uuid; } + + /** + * Currently only used on Windows. + * + * @return true is the folder is shown in the Windows Explorer navigation pane, false otherwise + */ + bool isInNavigationPane() const { return _definition.isInNavigationPane; } + + /** + * Currently only used on Windows. + * + * @param yesno true is the folder shold be shown in the Windows Explorer navigation pane, false otherwise + */ + void setIsInNavigationPane(bool yesno) { _definition.isInNavigationPane = yesno; } /** * remote folder path with server url diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp index 65046642e57..363ac344ee7 100644 --- a/src/gui/folderman.cpp +++ b/src/gui/folderman.cpp @@ -44,10 +44,7 @@ namespace { * [Accounts] * 0\version=1 */ -auto versionC() -{ - return QStringLiteral("version"); -} +const QLatin1String versionC("version"); /* * Folders with a version > maxFoldersVersion will be removed @@ -71,7 +68,7 @@ QString makeLegacyDbName(const OCC::FolderDefinition &def, const OCC::AccountPtr const QString key = QStringLiteral("%1@%2:%3").arg(account->credentials()->user(), legacyUrl.toString(), def.targetPath); return OCC::SyncJournalDb::makeDbName(def.localPath, QString::fromUtf8(QCryptographicHash::hash(key.toUtf8(), QCryptographicHash::Md5).left(6).toHex())); } -} +} // anonymous namespace namespace OCC { Q_LOGGING_CATEGORY(lcFolderMan, "gui.folder.manager", QtInfoMsg) @@ -309,78 +306,79 @@ void FolderMan::setupFoldersHelper(QSettings &settings, AccountStatePtr account, } settings.endGroup(); - FolderDefinition folderDefinition; settings.beginGroup(folderAlias); - if (FolderDefinition::load(settings, folderAlias, &folderDefinition)) { - const auto defaultJournalPath = [&account, folderDefinition] { - // if we would have booth the 2.9.0 file name and the lagacy file - // with the md5 infix we prefer the 2.9.0 version - const QDir info(folderDefinition.localPath); - const QString defaultPath = SyncJournalDb::makeDbName(folderDefinition.localPath); - if (info.exists(defaultPath)) { - return defaultPath; - } - // 2.6 - QString legacyPath = makeLegacyDbName(folderDefinition, account->account()); - if (info.exists(legacyPath)) { - return legacyPath; - } - // pre 2.6 - legacyPath.replace(QLatin1String(".sync_"), QLatin1String("._sync_")); - if (info.exists(legacyPath)) { - return legacyPath; - } + FolderDefinition folderDefinition = FolderDefinition::load(settings, folderAlias); + const auto defaultJournalPath = [&account, folderDefinition] { + // if we would have both the 2.9.0 file name and the lagacy file + // with the md5 infix we prefer the 2.9.0 version + const QDir info(folderDefinition.localPath); + const QString defaultPath = SyncJournalDb::makeDbName(folderDefinition.localPath); + if (info.exists(defaultPath)) { return defaultPath; - }(); - - // Migration: Old settings don't have journalPath - if (folderDefinition.journalPath.isEmpty()) { - folderDefinition.journalPath = defaultJournalPath; } - - // Migration: ._ files sometimes can't be created. - // So if the configured journalPath has a dot-underscore ("._sync_*.db") - // but the current default doesn't have the underscore, switch to the - // new default if no db exists yet. - if (folderDefinition.journalPath.startsWith("._sync_") - && defaultJournalPath.startsWith(".sync_") - && !QFile::exists(folderDefinition.absoluteJournalPath())) { - folderDefinition.journalPath = defaultJournalPath; + // 2.6 + QString legacyPath = makeLegacyDbName(folderDefinition, account->account()); + if (info.exists(legacyPath)) { + return legacyPath; } - - // Migration: If an old .csync_journal.db is found, move it to the new name. - if (backwardsCompatible) { - SyncJournalDb::maybeMigrateDb(folderDefinition.localPath, folderDefinition.absoluteJournalPath()); + // pre 2.6 + legacyPath.replace(QLatin1String(".sync_"), QLatin1String("._sync_")); + if (info.exists(legacyPath)) { + return legacyPath; } + return defaultPath; + }(); - auto vfs = createVfsFromPlugin(folderDefinition.virtualFilesMode); - if (!vfs) { - // TODO: Must do better error handling - qFatal("Could not load plugin"); - } + // Migration: Old settings don't have journalPath + if (folderDefinition.journalPath.isEmpty()) { + folderDefinition.journalPath = defaultJournalPath; + } - Folder *f = addFolderInternal(std::move(folderDefinition), account.data(), std::move(vfs)); - if (f) { - // Migrate the old "usePlaceholders" setting to the root folder pin state - if (settings.value(versionC(), 1).toInt() == 1 - && settings.value(QLatin1String("usePlaceholders"), false).toBool()) { - qCInfo(lcFolderMan) << "Migrate: From usePlaceholders to PinState::OnlineOnly"; - f->setRootPinState(PinState::OnlineOnly); - } + // Migration: ._ files sometimes can't be created. + // So if the configured journalPath has a dot-underscore ("._sync_*.db") + // but the current default doesn't have the underscore, switch to the + // new default if no db exists yet. + if (folderDefinition.journalPath.startsWith("._sync_") + && defaultJournalPath.startsWith(".sync_") + && !QFile::exists(folderDefinition.absoluteJournalPath())) { + folderDefinition.journalPath = defaultJournalPath; + } - // Migration: Mark folders that shall be saved in a backwards-compatible way - if (backwardsCompatible) - f->setSaveBackwardsCompatible(true); - if (foldersWithPlaceholders) - f->setSaveInFoldersWithPlaceholders(); + // Migration: If an old .csync_journal.db is found, move it to the new name. + if (backwardsCompatible) { + SyncJournalDb::maybeMigrateDb(folderDefinition.localPath, folderDefinition.absoluteJournalPath()); + } - // save possible changes from the migration - f->saveToSettings(); + auto vfs = createVfsFromPlugin(folderDefinition.virtualFilesMode); + if (!vfs) { + // TODO: Must do better error handling + qFatal("Could not load plugin"); + } - scheduleFolder(f); - emit folderSyncStateChange(f); - } + Folder *f = addFolderInternal(std::move(folderDefinition), account.data(), std::move(vfs)); + Q_ASSERT(f); + + // Migrate the old "usePlaceholders" setting to the root folder pin state + if (settings.value(versionC, 1).toInt() == 1 + && settings.value(QLatin1String("usePlaceholders"), false).toBool()) { + qCInfo(lcFolderMan) << "Migrate: From usePlaceholders to PinState::OnlineOnly"; + f->setRootPinState(PinState::OnlineOnly); + } + + // Migration: Mark folders that shall be saved in a backwards-compatible way + if (backwardsCompatible) { + f->setSaveBackwardsCompatible(true); } + if (foldersWithPlaceholders) { + f->setSaveInFoldersWithPlaceholders(); + } + + // save possible changes from the migration + f->saveToSettings(); + + scheduleFolder(f); + emit folderSyncStateChange(f); + settings.endGroup(); } } @@ -418,12 +416,12 @@ void FolderMan::backwardMigrationSettingsKeys(QStringList *deleteKeys, QStringLi auto processSubgroup = [&](const QString &name) { settings->beginGroup(name); - const int foldersVersion = settings->value(versionC(), 1).toInt(); + const int foldersVersion = settings->value(versionC, 1).toInt(); if (foldersVersion <= maxFoldersVersion) { const auto &childGroups = settings->childGroups(); for (const auto &folderAlias : childGroups) { settings->beginGroup(folderAlias); - const int folderVersion = settings->value(versionC(), 1).toInt(); + const int folderVersion = settings->value(versionC, 1).toInt(); if (folderVersion > FolderDefinition::maxSettingsVersion()) { ignoreKeys->append(settings->group()); } diff --git a/src/gui/folderman.h b/src/gui/folderman.h index 5c93110bc74..74e88f74050 100644 --- a/src/gui/folderman.h +++ b/src/gui/folderman.h @@ -329,7 +329,9 @@ private slots: private: /** Adds a new folder, does not add it to the account settings and * does not set an account on the new folder. - */ + * + * \returns the newly created Folder, which can never be a nullptr. + */ Folder *addFolderInternal(FolderDefinition folderDefinition, AccountState *accountState, std::unique_ptr vfs); diff --git a/src/gui/navigationpanehelper.cpp b/src/gui/navigationpanehelper.cpp index 57fff692dce..b247fbd5477 100644 --- a/src/gui/navigationpanehelper.cpp +++ b/src/gui/navigationpanehelper.cpp @@ -36,14 +36,16 @@ NavigationPaneHelper::NavigationPaneHelper(FolderMan *folderMan) void NavigationPaneHelper::setShowInExplorerNavigationPane(bool show) { - if (_showInExplorerNavigationPane == show) + if (_showInExplorerNavigationPane == show) { return; + } _showInExplorerNavigationPane = show; - // Re-generate a new CLSID when enabling, possibly throwing away the old one. - // updateCloudStorageRegistry will take care of removing any unknown CLSID our application owns from the registry. - for (auto *folder : _folderMan->map()) - folder->setNavigationPaneClsid(show ? QUuid::createUuid() : QUuid()); + // When we remove it from the side-bar, updateCloudStorageRegistry will take care of removing any + // unknown CLSID our application owns from the registry. + for (auto *folder : _folderMan->map()) { + folder->setIsInNavigationPane(show); + } scheduleUpdateCloudStorageRegistry(); } @@ -51,8 +53,9 @@ void NavigationPaneHelper::setShowInExplorerNavigationPane(bool show) void NavigationPaneHelper::scheduleUpdateCloudStorageRegistry() { // Schedule the update to happen a bit later to avoid doing the update multiple times in a row. - if (!_updateCloudStorageRegistryTimer.isActive()) + if (!_updateCloudStorageRegistryTimer.isActive()) { _updateCloudStorageRegistryTimer.start(500); + } } void NavigationPaneHelper::updateCloudStorageRegistry() @@ -76,15 +79,11 @@ void NavigationPaneHelper::updateCloudStorageRegistry() // We currently don't distinguish between new and existing CLSIDs, if it's there we just // save over it. We at least need to update the tile in case we are suddently using multiple accounts. for (auto *folder : _folderMan->map()) { - if (folder->vfs().mode() == Vfs::WindowsCfApi) - { - continue; - } - if (!folder->navigationPaneClsid().isNull()) { + if (folder->vfs().mode() != Vfs::WindowsCfApi && folder->isInNavigationPane()) { // If it already exists, unmark it for removal, this is a valid sync root. - entriesToRemove.removeOne(folder->navigationPaneClsid()); + entriesToRemove.removeOne(folder->uuid()); - QString clsidStr = folder->navigationPaneClsid().toString(); + QString clsidStr = folder->uuid().toString(); QString clsidPath = QString() % "Software\\Classes\\CLSID\\" % clsidStr; QString clsidPathWow64 = QString() % "Software\\Classes\\Wow6432Node\\CLSID\\" % clsidStr; QString namespacePath = QString() % "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Desktop\\NameSpace\\" % clsidStr; diff --git a/src/gui/owncloudsetupwizard.cpp b/src/gui/owncloudsetupwizard.cpp index c0e4f3dbcc6..2a1dc38c341 100644 --- a/src/gui/owncloudsetupwizard.cpp +++ b/src/gui/owncloudsetupwizard.cpp @@ -405,8 +405,7 @@ void OwncloudSetupWizard::slotAssistantFinished(int result) folderDefinition.virtualFilesMode = bestAvailableVfsMode(); } #ifdef Q_OS_WIN - if (folderMan->navigationPaneHelper().showInExplorerNavigationPane()) - folderDefinition.navigationPaneClsid = QUuid::createUuid(); + folderDefinition.isInNavigationPane = folderMan->navigationPaneHelper().showInExplorerNavigationPane(); #endif auto f = folderMan->addFolder(account, folderDefinition); diff --git a/src/libsync/vfs/suffix/vfs_suffix.cpp b/src/libsync/vfs/suffix/vfs_suffix.cpp index 1641c83831b..2040dd796f0 100644 --- a/src/libsync/vfs/suffix/vfs_suffix.cpp +++ b/src/libsync/vfs/suffix/vfs_suffix.cpp @@ -57,11 +57,11 @@ void VfsSuffix::startImpl(const VfsSetupParams ¶ms) Q_EMIT started(); } -void VfsSuffix::stop() +void VfsSuffix::stopForExit() { } -void VfsSuffix::unregisterFolder() +void VfsSuffix::stopAndUnregisterFolder() { } diff --git a/src/libsync/vfs/suffix/vfs_suffix.h b/src/libsync/vfs/suffix/vfs_suffix.h index f73a964b5d1..b44da6c2fc1 100644 --- a/src/libsync/vfs/suffix/vfs_suffix.h +++ b/src/libsync/vfs/suffix/vfs_suffix.h @@ -34,8 +34,8 @@ class VfsSuffix : public Vfs QString underlyingFileName(const QString &fileName) const override; - void stop() override; - void unregisterFolder() override; + void stopForExit() override; + void stopAndUnregisterFolder() override; bool socketApiPinStateActionsShown() const override { return true; } bool isHydrating() const override; diff --git a/test/testutils/syncenginetestutils.cpp b/test/testutils/syncenginetestutils.cpp index cc7604e6a1d..e67bfc4fa96 100644 --- a/test/testutils/syncenginetestutils.cpp +++ b/test/testutils/syncenginetestutils.cpp @@ -925,7 +925,7 @@ void FakeFolder::switchToVfs(QSharedPointer vfs) { auto opts = _syncEngine->syncOptions(); - opts._vfs->stop(); + opts._vfs->stopForExit(); QObject::disconnect(_syncEngine.get(), nullptr, opts._vfs.data(), nullptr); opts._vfs = vfs; @@ -940,8 +940,7 @@ void FakeFolder::switchToVfs(QSharedPointer vfs) vfsParams.providerDisplayName = QStringLiteral("OC-TEST"); vfsParams.providerVersion = QVersionNumber(0, 1); QObject::connect(_syncEngine.get(), &QObject::destroyed, vfs.data(), [vfs]() { - vfs->stop(); - vfs->unregisterFolder(); + vfs->stopAndUnregisterFolder(); }); QObject::connect(vfs.get(), &OCC::Vfs::error, vfs.get(), [](const QString &error) {