Skip to content

Commit

Permalink
Gui: [skip ci] handle case if an absolute path to a qss file is set
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jun 18, 2020
1 parent 87c0365 commit e1cfaf1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Gui/DlgGeneralImp.cpp
Expand Up @@ -270,6 +270,24 @@ void DlgGeneralImp::loadSettings()

QString selectedStyleSheet = QString::fromLatin1(hGrp->GetASCII("StyleSheet").c_str());
index = ui->StyleSheets->findData(selectedStyleSheet);

// might be an absolute path name
if (index < 0 && !selectedStyleSheet.isEmpty()) {
QFileInfo fi(selectedStyleSheet);
if (fi.isAbsolute()) {
QString path = fi.absolutePath();
if (qssPaths.indexOf(path) >= 0) {
selectedStyleSheet = fi.fileName();
}
else {
selectedStyleSheet = fi.absoluteFilePath();
ui->StyleSheets->addItem(fi.baseName(), selectedStyleSheet);
}

index = ui->StyleSheets->findData(selectedStyleSheet);
}
}

if (index > -1) ui->StyleSheets->setCurrentIndex(index);
}

Expand Down

0 comments on commit e1cfaf1

Please sign in to comment.