Support of relative paths in branding.xml

This commit is contained in:
wmayer
2012-02-27 12:47:34 +01:00
parent 06d47ff0f2
commit a13608744a
2 changed files with 18 additions and 2 deletions

View File

@@ -79,8 +79,14 @@ BitmapFactoryInst& BitmapFactoryInst::instance(void)
_pcSingleton = new BitmapFactoryInst;
std::map<std::string,std::string>::const_iterator it;
it = App::GetApplication().Config().find("ProgramIcons");
if (it != App::GetApplication().Config().end())
_pcSingleton->addPath(QString::fromUtf8(it->second.c_str()));
if (it != App::GetApplication().Config().end()) {
QString home = QString::fromUtf8(App::GetApplication().GetHomePath());
QString path = QString::fromUtf8(it->second.c_str());
if (QDir(path).isRelative()) {
path = QFileInfo(QDir(home), path).absoluteFilePath();
}
_pcSingleton->addPath(path);
}
_pcSingleton->addPath(QLatin1String(":/icons/"));
_pcSingleton->addPath(QLatin1String(":/Icons/"));
_pcSingleton->addPath(QString::fromUtf8(App::GetApplication().GetHomePath()));