mirror of
https://github.com/overte-org/overte.git
synced 2025-08-19 17:11:06 +02:00
firstRun uses new Settings
This commit is contained in:
parent
33d0e1bad5
commit
5266ae5397
2 changed files with 6 additions and 6 deletions
|
@ -74,6 +74,7 @@
|
|||
#include <PhysicsEngine.h>
|
||||
#include <ProgramObject.h>
|
||||
#include <ResourceCache.h>
|
||||
#include <Settings.h>
|
||||
#include <SoundCache.h>
|
||||
#include <TextRenderer.h>
|
||||
#include <UserActivityLogger.h>
|
||||
|
@ -432,21 +433,21 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
|||
connect(this, SIGNAL(aboutToQuit()), this, SLOT(aboutToQuit()));
|
||||
|
||||
// check first run...
|
||||
QVariant firstRunValue = _settings->value("firstRun",QVariant(true));
|
||||
Settings settings;
|
||||
QString firstRunKey = "firstRun";
|
||||
QVariant firstRunValue = settings.value(firstRunKey, true);
|
||||
if (firstRunValue.isValid() && firstRunValue.toBool()) {
|
||||
qDebug() << "This is a first run...";
|
||||
// clear the scripts, and set out script to our default scripts
|
||||
clearScriptsBeforeRunning();
|
||||
loadScript(DEFAULT_SCRIPTS_JS_URL);
|
||||
|
||||
QMutexLocker locker(&_settingsMutex);
|
||||
_settings->setValue("firstRun",QVariant(false));
|
||||
settings.setValue(firstRunKey, false);
|
||||
} else {
|
||||
// do this as late as possible so that all required subsystems are initialized
|
||||
loadScripts();
|
||||
|
||||
QMutexLocker locker(&_settingsMutex);
|
||||
_previousScriptLocation = _settings->value("LastScriptLocation", QVariant("")).toString();
|
||||
_previousScriptLocation = settings.value("LastScriptLocation", "").toString();
|
||||
}
|
||||
|
||||
_trayIcon->show();
|
||||
|
|
|
@ -80,7 +80,6 @@
|
|||
class QGLWidget;
|
||||
class QKeyEvent;
|
||||
class QMouseEvent;
|
||||
class QSettings;
|
||||
class QSystemTrayIcon;
|
||||
class QTouchEvent;
|
||||
class QWheelEvent;
|
||||
|
|
Loading…
Reference in a new issue