From 246347f88a38d1e7a4ec16673ae3c1c8ed54964e Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Fri, 12 May 2023 12:09:19 +0800 Subject: [PATCH] Do not initialise file provider module if not enabled in config Signed-off-by: Claudio Cambra --- src/gui/macOS/fileprovider_mac.mm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/gui/macOS/fileprovider_mac.mm b/src/gui/macOS/fileprovider_mac.mm index 9cb5b739b..56db4d244 100644 --- a/src/gui/macOS/fileprovider_mac.mm +++ b/src/gui/macOS/fileprovider_mac.mm @@ -16,6 +16,8 @@ #include +#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(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; } -- 2.30.2