mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 21:41:26 +12:00
Use a standard config dir on non-Windows. Fixes #192
Also remove WindowInfo::GetDefault which was redundant.
This commit is contained in:
parent
f256153a2b
commit
3737993bb2
5 changed files with 35 additions and 13 deletions
|
@ -15,6 +15,10 @@
|
|||
#include "Emu/Io/XInput/XInputPadHandler.h"
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
|
||||
rCanvas::rCanvas(void *parent)
|
||||
{
|
||||
|
@ -135,6 +139,27 @@ int rPlatform::getMouseHandlerCount()
|
|||
return 2;
|
||||
}
|
||||
|
||||
std::string rPlatform::getConfigDir()
|
||||
{
|
||||
static std::string dir = ".";
|
||||
if (dir == ".") {
|
||||
#ifdef _WIN32
|
||||
dir = "";
|
||||
//mkdir(dir.c_str());
|
||||
#else
|
||||
if (getenv("XDG_CONFIG_HOME") != NULL)
|
||||
dir = getenv("XDG_CONFIG_HOME");
|
||||
else if (getenv("HOME") != NULL)
|
||||
dir = getenv("HOME") + std::string("/.config");
|
||||
else // Just in case
|
||||
dir = "./config";
|
||||
dir = dir + "/rpcs3/";
|
||||
mkdir(dir.c_str());
|
||||
#endif
|
||||
}
|
||||
return dir;
|
||||
}
|
||||
|
||||
|
||||
MouseHandlerBase *rPlatform::getMouseHandler(int i)
|
||||
{
|
||||
|
@ -179,4 +204,4 @@ PadHandlerBase *rPlatform::getPadHandler(int i)
|
|||
default:
|
||||
return new NullPadHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue