diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-02-02 00:50:18 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-02-02 00:50:18 +0100 |
commit | 629b459b35268b0bba31bc824eb7078305d3c210 (patch) | |
tree | 3cfbccfdd7b0dc182ed95d41b71a80177bc3854d | |
parent | 6d40b2fcdbc2b66fcb0a62b48151035e3aa293d5 (diff) |
options/globals: always return same document directory
-rw-r--r-- | options/globals.cpp | 10 | ||||
-rw-r--r-- | options/globals.hpp | 1 |
2 files changed, 8 insertions, 3 deletions
diff --git a/options/globals.cpp b/options/globals.cpp index 3bd185af..dbc6df90 100644 --- a/options/globals.cpp +++ b/options/globals.cpp @@ -11,7 +11,7 @@ namespace options::globals::detail { ini_ctx::ini_ctx() = default; -bool is_portable_installation() +static bool is_portable_installation() { #if defined _WIN32 // must keep consistent between invocations @@ -143,7 +143,7 @@ void mark_ini_modified(bool value) ini.mtx.unlock(); } -QString ini_directory() +static QString ini_directory_() { QString dir; @@ -173,4 +173,10 @@ QString ini_directory() return dir; } +QString ini_directory() +{ + static const QString dir = ini_directory_(); + return dir; +} + } // ns options::globals diff --git a/options/globals.hpp b/options/globals.hpp index 8032e5d8..5b392055 100644 --- a/options/globals.hpp +++ b/options/globals.hpp @@ -44,7 +44,6 @@ auto with_settings_object_(ini_ctx& ini, F&& fun) OTR_OPTIONS_EXPORT ini_ctx& cur_settings(); OTR_OPTIONS_EXPORT ini_ctx& global_settings(); -OTR_OPTIONS_EXPORT bool is_portable_installation(); } // ns options::globals::detail |