mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-04 22:11:18 +12:00
Add ability to save/read files based on XDG specification
Fix some \\ in paths to be /
This commit is contained in:
parent
15b71c57dd
commit
730a3791a1
30 changed files with 254 additions and 135 deletions
|
@ -67,7 +67,7 @@ bool DownloadGraphicPacksWindow::curlDownloadFile(const char *url, curlDownloadF
|
|||
bool checkGraphicPackDownloadedVersion(const char* nameVersion, bool& hasVersionFile)
|
||||
{
|
||||
hasVersionFile = false;
|
||||
const auto path = ActiveSettings::GetPath("graphicPacks/downloadedGraphicPacks/version.txt");
|
||||
const auto path = ActiveSettings::GetDataPath("graphicPacks/downloadedGraphicPacks/version.txt");
|
||||
std::unique_ptr<FileStream> file(FileStream::openFile2(path));
|
||||
|
||||
std::string versionInFile;
|
||||
|
@ -80,7 +80,7 @@ bool checkGraphicPackDownloadedVersion(const char* nameVersion, bool& hasVersion
|
|||
|
||||
void createGraphicPackDownloadedVersionFile(const char* nameVersion)
|
||||
{
|
||||
const auto path = ActiveSettings::GetPath("graphicPacks/downloadedGraphicPacks/version.txt");
|
||||
const auto path = ActiveSettings::GetDataPath("graphicPacks/downloadedGraphicPacks/version.txt");
|
||||
std::unique_ptr<FileStream> file(FileStream::createFile2(path));
|
||||
if (file)
|
||||
file->writeString(nameVersion);
|
||||
|
@ -92,7 +92,7 @@ void createGraphicPackDownloadedVersionFile(const char* nameVersion)
|
|||
|
||||
void deleteDownloadedGraphicPacks()
|
||||
{
|
||||
const auto path = ActiveSettings::GetPath("graphicPacks/downloadedGraphicPacks");
|
||||
const auto path = ActiveSettings::GetDataPath("graphicPacks/downloadedGraphicPacks");
|
||||
std::error_code er;
|
||||
if (!fs::exists(path))
|
||||
return;
|
||||
|
@ -240,7 +240,7 @@ void DownloadGraphicPacksWindow::UpdateThread()
|
|||
return;
|
||||
}
|
||||
|
||||
auto path = ActiveSettings::GetPath("graphicPacks/downloadedGraphicPacks");
|
||||
auto path = ActiveSettings::GetDataPath("graphicPacks/downloadedGraphicPacks");
|
||||
std::error_code er;
|
||||
//fs::remove_all(path, er); -> Don't delete the whole folder and recreate it immediately afterwards because sometimes it just fails
|
||||
deleteDownloadedGraphicPacks();
|
||||
|
@ -260,7 +260,7 @@ void DownloadGraphicPacksWindow::UpdateThread()
|
|||
std::strstr(sb.name, "..\\") != nullptr)
|
||||
continue; // bad path
|
||||
|
||||
path = ActiveSettings::GetPath("graphicPacks/downloadedGraphicPacks/{}", sb.name);
|
||||
path = ActiveSettings::GetDataPath("graphicPacks/downloadedGraphicPacks/{}", sb.name);
|
||||
|
||||
size_t sbNameLen = strlen(sb.name);
|
||||
if(sbNameLen == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue