If available, set r2ghidra the default decompiler (#2007)

* If available, set r2ghidra the default decompiler
* Honor user preferences
This commit is contained in:
Itay Cohen 2020-01-21 18:43:30 +02:00 committed by GitHub
parent 1c39aa6d41
commit c7d66cec06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {