added /usr/local to search path for the stylesheet

lv2
Roeland Jansen 2021-07-29 10:53:57 +02:00
rodzic 3f1fc957ac
commit 7992d6f870
1 zmienionych plików z 14 dodań i 2 usunięć

Wyświetl plik

@ -2225,11 +2225,11 @@ void wfmain::setAppTheme(bool isCustom)
QFile f(":"+prefs.stylesheetPath); // built-in resource
#else
QFile f("/usr/share/wfview/stylesheets/" + prefs.stylesheetPath);
QFile g("/usr/local/share/wfview/stylesheets/" + prefs.stylesheetPath);
#endif
if (!f.exists())
{
printf("Unable to set stylesheet, file not found\n");
printf("Tried to load: [%s]\n", QString( QString("/usr/share/wfview/stylesheets/") + prefs.stylesheetPath).toStdString().c_str() );
printf("Unable to set stylesheet, file not found or permission issue [%s]\n", QString( QString("/usr/share/wfview/stylesheets/") + prefs.stylesheetPath).toStdString().c_str() );
}
else
{
@ -2237,6 +2237,18 @@ void wfmain::setAppTheme(bool isCustom)
QTextStream ts(&f);
qApp->setStyleSheet(ts.readAll());
}
if (!g.exists())
{
printf("Unable to set stylesheet, file not found or permisson issue [%s]\n", QString( QString("/usr/local/share/wfview/stylesheets/") + prefs.stylesheetPath).toStdString().c_str() );
}
else
{
g.open(QFile::ReadOnly | QFile::Text);
QTextStream ts(&g);
qApp->setStyleSheet(ts.readAll());
}
} else {
qApp->setStyleSheet("");
}