| 1104 | } |
| 1105 | |
| 1106 | void ChatBackground::keepApplied(const Object &object, bool write) { |
| 1107 | setThemeObject(object); |
| 1108 | if (Data::details::IsTestingEditorWallPaper(_paper)) { |
| 1109 | setPaper(Data::CustomWallPaper()); |
| 1110 | _themeImage = QImage(); |
| 1111 | _themeTile = false; |
| 1112 | if (write) { |
| 1113 | writeNewBackgroundSettings(); |
| 1114 | } |
| 1115 | } else if (Data::details::IsTestingThemeWallPaper(_paper)) { |
| 1116 | setPaper(Data::ThemeWallPaper()); |
| 1117 | _themeImage = postprocessBackgroundImage(base::duplicate(_original)); |
| 1118 | _themeTile = tile(); |
| 1119 | if (write) { |
| 1120 | writeNewBackgroundSettings(); |
| 1121 | } |
| 1122 | } else if (Data::details::IsTestingDefaultWallPaper(_paper)) { |
| 1123 | setPaper(Data::DefaultWallPaper()); |
| 1124 | _themeImage = QImage(); |
| 1125 | _themeTile = false; |
| 1126 | if (write) { |
| 1127 | writeNewBackgroundSettings(); |
| 1128 | } |
| 1129 | } |
| 1130 | _updates.fire({ BackgroundUpdate::Type::ApplyingTheme, tile() }); |
| 1131 | } |
| 1132 | |
| 1133 | bool ChatBackground::isNonDefaultThemeOrBackground() { |
| 1134 | initialRead(); |
no test coverage detected