aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-06-30 11:30:21 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2016-06-30 11:30:21 +0000
commitf951dd4cee169dfd45d7989a6e4baaa850126a88 (patch)
tree348e91bdb1ea5f689798ca168ce743411f30e360
parent3f1dae2f25d7fd509e6ca8d2d4cb54a83fd69b10 (diff)
downloadqmmp-f951dd4cee169dfd45d7989a6e4baaa850126a88.tar.gz
qmmp-f951dd4cee169dfd45d7989a6e4baaa850126a88.tar.bz2
qmmp-f951dd4cee169dfd45d7989a6e4baaa850126a88.zip
fixes for portable mode
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6546 90c681e8-e032-0410-971d-27865f9a5e38
-rw-r--r--src/qmmp/qmmp.cpp11
-rw-r--r--src/qmmp/qmmp.h3
2 files changed, 11 insertions, 3 deletions
diff --git a/src/qmmp/qmmp.cpp b/src/qmmp/qmmp.cpp
index cbd0412ba..05925286c 100644
--- a/src/qmmp/qmmp.cpp
+++ b/src/qmmp/qmmp.cpp
@@ -35,6 +35,9 @@
QString Qmmp::m_configDir;
QString Qmmp::m_langID;
+#ifdef Q_OS_WIN
+QString Qmmp::m_appDir;
+#endif
const QString Qmmp::configFile()
{
@@ -47,7 +50,7 @@ const QString Qmmp::configDir()
if(m_configDir.isEmpty())
{
if(isPortable())
- return QCoreApplication::applicationDirPath() + "/.qmmp/";
+ return m_appDir + "/.qmmp/";
else
return QDir::homePath() +"/.qmmp/";
}
@@ -137,9 +140,11 @@ void Qmmp::setUiLanguageID(const QString &code)
m_langID.clear();
}
-#if Q_OS_WIN
+#ifdef Q_OS_WIN
bool Qmmp::isPortable()
{
- QFile::exists(QCoreApplication::applicationDirPath() + "/qmmp_portable.txt");
+ if(m_appDir.isEmpty())
+ m_appDir = QCoreApplication::applicationDirPath();
+ return QFile::exists(m_appDir + "/qmmp_portable.txt");
}
#endif
diff --git a/src/qmmp/qmmp.h b/src/qmmp/qmmp.h
index b6cfeafb5..ec2fab702 100644
--- a/src/qmmp/qmmp.h
+++ b/src/qmmp/qmmp.h
@@ -168,6 +168,9 @@ public:
private:
static QString m_configDir;
static QString m_langID;
+#ifdef Q_OS_WIN
+ static QString m_appDir;
+#endif
};