Fix paths on Windows
This commit is contained in:
parent
f9644abb67
commit
a4b88f0294
|
@ -155,9 +155,10 @@ FILE* OpenFile(const char* path, const char* mode, bool mustexist)
|
||||||
|
|
||||||
FILE* OpenLocalFile(const char* path, const char* mode)
|
FILE* OpenLocalFile(const char* path, const char* mode)
|
||||||
{
|
{
|
||||||
|
QDir dir(path);
|
||||||
QString fullpath;
|
QString fullpath;
|
||||||
|
|
||||||
if (path[0] == '/')
|
if (dir.isAbsolute())
|
||||||
{
|
{
|
||||||
// If it's an absolute path, just open that.
|
// If it's an absolute path, just open that.
|
||||||
fullpath = path;
|
fullpath = path;
|
||||||
|
@ -165,7 +166,7 @@ FILE* OpenLocalFile(const char* path, const char* mode)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef PORTABLE
|
#ifdef PORTABLE
|
||||||
fullpath = QString("./") + path;
|
fullpath = path;
|
||||||
#else
|
#else
|
||||||
// Check user configuration directory
|
// Check user configuration directory
|
||||||
QDir config(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation));
|
QDir config(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation));
|
||||||
|
|
Loading…
Reference in New Issue