mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 21:15:55 +03:00
Ensure file provider class is correctly deallocated and cleanup routines are run
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
2d27d6d072
commit
8ff2c24e8b
4 changed files with 18 additions and 7 deletions
|
@ -51,6 +51,8 @@
|
|||
|
||||
#if defined(Q_OS_WIN)
|
||||
#include <windows.h>
|
||||
#elif defined(Q_OS_MACOS)
|
||||
#include "macOS/fileprovider.h"
|
||||
#endif
|
||||
|
||||
#if defined(WITH_CRASHREPORTER)
|
||||
|
@ -371,8 +373,10 @@ Application::Application(int &argc, char **argv)
|
|||
}
|
||||
|
||||
_folderManager.reset(new FolderMan);
|
||||
#ifdef Q_OS_WIN
|
||||
#if defined(Q_OS_WIN)
|
||||
_shellExtensionsServer.reset(new ShellExtensionsServer);
|
||||
#elif defined(Q_OS_MACOS)
|
||||
_fileProvider.reset(Mac::FileProvider::instance());
|
||||
#endif
|
||||
|
||||
connect(this, &SharedTools::QtSingleApplication::messageReceived, this, &Application::slotParseMessage);
|
||||
|
|
|
@ -49,6 +49,12 @@ class Folder;
|
|||
class ShellExtensionsServer;
|
||||
class SslErrorDialog;
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
namespace Mac {
|
||||
class FileProvider;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief The Application class
|
||||
* @ingroup gui
|
||||
|
@ -152,8 +158,10 @@ private:
|
|||
QScopedPointer<CrashReporter::Handler> _crashHandler;
|
||||
#endif
|
||||
QScopedPointer<FolderMan> _folderManager;
|
||||
#ifdef Q_OS_WIN
|
||||
#if defined(Q_OS_WIN)
|
||||
QScopedPointer<ShellExtensionsServer> _shellExtensionsServer;
|
||||
#elif defined(Q_OS_MACOS)
|
||||
QScopedPointer<Mac::FileProvider> _fileProvider;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
4
src/gui/macOS/fileproviderinterface.h
Normal file
4
src/gui/macOS/fileproviderinterface.h
Normal file
|
@ -0,0 +1,4 @@
|
|||
#ifndef FILEPROVIDERINTERFACE_H
|
||||
#define FILEPROVIDERINTERFACE_H
|
||||
|
||||
#endif // FILEPROVIDERINTERFACE_H
|
|
@ -22,10 +22,6 @@
|
|||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
#include "macOS/fileprovider.h"
|
||||
#endif
|
||||
|
||||
#include "application.h"
|
||||
#include "cocoainitializer.h"
|
||||
#include "theme.h"
|
||||
|
@ -78,7 +74,6 @@ int main(int argc, char **argv)
|
|||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
|
||||
#ifdef Q_OS_MAC
|
||||
Mac::CocoaInitializer cocoaInit; // RIIA
|
||||
const auto fileProvider = OCC::Mac::FileProvider::instance();
|
||||
#endif
|
||||
|
||||
auto surfaceFormat = QSurfaceFormat::defaultFormat();
|
||||
|
|
Loading…
Reference in a new issue