summaryrefslogtreecommitdiffstats
path: root/logic
diff options
context:
space:
mode:
Diffstat (limited to 'logic')
-rw-r--r--logic/BaseInstance.cpp7
-rw-r--r--logic/BaseInstance.h3
2 files changed, 8 insertions, 2 deletions
diff --git a/logic/BaseInstance.cpp b/logic/BaseInstance.cpp
index b0235b47..02284d37 100644
--- a/logic/BaseInstance.cpp
+++ b/logic/BaseInstance.cpp
@@ -108,7 +108,7 @@ void BaseInstance::setRunning(bool running)
m_isRunning = running;
}
-int64_t BaseInstance::totalTimePlayed()
+int64_t BaseInstance::totalTimePlayed() const
{
qint64 current = settings()->get("totalTimePlayed").toLongLong();
if(m_isRunning)
@@ -119,6 +119,11 @@ int64_t BaseInstance::totalTimePlayed()
return current;
}
+void BaseInstance::resetTimePlayed()
+{
+ settings()->reset("totalTimePlayed");
+}
+
QString BaseInstance::instanceType() const
{
return m_settings->get("InstanceType").toString();
diff --git a/logic/BaseInstance.h b/logic/BaseInstance.h
index 32a4d1cd..8c0c098b 100644
--- a/logic/BaseInstance.h
+++ b/logic/BaseInstance.h
@@ -71,7 +71,8 @@ public:
void setRunning(bool running);
bool isRunning() const;
- int64_t totalTimePlayed();
+ int64_t totalTimePlayed() const;
+ void resetTimePlayed();
/// get the type of this instance
QString instanceType() const;