The member _trayEngine, allocated in the constructor, was leaking.
This commit sets the Systray instance as the Qt object tree parent of
the _trayEngine to fix the leak.
While at it, a few unused header includes have been removed.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
#include "tray/UserModel.h"
#include <QCursor>
-#include <QDesktopServices>
#include <QGuiApplication>
-#include <QQmlComponent>
#include <QQmlApplicationEngine>
+#include <QQmlContext>
#include <QScreen>
#ifdef USE_FDO_NOTIFICATIONS
Systray::Systray()
: _isOpen(false)
, _syncIsPaused(false)
+ , _trayEngine(new QQmlApplicationEngine(this))
{
- _trayEngine = new QQmlApplicationEngine;
_trayEngine->addImportPath("qrc:/qml/theme");
_trayEngine->addImageProvider("avatars", new ImageProvider);
_trayEngine->rootContext()->setContextProperty("userModelBackend", UserModel::instance());
#define SYSTRAY_H
#include <QSystemTrayIcon>
-#include <QQmlContext>
#include "accountmanager.h"
#include "tray/UserModel.h"
-class QIcon;
class QQmlApplicationEngine;
namespace OCC {