2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Open theme editor for existing themes.

This commit is contained in:
John Preston
2019-09-05 08:18:21 +03:00
parent dd74f57a66
commit 03bdd80b2f
11 changed files with 111 additions and 91 deletions

View File

@@ -915,17 +915,12 @@ std::unique_ptr<Preview> PreviewFromFile(
auto result = std::make_unique<Preview>();
auto &object = result->object;
object.cloud = cloud;
if (cloud.documentId || filepath.isEmpty()) {
object.pathRelative = QString();
object.pathAbsolute = QString(kThemePathAbsoluteCloud);
} else {
object.pathRelative = filepath.isEmpty()
? QString()
: QDir().relativeFilePath(filepath);
object.pathAbsolute = filepath.isEmpty()
? QString()
: QFileInfo(filepath).absoluteFilePath();
}
object.pathRelative = filepath.isEmpty()
? QString()
: QDir().relativeFilePath(filepath);
object.pathAbsolute = filepath.isEmpty()
? QString()
: QFileInfo(filepath).absoluteFilePath();
if (bytes.isEmpty()) {
if (!LoadFromFile(filepath, &result->instance, &object.content)) {
return nullptr;