Using c_str() on volatile string broke applying qss style sheet

This commit is contained in:
Jean-Francois Dockes 2020-04-21 13:52:29 +02:00
parent 058cec8466
commit 9670bb8ecf

View File

@ -159,9 +159,9 @@ static void recollCleanup()
void applyStyleSheet(const QString& ssfname)
{
const char *cfname = qs2path(ssfname).c_str();
const std::string cfname = qs2path(ssfname);
LOGDEB0("Applying style sheet: [" << cfname << "]\n");
if (*cfname) {
if (!cfname.empty()) {
string stylesheet;
file_to_string(cfname, stylesheet);
qApp->setStyleSheet(QString::fromUtf8(stylesheet.c_str()));