diff options
| -rw-r--r-- | src/qmmp/qmmp.cpp | 11 | ||||
| -rw-r--r-- | src/qmmp/qmmp.h | 3 |
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 }; |
