Replace eco Command with API (Fix #2751) (#2759)

This commit is contained in:
Florian Märkl 2021-09-14 18:59:04 +02:00 committed by GitHub
parent 80e4269ca3
commit 8fd35f2109
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

2
rizin

@ -1 +1 @@
Subproject commit 004edb899fe0a841ce4226c6b57c198c0baff402
Subproject commit 709a1814d8302fd3fd905fd60d4a3ee4510ad7c3

View File

@ -131,9 +131,10 @@ QJsonDocument ColorThemeWorker::getTheme(const QString &themeName) const
QString curr = Config()->getColorTheme();
if (themeName != curr) {
Core()->cmdRaw(QString("eco %1").arg(themeName));
RzCoreLocked core(Core());
rz_core_load_theme(core, themeName.toUtf8().constData());
theme = Core()->cmdj("ecj").object().toVariantMap();
Core()->cmdRaw(QString("eco %1").arg(curr));
rz_core_load_theme(core, curr.toUtf8().constData());
} else {
theme = Core()->cmdj("ecj").object().toVariantMap();
}

View File

@ -522,7 +522,7 @@ void Configuration::setColorTheme(const QString &theme)
Core()->cmdRaw("ecd");
s.setValue("theme", "default");
} else {
Core()->cmdRaw(QStringLiteral("eco %1").arg(theme));
rz_core_load_theme(Core()->core(), theme.toUtf8().constData());
s.setValue("theme", theme);
}