MCPcopy Create free account
hub / github.com/RGAA-Software/GoDesk / parseThemeFile

Method parseThemeFile

src/theme/QtAdvancedStylesheet.cpp:555–576  ·  view source on GitHub ↗

============================================================================

Source from the content-addressed store, hash-verified

553
554//============================================================================
555bool QtAdvancedStylesheetPrivate::parseThemeFile(const QString& Theme)
556{
557 QString ThemeFileName = _this->path(QtAdvancedStylesheet::ThemesLocation) + "/" + Theme;
558 QFile ThemeFile(ThemeFileName);
559 ThemeFile.open(QIODevice::ReadOnly);
560 QXmlStreamReader s(&ThemeFile);
561 s.readNextStartElement();
562 if (s.name() != QString("resources"))
563 {
564 setError(QtAdvancedStylesheet::ThemeXmlError, "Malformed theme file - "
565 "expected tag <resources> instead of " + s.name().toString());
566 return false;
567 }
568
569 IsDarkTheme = (s.attributes().value("dark").toInt() == 1);
570 QMap<QString, QString> ColorVariables;
571 parseVariablesFromXml(s, "color", ColorVariables);
572 this->ThemeVariables = this->StyleVariables;
573 insertIntoMap(this->ThemeVariables, ColorVariables);
574 this->ThemeColors = ColorVariables;
575 return true;
576}
577
578
579//============================================================================

Callers 1

setCurrentThemeMethod · 0.80

Calls 2

insertIntoMapFunction · 0.85
pathMethod · 0.80

Tested by

no test coverage detected