mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 15:06:08 +03:00
Do not initialise file provider module if not enabled in config
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
ab070fc7c2
commit
246347f88a
1 changed files with 13 additions and 2 deletions
|
@ -16,6 +16,8 @@
|
|||
|
||||
#include <QLoggingCategory>
|
||||
|
||||
#include "configfile.h"
|
||||
|
||||
#include "fileprovider.h"
|
||||
|
||||
namespace OCC {
|
||||
|
@ -32,11 +34,16 @@ FileProvider::FileProvider(QObject * const parent)
|
|||
Q_ASSERT(!_instance);
|
||||
|
||||
if (!fileProviderAvailable()) {
|
||||
qCDebug(lcMacFileProvider) << "File provider system is not available on this version of macOS.";
|
||||
qCInfo(lcMacFileProvider) << "File provider system is not available on this version of macOS.";
|
||||
deleteLater();
|
||||
return;
|
||||
} else if (!ConfigFile().macFileProviderModuleEnabled()) {
|
||||
qCInfo(lcMacFileProvider) << "File provider module is not enabled in application config.";
|
||||
deleteLater();
|
||||
return;
|
||||
}
|
||||
|
||||
qCDebug(lcMacFileProvider) << "Initialising file provider domain manager.";
|
||||
qCInfo(lcMacFileProvider) << "Initialising file provider domain manager.";
|
||||
_domainManager = std::make_unique<FileProviderDomainManager>(new FileProviderDomainManager(this));
|
||||
|
||||
if (_domainManager) {
|
||||
|
@ -54,6 +61,10 @@ FileProvider::FileProvider(QObject * const parent)
|
|||
FileProvider *FileProvider::instance()
|
||||
{
|
||||
if (!fileProviderAvailable()) {
|
||||
qCInfo(lcMacFileProvider) << "File provider system is not available on this version of macOS.";
|
||||
return nullptr;
|
||||
} else if (!ConfigFile().macFileProviderModuleEnabled()) {
|
||||
qCInfo(lcMacFileProvider) << "File provider module is not enabled in application config.";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue