Verified Commit 1c45a41d authored by Jonah Brüchert's avatar Jonah Brüchert 🌳

BrowserManager: Make constructor private

It should always be created using instance()
parent 76697974
......@@ -34,7 +34,7 @@ private Q_SLOTS:
void initTestCase()
{
m_browserManager = new BrowserManager();
m_browserManager = BrowserManager::instance();
}
void cleanupTestCase()
......
......@@ -32,7 +32,6 @@ BrowserManager *BrowserManager::s_instance = nullptr;
BrowserManager::BrowserManager(QObject *parent) : QObject(parent), m_settings(new QSettings(this))
{
BrowserManager::s_instance = this;
}
BrowserManager::~BrowserManager()
......
......@@ -49,7 +49,6 @@ class BrowserManager : public QObject
Q_PROPERTY(QString initialUrl READ initialUrl WRITE setInitialUrl NOTIFY initialUrlChanged)
public:
BrowserManager(QObject *parent = nullptr);
~BrowserManager() override;
static BrowserManager *instance();
......@@ -85,6 +84,9 @@ public slots:
void setSearchBaseUrl(const QString &searchBaseUrl);
private:
// BrowserManager should only be createdd by calling the instance() function
BrowserManager(QObject *parent = nullptr);
UrlModel *m_bookmarks = nullptr;
UrlModel *m_history = nullptr;
QSettings *m_settings;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment