summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnne Jan Brouwer <brouwer@annejan.com>2020-12-21 02:48:37 +0100
committerGitHub <noreply@github.com>2020-12-21 02:48:37 +0100
commit4f4e0c03357acc563f691a82ac4bbecdb08e4eab (patch)
treec42ff2c70c4689ba0b3da1aff399c3d4eb298cf8
parent7f437890d366f1315a9ad81db68f6b9cec560d06 (diff)
parent737a8c2f626740ccbbbe504fbc3fdc480fbc594f (diff)
Merge pull request #558 from ichthyosaurus/fix-520
Explicitly only remove ".gpg" when renaming files
-rw-r--r--src/mainwindow.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 5279610f..d792c6ed 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1018,7 +1018,10 @@ void MainWindow::renamePassword() {
bool ok;
QString file = getFile(ui->treeView->currentIndex(), false);
QString filePath = QFileInfo(file).path();
- QString fileName = QFileInfo(file).baseName();
+ QString fileName = QFileInfo(file).fileName();
+ if (fileName.endsWith(".gpg", Qt::CaseInsensitive))
+ fileName.chop(4);
+
QString newName =
QInputDialog::getText(this, tr("Rename file"), tr("Rename File To: "),
QLineEdit::Normal, fileName, &ok);