Skip to content

Commit

Permalink
Set up VFS integration before parsing options
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Müller committed Feb 22, 2022
1 parent 836fc7e commit 898f447
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
7 changes: 7 additions & 0 deletions changelog/unreleased/9155
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bugfix: --version showed incorrect information about VFS support

--version used to always show "Off", even when a VFS plugin was available.
This has been fixed now.

https://github.com/owncloud/client/issues/9155
https://github.com/owncloud/client/pull/9457
30 changes: 15 additions & 15 deletions src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,21 @@ Application::Application(int &argc, char **argv)
// needed during commandline options parsing
setApplicationVersion(_theme->versionSwitchOutput());

#if defined(OC_PLUGIN_DIR) && defined(Q_OS_LINUX)
const QString extraPluginDir = QDir(QApplication::applicationDirPath()).filePath(QStringLiteral(OC_PLUGIN_DIR));
qCInfo(lcApplication) << "Adding extra plugin search path:" << extraPluginDir;
this->addLibraryPath(extraPluginDir);
#endif

// Check vfs plugins
if (Theme::instance()->showVirtualFilesOption() && bestAvailableVfsMode() == Vfs::Off) {
qCWarning(lcApplication) << "Theme wants to show vfs mode, but no vfs plugins are available";
}
if (isVfsPluginAvailable(Vfs::WindowsCfApi))
qCInfo(lcApplication) << "VFS windows plugin is available";
if (isVfsPluginAvailable(Vfs::WithSuffix))
qCInfo(lcApplication) << "VFS suffix plugin is available";

parseOptions(arguments());

if (isRunning())
Expand Down Expand Up @@ -276,21 +291,6 @@ Application::Application(int &argc, char **argv)
if (!AbstractNetworkJob::httpTimeout)
AbstractNetworkJob::httpTimeout = cfg.timeout();

#if defined(OC_PLUGIN_DIR) && defined(Q_OS_LINUX)
const QString extraPluginDir = QDir(QApplication::applicationDirPath()).filePath(QStringLiteral(OC_PLUGIN_DIR));
qCInfo(lcApplication) << "Adding extra plugin search path:" << extraPluginDir;
this->addLibraryPath(extraPluginDir);
#endif

// Check vfs plugins
if (Theme::instance()->showVirtualFilesOption() && bestAvailableVfsMode() == Vfs::Off) {
qCWarning(lcApplication) << "Theme wants to show vfs mode, but no vfs plugins are available";
}
if (isVfsPluginAvailable(Vfs::WindowsCfApi))
qCInfo(lcApplication) << "VFS windows plugin is available";
if (isVfsPluginAvailable(Vfs::WithSuffix))
qCInfo(lcApplication) << "VFS suffix plugin is available";

if (_quitInstance) {
QTimer::singleShot(0, qApp, &QApplication::quit);
return;
Expand Down

0 comments on commit 898f447

Please sign in to comment.