GH-1217 add simple instance play time tracking

Not reliable in the face of crashes... but what is?
This commit is contained in:
Petr Mrázek
2015-09-22 01:06:45 +02:00
parent b107617112
commit 9ba1cd15e7
13 changed files with 103 additions and 51 deletions

View File

@@ -71,6 +71,7 @@ public:
void setRunning(bool running);
bool isRunning() const;
int64_t totalTimePlayed();
/// get the type of this instance
QString instanceType() const;
@@ -190,6 +191,8 @@ public:
/// get variables this instance exports
virtual QMap<QString, QString> getVariables() const = 0;
virtual QString typeName() const = 0;
enum InstanceFlag
{
VersionBrokenFlag = 0x01,
@@ -230,6 +233,7 @@ protected:
SettingsObjectPtr m_settings;
InstanceFlags m_flags;
bool m_isRunning = false;
QDateTime m_timeStarted;
};
Q_DECLARE_METATYPE(std::shared_ptr<BaseInstance>)