diff --git a/retroshare-gui/src/gui/chat/ChatStyle.cpp b/retroshare-gui/src/gui/chat/ChatStyle.cpp index 968b20500..95ebc6a48 100644 --- a/retroshare-gui/src/gui/chat/ChatStyle.cpp +++ b/retroshare-gui/src/gui/chat/ChatStyle.cpp @@ -139,11 +139,26 @@ void ChatStyle::styleChanged(int styleType) } } +static QString getBaseDir() +{ + // application path + QString baseDir = QString::fromUtf8(RsInit::RsConfigDirectory().c_str()); + +#ifdef WIN32 + if (RsInit::isPortable ()) { + // application dir for portable version + baseDir = QApplication::applicationDirPath(); + } +#endif + + return baseDir; +} + bool ChatStyle::setStylePath(const QString &stylePath, const QString &styleVariant) { m_styleType = TYPE_UNKNOWN; - m_styleDir.setPath(QApplication::applicationDirPath()); + m_styleDir.setPath(getBaseDir()); if (m_styleDir.cd(stylePath) == false) { m_styleDir = QDir(""); m_styleVariant.clear(); @@ -412,21 +427,6 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle return true; } -static QString getBaseDir() -{ - // application path - QString baseDir = QString::fromUtf8(RsInit::RsConfigDirectory().c_str()); - -#ifdef WIN32 - if (RsInit::isPortable ()) { - // application dir for portable version - baseDir = QApplication::applicationDirPath(); - } -#endif - - return baseDir; -} - /*static*/ bool ChatStyle::getAvailableStyles(enumStyleType styleType, QList &styles) { styles.clear();