Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ Application::Application(const QString &displayLanguage, bool debugMode)
if (VfsPluginManager::instance().bestAvailableVfsMode() == Vfs::Off) {
qCWarning(lcApplication) << u"Theme wants to show vfs mode, but no vfs plugins are available";
}
if (VfsPluginManager::instance().isVfsPluginAvailable(Vfs::WindowsCfApi))
qCInfo(lcApplication) << u"VFS windows plugin is available";
qCInfo(lcApplication) << VfsPluginManager::instance().bestAvailableVfsMode() << u"plugin is available";

ConfigFile cfg;

Expand Down
2 changes: 1 addition & 1 deletion src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ void Folder::startVfs()
_vfs->fileStatusChanged(stateDbFile + QStringLiteral("-shm"), SyncFileStatus::StatusExcluded);
_engine->setSyncOptions(loadSyncOptions());

if (_vfs->mode() == Vfs::WindowsCfApi) {
if (_vfs->mode() != Vfs::Off) {
// diable ignorelist with vfs
_engine->journal()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, {});
}
Expand Down
11 changes: 5 additions & 6 deletions src/gui/folderdefinition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,13 @@ FolderDefinition FolderDefinition::load(QSettings &settings)
folder.virtualFilesMode = Vfs::Off;

QString vfsModeString = settings.value("virtualFilesMode").toString();
#ifdef Q_OS_WIN
// we always use vfs on windows if available
if (auto result = Vfs::checkAvailability(folder.localPath(), Vfs::WindowsCfApi); result) {
vfsModeString = Utility::enumToString(Vfs::WindowsCfApi);

const auto vfs = Utility::isWindows() ? Vfs::WindowsCfApi : Vfs::XAttr;
if (auto result = Vfs::checkAvailability(folder.localPath(), vfs); result) {
vfsModeString = Utility::enumToString(vfs);
} else {
qCWarning(lcFolder) << u"Failed to upgrade" << folder.localPath() << u"to" << Vfs::WindowsCfApi << result.error();
qCWarning(lcFolder) << u"Failed to upgrade" << folder.localPath() << u"to" << vfs << result.error();
}
#endif
if (!vfsModeString.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I believe the usage of vfsModeString is somehow back and forth conversion...

I think in this code block starting here could be simplified by using vfs directly. Not really part of this PR tough.

if (auto mode = Vfs::modeFromString(vfsModeString)) {
folder.virtualFilesMode = *mode;
Expand Down
9 changes: 2 additions & 7 deletions src/gui/folderwizard/folderwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ FolderWizardPrivate::FolderWizardPrivate(FolderWizard *q, const AccountStatePtr

q->setPage(FolderWizard::Page_Space, _spacesPage);

if (VfsPluginManager::instance().bestAvailableVfsMode() != Vfs::WindowsCfApi) {
if (VfsPluginManager::instance().bestAvailableVfsMode() == Vfs::Off) {
_folderWizardSelectiveSyncPage = new FolderWizardSelectiveSync(this);
q->setPage(FolderWizard::Page_SelectiveSync, _folderWizardSelectiveSyncPage);
}
Expand Down Expand Up @@ -121,12 +121,7 @@ const AccountStatePtr &FolderWizardPrivate::accountState()

bool FolderWizardPrivate::useVirtualFiles() const
{
#ifdef Q_OS_WIN
return VfsPluginManager::instance().bestAvailableVfsMode() == Vfs::WindowsCfApi;
#elif defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
return VfsPluginManager::instance().bestAvailableVfsMode() == Vfs::XAttr;
#endif
return false;
return VfsPluginManager::instance().bestAvailableVfsMode() != Vfs::Off;
}

FolderWizard::FolderWizard(const AccountStatePtr &account, QWidget *parent)
Expand Down
4 changes: 1 addition & 3 deletions src/gui/newwizard/pages/accountconfiguredwizardpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,9 @@ QString AccountConfiguredWizardPage::syncTargetDir() const
SyncMode AccountConfiguredWizardPage::syncMode() const
{
if (_ui->syncEverythingRadioButton->isChecked()) {
#ifdef Q_OS_WIN
if (Vfs::checkAvailability(syncTargetDir(), Vfs::WindowsCfApi)) {
if (VfsPluginManager::instance().bestAvailableVfsMode() != Vfs::Off) {
return SyncMode::UseVfs;
}
#endif
return SyncMode::SyncEverything;
}
if (_ui->configureSyncManuallyRadioButton->isChecked()) {
Expand Down