summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLostDragonist <lost.dragonist@gmail.com>2019-09-17 00:08:11 -0500
committerLostDragonist <lost.dragonist@gmail.com>2019-09-17 00:08:11 -0500
commit1fec9da2d3b89710d508f79fee583187cf88f549 (patch)
treed9eed7ef120a0db10df53b125164caac35b7ae77 /src
parent11bf4499c05f960baf7f3d4c76303749d61318e3 (diff)
Automatically fill in the name of new executables
When the binary browse button is used to select a binary, this will use the binary name to fill in the executable name if the previous executable name stated with "New Executable".
Diffstat (limited to 'src')
-rw-r--r--src/editexecutablesdialog.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/editexecutablesdialog.cpp b/src/editexecutablesdialog.cpp
index 7823fadc..d7ae4e77 100644
--- a/src/editexecutablesdialog.cpp
+++ b/src/editexecutablesdialog.cpp
@@ -619,8 +619,9 @@ void EditExecutablesDialog::on_browseBinary_clicked()
ui->binary->setText(QDir::toNativeSeparators(binaryName));
}
- // setting title if currently empty
- if (ui->title->text().isEmpty()) {
+ // setting title if currently empty or some variation of "New Executable"
+ if (ui->title->text().isEmpty() ||
+ ui->title->text().startsWith("New Executable", Qt::CaseInsensitive)) {
const auto prefix = QFileInfo(binaryName).baseName();
const auto newTitle = m_executablesList.makeNonConflictingTitle(prefix);