Skip to content

Commit

Permalink
Fix browse button crashing the client
Browse files Browse the repository at this point in the history
Fixed browse button crashing the client when no engine is selected on
engine setup.
  • Loading branch information
Hypnotoad90 committed Jul 6, 2016
1 parent 9dd0254 commit 0ad7098
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion RocketLauncher2.pro
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RC_ICONS = RocketLauncher2.ico

CONFIG += c++11

VERSION = 0.1.0.1
VERSION = 0.1.0.2
QMAKE_TARGET_COMPANY = Techpillar
QMAKE_TARGET_PRODUCT = RocketLauncher 2.0
QMAKE_TARGET_DESCRIPTION = Universal Doom Frontend
Expand Down
15 changes: 11 additions & 4 deletions enginesetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,17 @@ void RocketLauncher2::on_input_selEngName_returnPressed()

void RocketLauncher2::on_button_selEngBrowse_clicked()
{
QModelIndex index = ui->listbox_engines->selectionModel()->selectedIndexes()[0];
QString path = QFileDialog::getOpenFileName(this, "Locate executable.");
enginelist->setPathFromIndex(path, index);
ui->input_selEngPath->setText(path);
if (ui->listbox_engines->selectionModel()->selectedIndexes().size() > 0)
{
QModelIndex index = ui->listbox_engines->selectionModel()->selectedIndexes()[0];
QString path = QFileDialog::getOpenFileName(this, "Locate executable.");
enginelist->setPathFromIndex(path, index);
ui->input_selEngPath->setText(path);
}
else
{
QMessageBox::information(NULL, "Select engine first!", "Please select an engine from the listbox to the left first. If you wish to add a new engine, select 'Add Custom' or 'Detect from File' on the bottom left");
}
}


Expand Down

0 comments on commit 0ad7098

Please sign in to comment.