From c7d66cec06489aa20f6ccb0a0349d8897490f140 Mon Sep 17 00:00:00 2001 From: Itay Cohen Date: Tue, 21 Jan 2020 18:43:30 +0200 Subject: [PATCH] If available, set r2ghidra the default decompiler (#2007) * If available, set r2ghidra the default decompiler * Honor user preferences --- src/widgets/DecompilerWidget.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/widgets/DecompilerWidget.cpp b/src/widgets/DecompilerWidget.cpp index 95cc128b..4a523827 100644 --- a/src/widgets/DecompilerWidget.cpp +++ b/src/widgets/DecompilerWidget.cpp @@ -56,6 +56,11 @@ DecompilerWidget::DecompilerWidget(MainWindow *main, QAction *action) : auto decompilers = Core()->getDecompilers(); auto selectedDecompilerId = Config()->getSelectedDecompiler(); + if (selectedDecompilerId.isEmpty()) { + // If no decompiler was previously chosen. set r2ghidra as default decompiler + selectedDecompilerId = "r2ghidra"; + } + for (auto dec : decompilers) { ui->decompilerComboBox->addItem(dec->getName(), dec->getId()); if (dec->getId() == selectedDecompilerId) {