summaryrefslogtreecommitdiff
path: root/src/editexecutablesdialog.cpp
diff options
context:
space:
mode:
authorLostDragonist <lost.dragonist@gmail.com>2019-10-22 23:27:39 -0500
committerLostDragonist <lost.dragonist@gmail.com>2019-10-22 23:32:28 -0500
commit70b966dc0e0dd65f574538b8f09e0e36894fda7d (patch)
tree43177c09e56d82879b04bce0f2ac3b921e239aa0 /src/editexecutablesdialog.cpp
parent741893c735cda3cbd261e6535450641f99c9f0f7 (diff)
Improve automatic naming of new executables
When using the "Add from file..." option, the extension will be removed. E.g., "zEdit 1.2.3.exe" will be shortened to "zEdit 1.2.3". When using the "Add empty" option and subsequently browsing for a binary, the complete base name will be used instead of just the base name. E.g., "zEdit 1.2.3.exe" will be shorted to "zEdit 1.2.3" instead of "zEdit 1". When using the "Add as Executable" option of the data tab, the complete base name will be used instead of just the base name. E.g., "zEdit 1.2.3.exe" will be shorted to "zEdit 1.2.3" instead of "zEdit 1".
Diffstat (limited to 'src/editexecutablesdialog.cpp')
-rw-r--r--src/editexecutablesdialog.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/editexecutablesdialog.cpp b/src/editexecutablesdialog.cpp
index c6c90c3f..8535b7a7 100644
--- a/src/editexecutablesdialog.cpp
+++ b/src/editexecutablesdialog.cpp
@@ -677,7 +677,7 @@ void EditExecutablesDialog::addFromFile()
return;
}
- addNew(Executable(binary.fileName()));
+ addNew(Executable(binary.completeBaseName()));
setBinary(binary);
}
@@ -726,7 +726,7 @@ void EditExecutablesDialog::setBinary(const QFileInfo& binary)
// setting title if some variation of "New Executable"
if (ui->title->text().startsWith(tr("New Executable"), Qt::CaseInsensitive)) {
- const auto prefix = binary.baseName();
+ const auto prefix = binary.completeBaseName();
const auto newTitle = m_executablesList.makeNonConflictingTitle(prefix);
if (newTitle) {