Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

OpenCL: change .bin dir to be in $XDG_DATA_HOME #238

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
OpenCL: change .bin dir to $XDG_DATA_HOME
  • Loading branch information
Artturin committed Apr 30, 2020
commit f9201eec8ec3b2255ad7a4e8a32a5a1db18126b2
13 changes: 11 additions & 2 deletions src/modelHandler_OpenCL.cpp
Original file line number Diff line number Diff line change
@@ -558,10 +558,19 @@ namespace w2xc
{
std::string user_folder("/tmp/.waifu2x");
char *home_dir = getenv ("HOME");
char *xdg_data_home = getenv ("XDG_DATA_HOME");

if (home_dir != NULL)
if (xdg_data_home != NULL)
{
user_folder = std::string(home_dir) + "/.waifu2x";
user_folder = std::string(xdg_data_home) + "/waifu2x";
}

if (xdg_data_home == NULL)
{
if (home_dir != NULL)
{
user_folder = std::string(home_dir) + "/.local/share/waifu2x";
}
}

if (!fs::exists(user_folder))