From: Enar Väikene Date: Wed, 18 May 2011 06:56:49 +0000 (+0300) Subject: Moved setting initial root and bin directories to the Env::init() function. The Env... X-Git-Url: https://vaikene.ee/gitweb/overview.html?a=commitdiff_plain;h=e76495e33c8a48c2e2cd2cb24d99783d22dff67e;p=evaf Moved setting initial root and bin directories to the Env::init() function. The Env object is constructed before the QCoreApplication object and we have no access to the QCoreApplication::applicationDirPath(). --- diff --git a/src/libs/Common/env.cpp b/src/libs/Common/env.cpp index 55b133e..e0c0834 100644 --- a/src/libs/Common/env.cpp +++ b/src/libs/Common/env.cpp @@ -33,7 +33,7 @@ using namespace eVaf::Common; iEnv * iEnv::instance() { - static Internal::Env singleton; + static eVaf::Common::Internal::Env singleton; return &singleton; } @@ -46,6 +46,16 @@ Env::Env() : iEnv() { setObjectName(QString("%1-iEnv").arg(VER_MODULE_NAME_STR)); +} + +Env::~Env() +{ +} + +bool Env::init() +{ + // Register out interface + iRegistry::instance()->registerInterface("iEnv", this); // Set initial bin and root directories mRootDir = mBinDir = qApp->applicationDirPath(); @@ -57,18 +67,8 @@ Env::Env() mBinDir.append('/'); if (!mRootDir.endsWith('/')) mRootDir.append('/'); -} - -Env::~Env() -{ -} - -bool Env::init() -{ - // Register out interface - iRegistry::instance()->registerInterface("iEnv", this); - // Clear directories + // Clear other directories mDataRootDir.clear(); mQtPluginsDir.clear(); mEtcDir.clear(); diff --git a/src/libs/Common/ilogger.h b/src/libs/Common/ilogger.h index cf8e5c7..7c91585 100644 --- a/src/libs/Common/ilogger.h +++ b/src/libs/Common/ilogger.h @@ -240,7 +240,7 @@ signals: * your receiver to this signal if you want to add your own message handling. For example, * use this signal to show messages in a log window etc. */ - void loggerEvent(Severity severity, QString const & text, QString const & source, QString const & where); + void loggerEvent(eVaf::Common::iLogger::Severity severity, QString const & text, QString const & source, QString const & where); }; diff --git a/src/libs/Common/version.h b/src/libs/Common/version.h index 915e830..2e528dc 100644 --- a/src/libs/Common/version.h +++ b/src/libs/Common/version.h @@ -25,12 +25,12 @@ /** * Module/library version number in the form major,minor,release,build */ -#define VER_FILE_VERSION 0,1,1,1 +#define VER_FILE_VERSION 0,1,1,2 /** * Module/library version number in the string format (shall end with \0) */ -#define VER_FILE_VERSION_STR "0.1.1.1\0" +#define VER_FILE_VERSION_STR "0.1.1.2\0" /** * Module/library name (shall end with \0)