Fix CutterCore::getBinPluginDescriptions() args (#2777)

This commit is contained in:
Florian Märkl 2021-09-24 10:16:35 +02:00 committed by GitHub
parent 01dc1c2337
commit 9ddc19fcc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 20 deletions

View File

@ -2731,11 +2731,12 @@ QStringList CutterCore::getAnalysisPluginNames()
return ret;
}
QList<RzBinPluginDescription> CutterCore::getRBinPluginDescriptions(const QString &type)
QList<RzBinPluginDescription> CutterCore::getBinPluginDescriptions(bool bin, bool xtr)
{
CORE_LOCK();
QList<RzBinPluginDescription> ret;
RzListIter *it;
if (bin) {
RzBinPlugin *bp;
CutterRzListForeach (core->bin->plugins, it, RzBinPlugin, bp) {
RzBinPluginDescription desc;
@ -2745,6 +2746,8 @@ QList<RzBinPluginDescription> CutterCore::getRBinPluginDescriptions(const QStrin
desc.type = "bin";
ret.append(desc);
}
}
if (xtr) {
RzBinXtrPlugin *bx;
CutterRzListForeach (core->bin->binxtrs, it, RzBinXtrPlugin, bx) {
RzBinPluginDescription desc;
@ -2754,6 +2757,7 @@ QList<RzBinPluginDescription> CutterCore::getRBinPluginDescriptions(const QStrin
desc.type = "xtr";
ret.append(desc);
}
}
return ret;
}

View File

@ -534,7 +534,7 @@ public:
QStringList getAnalysisPluginNames();
/* Widgets */
QList<RzBinPluginDescription> getRBinPluginDescriptions(const QString &type = QString());
QList<RzBinPluginDescription> getBinPluginDescriptions(bool bin = true, bool xtr = true);
QList<RzIOPluginDescription> getRIOPluginDescriptions();
QList<RzCorePluginDescription> getRCorePluginDescriptions();
QList<RzAsmPluginDescription> getRAsmPluginDescriptions();

View File

@ -47,7 +47,7 @@ InitialOptionsDialog::InitialOptionsDialog(MainWindow *main)
setTooltipWithConfigHelp(ui->kernelComboBox, "asm.os");
setTooltipWithConfigHelp(ui->bitsComboBox, "asm.bits");
for (const auto &plugin : core->getRBinPluginDescriptions("bin")) {
for (const auto &plugin : core->getBinPluginDescriptions(true, false)) {
ui->formatComboBox->addItem(plugin.name, QVariant::fromValue(plugin));
}

View File

@ -10,7 +10,7 @@ RizinPluginsDialog::RizinPluginsDialog(QWidget *parent)
{
ui->setupUi(this);
for (const auto &plugin : Core()->getRBinPluginDescriptions()) {
for (const auto &plugin : Core()->getBinPluginDescriptions()) {
QTreeWidgetItem *item = new QTreeWidgetItem();
item->setText(0, plugin.name);
item->setText(1, plugin.description);