/***************************************************************************
- * Copyright (C) 2005-2013 by the Quassel Project *
+ * Copyright (C) 2005-2020 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#ifndef COREAPPLICATION_H_
-#define COREAPPLICATION_H_
+#pragma once
-#ifdef HAVE_KDE
-# include <KApplication>
-#else
-# include <QCoreApplication>
-#endif
+#include "core-export.h"
-#include "quassel.h"
-
-/// Encapsulates CoreApplication's logic.
-/** This allows it to be reused within MonolithicApplication as well.
- */
-class CoreApplicationInternal
-{
- Q_DECLARE_TR_FUNCTIONS(CoreApplicationInternal)
+#include <memory>
-public:
- CoreApplicationInternal();
- ~CoreApplicationInternal();
-
- bool init();
+#include <QCoreApplication>
-private:
- bool _coreCreated;
-};
+#include "core.h"
+#include "quassel.h"
+class Core;
-class CoreApplication : public QCoreApplication, public Quassel
+class CORE_EXPORT CoreApplication : public QCoreApplication
{
Q_OBJECT
+
public:
- CoreApplication(int &argc, char **argv);
- ~CoreApplication();
+ CoreApplication(int& argc, char** argv);
- bool init();
+ void init();
+
+private slots:
+ void onShutdownComplete();
private:
- CoreApplicationInternal *_internal;
+ std::unique_ptr<Core> _core;
};
-
-
-#endif