diff --git a/common/globals.h b/common/globals.h --- a/common/globals.h +++ b/common/globals.h @@ -19,14 +19,10 @@ #include -class Globals +namespace Globals { -public: - static void setDirPath(const QString &path); - static QString dirPath(); - -private: - static QString s_dirPath; -}; + void setDirPath(const QString &path); + QString dirPath(); +} #endif diff --git a/common/globals.cpp b/common/globals.cpp --- a/common/globals.cpp +++ b/common/globals.cpp @@ -18,16 +18,22 @@ #include -QString Globals::s_dirPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) % QStringLiteral("/kscreen/"); +namespace Globals +{ + +QString s_dirPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) % + QStringLiteral("/kscreen/"); -QString Globals::dirPath() { +QString dirPath() { return s_dirPath; } -void Globals::setDirPath(const QString &path) +void setDirPath(const QString &path) { s_dirPath = path; if (!s_dirPath.endsWith(QLatin1Char('/'))) { s_dirPath += QLatin1Char('/'); } } + +}