From: Enar Väikene Date: Thu, 19 May 2011 12:15:52 +0000 (+0300) Subject: Removed QtGui dependency from CommonLib. X-Git-Url: https://vaikene.ee/gitweb/pswgen11.html?a=commitdiff_plain;h=563d9c2c35a46b11566ec8440beeb8006bc6aeb0;p=evaf Removed QtGui dependency from CommonLib. --- diff --git a/src/libs/Common/CMakeLists.txt b/src/libs/Common/CMakeLists.txt index 085749e..83b5cd6 100644 --- a/src/libs/Common/CMakeLists.txt +++ b/src/libs/Common/CMakeLists.txt @@ -2,6 +2,7 @@ set(TARGET CommonLib) # Qt modules +set(QT_DONT_USE_QTGUI TRUE) include(${QT_USE_FILE}) # Needed for exporting/importing symbols diff --git a/src/libs/Common/env.cpp b/src/libs/Common/env.cpp index e0c0834..9f72a8c 100644 --- a/src/libs/Common/env.cpp +++ b/src/libs/Common/env.cpp @@ -24,7 +24,6 @@ #include "iapp.h" #include -#include //------------------------------------------------------------------- @@ -75,8 +74,20 @@ bool Env::init() mLogDir.clear(); mDocDir.clear(); + // Set the data root directory +#ifdef Q_OS_LINUX + QString dataLoc = QDir::homePath(); + if (!dataLoc.endsWith('/')) + dataLoc.append('/'); + dataLoc.append(".local/share/data/"); + mDataRootDir = dataLoc + iApp::instance()->name(); + if (!mDataRootDir.endsWith('/')) + mDataRootDir.append('/'); +#endif + /// @TODO: Needs local data directory on Windows + // Process the environment - QStringList env = QProcess::systemEnvironment(); + QStringList env = QProcessEnvironment::systemEnvironment().toStringList(); int sz = env.size(); for (int i = 0; i < sz; ++i) { // Get the name/value pair @@ -159,15 +170,9 @@ bool Env::init() QString const Env::dataRootDir() const { - if (mDataRootDir.isEmpty()) { - QString dataLoc = QDesktopServices::storageLocation(QDesktopServices::DataLocation); - if (!dataLoc.endsWith('/')) - dataLoc.append('/'); - mDataRootDir = dataLoc.append(iApp::instance()->name()); - if (!mDataRootDir.endsWith('/')) - mDataRootDir.append('/'); - } - + // Fall-back to the application's root directory if the data root directory is empty + if (mDataRootDir.isEmpty()) + mDataRootDir = rootDir(); return mDataRootDir; } diff --git a/src/libs/Common/version.h b/src/libs/Common/version.h index 2e528dc..7584798 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,2 +#define VER_FILE_VERSION 0,1,1,3 /** * Module/library version number in the string format (shall end with \0) */ -#define VER_FILE_VERSION_STR "0.1.1.2\0" +#define VER_FILE_VERSION_STR "0.1.1.3\0" /** * Module/library name (shall end with \0)