Minor refactoring

This commit is contained in:
crowning2 2015-03-10 09:09:41 +01:00
parent a49668b473
commit effd3f39b2

View File

@ -768,21 +768,21 @@ QString loadStyleSheet()
{ {
QString styleSheet; QString styleSheet;
QSettings settings; QSettings settings;
QString cssName;
QString theme = settings.value("theme", "").toString(); QString theme = settings.value("theme", "").toString();
if(!theme.isEmpty()){ if(!theme.isEmpty()){
QFile qFile(QString(":/css/") + theme); cssName = QString(":/css/") + theme;
if (qFile.open(QFile::ReadOnly)) {
styleSheet = QLatin1String(qFile.readAll());
}
} }
else { else {
QFile qFile(":/css/drkblue"); cssName = QString(":/css/drkblue");
if (qFile.open(QFile::ReadOnly)) {
styleSheet = QLatin1String(qFile.readAll());
}
} }
QFile qFile(cssName);
if (qFile.open(QFile::ReadOnly)) {
styleSheet = QLatin1String(qFile.readAll());
}
return styleSheet; return styleSheet;
} }