============================================================================
| 553 | |
| 554 | //============================================================================ |
| 555 | bool 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 | //============================================================================ |
no test coverage detected