From 70b966dc0e0dd65f574538b8f09e0e36894fda7d Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Tue, 22 Oct 2019 23:27:39 -0500 Subject: 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". --- src/editexecutablesdialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/editexecutablesdialog.cpp') 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) { -- cgit v1.3.1