summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-16 07:50:41 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-16 07:50:41 (GMT)
commit30ac86ea47b3060ee0bc5669fcd934ee0c5bf4fb (patch)
treea03ec91c59481a88c9d3cf27fa2f71cf975230c0
parentcd400c20fc6d740d3d44f58032927e8cbbfc160b (diff)
Add singleton
-rw-r--r--webengineviewer/src/checkphishingurl/localdatabasemanager.cpp7
-rw-r--r--webengineviewer/src/checkphishingurl/localdatabasemanager.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp b/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
index 660eaab..7ac87bf 100644
--- a/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
+++ b/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
@@ -20,6 +20,8 @@
using namespace WebEngineViewer;
+Q_GLOBAL_STATIC(LocalDataBaseManager, s_localDataBaseManager)
+
LocalDataBaseManager::LocalDataBaseManager(QObject *parent)
: QObject(parent)
{
@@ -30,3 +32,8 @@ LocalDataBaseManager::~LocalDataBaseManager()
{
}
+
+LocalDataBaseManager *LocalDataBaseManager::self()
+{
+ return s_localDataBaseManager;
+}
diff --git a/webengineviewer/src/checkphishingurl/localdatabasemanager.h b/webengineviewer/src/checkphishingurl/localdatabasemanager.h
index 9324d7b..f104fe4 100644
--- a/webengineviewer/src/checkphishingurl/localdatabasemanager.h
+++ b/webengineviewer/src/checkphishingurl/localdatabasemanager.h
@@ -29,6 +29,8 @@ class LocalDataBaseManager : public QObject
public:
explicit LocalDataBaseManager(QObject *parent = Q_NULLPTR);
~LocalDataBaseManager();
+
+ static LocalDataBaseManager *self();
};
}