mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2025-02-08 16:33:22 +01:00
Add XDG Base Directory Specification support to Util::createXML
I forgot to change Util::createXML in d430af6
This commit is contained in:
parent
1c26af48d2
commit
cae29a1c1d
13
src/util.cpp
13
src/util.cpp
@ -81,9 +81,18 @@ int Util::createXML(std::string filepath, size_t chunk_size, std::string xml_dir
|
|||||||
FILE *xmlfile;
|
FILE *xmlfile;
|
||||||
size_t filesize, size;
|
size_t filesize, size;
|
||||||
int chunks, i;
|
int chunks, i;
|
||||||
std::string home = (std::string)getenv("HOME");
|
|
||||||
if (xml_dir.empty())
|
if (xml_dir.empty())
|
||||||
xml_dir = home + "/.gogdownloader/xml";
|
{
|
||||||
|
char *xdgcache = getenv("XDG_CACHE_HOME");
|
||||||
|
if (xdgcache)
|
||||||
|
xml_dir = (std::string)xdgcache + "/lgogdownloader/xml";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::string home = (std::string)getenv("HOME");
|
||||||
|
xml_dir = home + "/.cache/lgogdownloader/xml";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure directory exists
|
// Make sure directory exists
|
||||||
boost::filesystem::path path = xml_dir;
|
boost::filesystem::path path = xml_dir;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user