diff --git a/src/manager.cpp b/src/manager.cpp index 18854cd017df99f508eee3348bec6097d7c00766..2ce0c670f8d149a5dfad31ba057102b8e7fd3aa5 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -1970,7 +1970,13 @@ std::string Manager::retrieveConfigPath() const { static const char * const PROGNAME = "dring"; +#ifdef WIN32_NATIVE + return UWPAppPath_ + + DIR_SEPARATOR_STR + std::string(".config") + + DIR_SEPARATOR_STR + PROGNAME + ".yml"; +#else return fileutils::get_config_dir() + DIR_SEPARATOR_STR + PROGNAME + ".yml"; +#endif } /** @@ -2568,6 +2574,18 @@ Manager::loadAccountOrder() const return split_string(preferences.getAccountOrder(), '/'); } +void +Manager::setUWPAppPath(const char* app_path) +{ + UWPAppPath_ = std::string(app_path); +} + +std::string +Manager::getUWPAppPath() const +{ + return UWPAppPath_; +} + void Manager::loadAccount(const YAML::Node &node, int &errorCount, const std::string &accountOrder) diff --git a/src/manager.h b/src/manager.h index 886718480f7ca67770c69e89aa55279c638bf468..847821d5af98907054cdc2d9e78bb089c38be065 100644 --- a/src/manager.h +++ b/src/manager.h @@ -769,6 +769,16 @@ class Manager { */ std::vector<std::string> loadAccountOrder() const; + /** + * @param app_path The Universal Windows Application path + */ + void setUWPAppPath(const char* app_path); + + /** + * @return std::string The Universal Windows Application path + */ + std::string getUWPAppPath() const; + private: std::atomic_bool autoAnswer_ {false}; @@ -865,6 +875,11 @@ class Manager { */ std::string path_; + /** + * Universal Windows Platform Application path + */ + std::string UWPAppPath_; + /** * Load the account map from configuration */