# HG changeset patch
# User sheepluva
# Date 1335419084 -7200
# Node ID 86c951cd0f3f661179622e13405fc9fa0af5ac69
# Parent d187ea93fc4f83bcece9c2532aed5da07fcc4cdc
make DataManager a QObject with reload() slot that emits signal updated()
diff -r d187ea93fc4f -r 86c951cd0f3f QTfrontend/CMakeLists.txt
--- a/QTfrontend/CMakeLists.txt Thu Apr 26 07:22:05 2012 +0200
+++ b/QTfrontend/CMakeLists.txt Thu Apr 26 07:44:44 2012 +0200
@@ -119,6 +119,7 @@
HWApplication.h
hwform.h
team.h
+ util/DataManager.h
)
set(hwfr_hdrs
diff -r d187ea93fc4f -r 86c951cd0f3f QTfrontend/util/DataManager.cpp
--- a/QTfrontend/util/DataManager.cpp Thu Apr 26 07:22:05 2012 +0200
+++ b/QTfrontend/util/DataManager.cpp Thu Apr 26 07:44:44 2012 +0200
@@ -115,3 +115,7 @@
return "";
}
+void DataManager::reload()
+{
+ emit updated();
+}
diff -r d187ea93fc4f -r 86c951cd0f3f QTfrontend/util/DataManager.h
--- a/QTfrontend/util/DataManager.h Thu Apr 26 07:22:05 2012 +0200
+++ b/QTfrontend/util/DataManager.h Thu Apr 26 07:44:44 2012 +0200
@@ -42,8 +42,10 @@
* @author sheepluva
* @since 0.9.17
*/
-class DataManager
+class DataManager: public QObject
{
+ Q_OBJECT
+
public:
/**
* @brief Returns reference to the singleton instance of this class.
@@ -89,6 +91,20 @@
QString findFileForWrite(const QString & relativeDataFilePath) const;
+ public slots:
+ /**
+ * @brief Reloads data from storage.
+ */
+ void reload();
+
+
+ signals:
+ /**
+ * @brief This signal is emitted after the data has been updated.
+ */
+ void updated();
+
+
private:
/**
* @brief Class constructor of the singleton.