Commit 6cdd1191 authored by Volker Krause's avatar Volker Krause
Browse files

Make load() callable multiple times

For this we need to increase the start count elsewhere. This is the first
step towards dealing with multiple instances of Provider being active at
the same time for the same product id, which can happen for any non-unique
application.
parent b090d2b7
......@@ -127,7 +127,7 @@ void ProviderPrivate::load()
lastSurveyTime = s->value(QStringLiteral("LastSurvey")).toDateTime();
completedSurveys = s->value(QStringLiteral("CompletedSurveys"), QStringList()).toStringList();
startCount = std::max(s->value(QStringLiteral("ApplicationStartCount"), 0).toInt() + 1, 1);
startCount = std::max(s->value(QStringLiteral("ApplicationStartCount"), 0).toInt(), 0);
usageTime = std::max(s->value(QStringLiteral("ApplicationTime"), 0).toInt(), 0);
lastEncouragementTime = s->value(QStringLiteral("LastEncouragement")).toDateTime();
......@@ -372,6 +372,8 @@ Provider::Provider(QObject *parent) :
connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(aboutToQuit()));
d->load();
d->startCount++;
d->store();
}
Provider::~Provider()
......
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