Make the Controller a singleton

This commit is contained in:
Tobias Fella
2020-11-04 01:43:13 +00:00
committed by Nicolas Fella
parent 1739a454da
commit 2d1a7d6500
13 changed files with 42 additions and 66 deletions

View File

@@ -31,8 +31,11 @@ class Controller : public QObject
Q_PROPERTY(bool busy READ busy WRITE setBusy NOTIFY busyChanged)
public:
explicit Controller(QObject *parent = nullptr);
~Controller();
static Controller &instance()
{
static Controller _instance;
return _instance;
}
Q_INVOKABLE void loginWithCredentials(QString, QString, QString, QString);
Q_INVOKABLE void loginWithAccessToken(QString, QString, QString, QString);
@@ -100,6 +103,9 @@ public:
}
private:
explicit Controller(QObject *parent = nullptr);
~Controller();
QVector<Connection *> m_connections;
QPointer<Connection> m_connection;
QNetworkConfigurationManager m_ncm;