Fix relative path for image download & settings

This commit is contained in:
marco 2015-08-23 15:54:52 +02:00
parent 1e2d5b0693
commit be7efa98cf
4 changed files with 33 additions and 13 deletions

View file

@ -153,11 +153,15 @@ int main(int argc, char *argv[])
installNewTranslator();
qsrand(QDateTime::currentDateTime().toTime_t());
#ifdef PORTABLE_BUILD
const QString dataDir = "data/";
#else
#if QT_VERSION < 0x050000
const QString dataDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
#else
const QString dataDir = QStandardPaths::standardLocations(QStandardPaths::DataLocation).first();
#endif
#endif
if (!db->getLoadSuccess())
if (!db->loadCardDatabase(dataDir + "/cards.xml"))

View file

@ -1,6 +1,7 @@
#include "settingscache.h"
#include <QSettings>
#include <QFile>
#if QT_VERSION >= 0x050000
#include <QStandardPaths>
#else
@ -9,7 +10,7 @@
QString SettingsCache::getSettingsPath()
{
QString file = "";
QString file = "settings/";
#ifndef PORTABLE_BUILD
#if QT_VERSION >= 0x050000
@ -17,10 +18,10 @@ QString SettingsCache::getSettingsPath()
#else
file = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
#endif
#endif
file.append("/settings/");
#endif
return file;
return file;
}
void SettingsCache::translateLegacySettings()

View file

@ -113,11 +113,11 @@ private:
bool spectatorsNeedPassword;
bool spectatorsCanTalk;
bool spectatorsCanSeeEverything;
int keepalive;
QString getSettingsPath();
int keepalive;
void translateLegacySettings();
public:
SettingsCache();
QString getSettingsPath();
const QByteArray &getMainWindowGeometry() const { return mainWindowGeometry; }
QString getLang() const { return lang; }
QString getDeckPath() const { return deckPath; }