Added patch from Imanuel

- Fixed base path for the external stylesteets

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5119 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-04-24 19:43:38 +00:00
parent 3dca71330c
commit 586e8bc042

View File

@ -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<ChatStyleInfo> &styles)
{
styles.clear();