Skip to content

Commit

Permalink
Don't allow to enable vfs if the folder is used by multiple accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneRing committed Sep 6, 2021
1 parent 1b5925c commit 264a2d4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
}

if (Theme::instance()->showVirtualFilesOption()
&& !folder->virtualFilesEnabled() && Vfs::checkAvailability(folder->path())) {
&& !folder->virtualFilesEnabled() && FolderMan::instance()->checkVfsAvailability(folder->path())) {
const auto mode = bestAvailableVfsMode();
if (mode == Vfs::WindowsCfApi || Theme::instance()->enableExperimentalFeatures()) {
ac = menu->addAction(tr("Enable virtual file support%1...").arg(mode == Vfs::WindowsCfApi ? QString() : tr(" (experimental)")));
Expand Down
5 changes: 5 additions & 0 deletions src/gui/folderman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1493,4 +1493,9 @@ Result<void, QString> FolderMan::unsupportedConfiguration(const QString &path) c
return {};
}

bool FolderMan::checkVfsAvailability(const QString &path) const
{
return unsupportedConfiguration(path) && Vfs::checkAvailability(path);
}

} // namespace OCC
3 changes: 3 additions & 0 deletions src/gui/folderman.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ class FolderMan : public QObject
void setDirtyProxy();
void setDirtyNetworkLimits();

/** Whether or not vfs is supported in the location. */
bool checkVfsAvailability(const QString &path) const;

/** If the folder configuration is no longer supported this will return an error string */
Result<void, QString> unsupportedConfiguration(const QString &path) const;
signals:
Expand Down

0 comments on commit 264a2d4

Please sign in to comment.