diff options
| author | LostDragonist <lost.dragonist@gmail.com> | 2019-10-22 23:27:39 -0500 |
|---|---|---|
| committer | LostDragonist <lost.dragonist@gmail.com> | 2019-10-22 23:32:28 -0500 |
| commit | 70b966dc0e0dd65f574538b8f09e0e36894fda7d (patch) | |
| tree | 43177c09e56d82879b04bce0f2ac3b921e239aa0 /src | |
| parent | 741893c735cda3cbd261e6535450641f99c9f0f7 (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')
| -rw-r--r-- | src/editexecutablesdialog.cpp | 4 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 2 |
2 files changed, 3 insertions, 3 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) { diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 177c2a23..12ed40b3 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -5329,7 +5329,7 @@ void MainWindow::addAsExecutable() case FileExecutionTypes::Executable: { QString name = QInputDialog::getText(this, tr("Enter Name"), tr("Please enter a name for the executable"), QLineEdit::Normal, - targetInfo.baseName()); + targetInfo.completeBaseName()); if (!name.isEmpty()) { //Note: If this already exists, you'll lose custom settings |
