This commit is contained in:
luisangelsm
2026-03-05 10:54:41 +01:00
parent d8678bcf95
commit a876f33902
14 changed files with 92 additions and 92 deletions

View File

@ -28,7 +28,7 @@ QString readSvg(const QString &resourcePath)
QFile in(resourcePath);
if (!in.open(QIODevice::ReadOnly | QIODevice::Text)) {
qWarning() << "Failed to open SVG resource:" << resourcePath;
return {};
return { };
}
QString svg = QString::fromUtf8(in.readAll());
@ -53,7 +53,7 @@ QString writeSvg(const QString &svg, const QString &resourcePath, const QString
QFile out(outPath);
if (!out.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) {
qWarning() << "Failed to write SVG:" << outPath;
return {};
return { };
}
out.write(svg.toUtf8());

View File

@ -14,23 +14,23 @@ struct RecolorOptions {
};
QString readSvg(const QString &resourcePath);
QString writeSvg(const QString &svg, const QString &resourcePath, const QString &themeName, const RecolorOptions &options = {});
QString writeSvg(const QString &svg, const QString &resourcePath, const QString &themeName, const RecolorOptions &options = { });
QString recolorSvgXML(QString &svg, const QString &placeHolder, const QColor &color);
QString recoloredSvgToThemeFile(const QString &resourcePath,
const QColor &color, // #f0f (magenta)
const QString &themeName,
const RecolorOptions &options = {});
const RecolorOptions &options = { });
QString recoloredSvgToThemeFile(const QString &resourcePath,
const QColor &color1, // #f0f (magenta)
const QColor &color2, // #0ff (cyan)
const QString &themeName,
const RecolorOptions &options = {});
const RecolorOptions &options = { });
QString recoloredSvgToThemeFile(const QString &resourcePath,
const QColor &color1, // #f0f (magenta)
const QColor &color2, // #0ff (cyan)
const QColor &color3, // #ff0 (yellow)
const QString &themeName,
const RecolorOptions &options = {});
const RecolorOptions &options = { });
#endif // ICON_UTILS_H

View File

@ -133,7 +133,7 @@ ThemeEditorDialog::ThemeEditorDialog(const QJsonObject &params, QWidget *parent)
tree->setUniformRowHeights(true);
tree->setAlternatingRowColors(true);
populate(nullptr, params, {});
populate(nullptr, params, { });
tree->expandAll();
connect(expandBtn, &QPushButton::clicked, tree, &QTreeWidget::expandAll);
@ -425,7 +425,7 @@ void ThemeEditorDialog::loadFromFile()
params = doc.object();
syncMetaFromParams();
tree->clear();
populate(nullptr, params, {});
populate(nullptr, params, { });
tree->expandAll();
emit themeJsonChanged(params);
}

View File

@ -59,7 +59,7 @@ Theme ThemeManager::themeFromId(const QString &id, ThemeVariant fallbackVariant)
return makeTheme(json);
}
return {};
return { };
}
void ThemeManager::resolveTheme()

View File

@ -50,7 +50,7 @@ QJsonObject ThemeRepository::loadThemeJson(const QString &themeId) const
if (u.id == themeId)
return readJsonFile(u.filePath);
return {};
return { };
}
QString ThemeRepository::saveUserTheme(QJsonObject themeJson)
@ -104,7 +104,7 @@ QString ThemeRepository::importThemeFromFile(const QString &filePath)
{
QJsonObject json = readJsonFile(filePath);
if (json.isEmpty())
return {};
return { };
// Force a new user id regardless of what the file contains
auto metaObj = json["meta"].toObject();
@ -189,13 +189,13 @@ QJsonObject ThemeRepository::readJsonFile(const QString &path)
{
QFile file(path);
if (!file.open(QIODevice::ReadOnly))
return {};
return { };
const QByteArray data = file.readAll();
QJsonParseError error;
const QJsonDocument doc = QJsonDocument::fromJson(data, &error);
if (error.error != QJsonParseError::NoError)
return {};
return { };
return doc.object();
}