Skip to content
Snippets Groups Projects
Commit 574c4eb3 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

[#1791] Not much

parent e0a63605
No related branches found
No related tags found
No related merge requests found
......@@ -148,22 +148,21 @@ int HistoryManager::create_history_path (std::string path)
std::string filename, userdata, xdg_env, xdg_data;
xdg_data = std::string (HOMEDIR) + DIR_SEPARATOR_STR + ".local/share";
xdg_data = std::string (HOMEDIR) + DIR_SEPARATOR_STR + ".local/share/sflphone";
if (path == "") {
// TODO Should use $XDG_DATA_HOME (which default to .local/share) instead of HOMEDIR
// If the environment variable is set (not null and not empty), we'll use it to save the history
// Else we 'll the standard one, ie: XDG_DATA_HOME = $HOMEDIR/.local/share/sflphone
if (XDG_DATA_HOME != NULL)
{
xdg_env = std::string (XDG_DATA_HOME);
(xdg_env.length() > 0) ? userdata = xdg_env
: userdata = xdg_data;
(xdg_env.length() > 0) ? userdata = xdg_env
: userdata = xdg_data;
}
else
userdata = xdg_data;
filename = userdata + DIR_SEPARATOR_STR + PROGDIR;
if (mkdir (filename.data(), 0755) != 0) {
// If directory creation failed
if (errno != EEXIST) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment