namespace OCC {
+class Application;
+
namespace Mac {
// NOTE: For the file provider extension to work, the app bundle will
public:
static FileProvider *instance();
- ~FileProvider() = default;
+ ~FileProvider() override;
static bool fileProviderAvailable();
private:
- explicit FileProvider(QObject * const parent = nullptr);
std::unique_ptr<FileProviderDomainManager> _domainManager;
std::unique_ptr<FileProviderSocketServer> _socketServer;
+
+ static FileProvider *_instance;
+ explicit FileProvider(QObject * const parent = nullptr);
+
+ friend class OCC::Application;
};
} // namespace Mac
namespace Mac {
-static FileProvider *_instance = nullptr;
+FileProvider* FileProvider::_instance = nullptr;
FileProvider::FileProvider(QObject * const parent)
: QObject(parent)
{
+ Q_ASSERT(!_instance);
+
if (!fileProviderAvailable()) {
qCDebug(lcMacFileProvider) << "File provider system is not available on this version of macOS.";
return;
return _instance;
}
+FileProvider::~FileProvider()
+{
+ _instance = nullptr;
+}
+
bool FileProvider::fileProviderAvailable()
{
if (@available(macOS 11.0, *)) {