Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
44fefc20
Commit
44fefc20
authored
Sep 03, 2015
by
marco
Browse files
Fix portable on OSX
parent
b4c5729b
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/settingscache.cpp
View file @
44fefc20
#include
"settingscache.h"
#include
"settingscache.h"
#include
<QSettings>
#include
<QSettings>
#include
<QFile>
#include
<QFile>
#include
<QApplication>
#if QT_VERSION >= 0x050000
#if QT_VERSION >= 0x050000
#include
<QStandardPaths>
#include
<QStandardPaths>
...
@@ -10,7 +11,7 @@
...
@@ -10,7 +11,7 @@
QString
SettingsCache
::
getSettingsPath
()
QString
SettingsCache
::
getSettingsPath
()
{
{
QString
file
=
"settings/"
;
QString
file
=
qApp
->
applicationDirPath
()
+
"settings/"
;
#ifndef PORTABLE_BUILD
#ifndef PORTABLE_BUILD
#if QT_VERSION >= 0x050000
#if QT_VERSION >= 0x050000
...
@@ -27,10 +28,6 @@ QString SettingsCache::getSettingsPath()
...
@@ -27,10 +28,6 @@ QString SettingsCache::getSettingsPath()
void
SettingsCache
::
translateLegacySettings
()
void
SettingsCache
::
translateLegacySettings
()
{
{
#ifdef PORTABLE_BUILD
#ifdef PORTABLE_BUILD
setDeckPath
(
"data/decks"
);
setReplaysPath
(
"data/replays"
);
setPicsPath
(
"data/pics"
);
setSoundPath
(
"data/sounds"
);
return
;
return
;
#endif
#endif
...
@@ -136,6 +133,13 @@ SettingsCache::SettingsCache()
...
@@ -136,6 +133,13 @@ SettingsCache::SettingsCache()
if
(
!
QFile
(
settingsPath
+
"global.ini"
).
exists
())
if
(
!
QFile
(
settingsPath
+
"global.ini"
).
exists
())
translateLegacySettings
();
translateLegacySettings
();
#ifdef PORTABLE_BUILD
setDeckPath
(
qApp
->
applicationDirPath
()
+
"data/decks"
);
setReplaysPath
(
qApp
->
applicationDirPath
()
+
"data/replays"
);
setPicsPath
(
qApp
->
applicationDirPath
()
+
"data/pics"
);
setSoundPath
(
qApp
->
applicationDirPath
()
+
"data/sounds"
);
#endif
notifyAboutUpdates
=
settings
->
value
(
"personal/updatenotification"
,
true
).
toBool
();
notifyAboutUpdates
=
settings
->
value
(
"personal/updatenotification"
,
true
).
toBool
();
lang
=
settings
->
value
(
"personal/lang"
).
toString
();
lang
=
settings
->
value
(
"personal/lang"
).
toString
();
keepalive
=
settings
->
value
(
"personal/keepalive"
,
5
).
toInt
();
keepalive
=
settings
->
value
(
"personal/keepalive"
,
5
).
toInt
();
...
...
oracle/src/oraclewizard.cpp
View file @
44fefc20
...
@@ -516,7 +516,7 @@ bool SaveSetsPage::validatePage()
...
@@ -516,7 +516,7 @@ bool SaveSetsPage::validatePage()
dataDir
=
QStandardPaths
::
standardLocations
(
QStandardPaths
::
DataLocation
).
first
();
dataDir
=
QStandardPaths
::
standardLocations
(
QStandardPaths
::
DataLocation
).
first
();
#endif
#endif
#else
#else
dataDir
=
"
data"
;
dataDir
=
qApp
->
applicationDirPath
()
+
"/
data"
;
#endif
#endif
#ifdef PORTABLE_BUILD
#ifdef PORTABLE_BUILD
...
@@ -731,7 +731,7 @@ bool SaveTokensPage::validatePage()
...
@@ -731,7 +731,7 @@ bool SaveTokensPage::validatePage()
dataDir
=
QStandardPaths
::
standardLocations
(
QStandardPaths
::
DataLocation
).
first
();
dataDir
=
QStandardPaths
::
standardLocations
(
QStandardPaths
::
DataLocation
).
first
();
#endif
#endif
#else
#else
dataDir
=
"
data"
;
dataDir
=
qApp
->
applicationDirPath
()
+
"/
data"
;
#endif
#endif
#ifdef PORTABLE_BUILD
#ifdef PORTABLE_BUILD
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment