Improve File Dialog
* QFileDialog returns UNIX paths, even on Windows. This patch converts what QFileDialog returns to the native path format. * Improve const correctness * Avoid imposing file extension on Linux * This patch improves things like unneeded passes by values, missing const qualifiers, ugly copies because of variable reuse and consistency in variable names.
This commit is contained in:
committed by
Jonathan White
parent
c12fd369d9
commit
fccbb98b8e
@@ -1656,13 +1656,8 @@ bool DatabaseWidget::saveAs()
|
||||
oldFilePath = QDir::toNativeSeparators(config()->get("LastDir", QDir::homePath()).toString() + "/"
|
||||
+ tr("Passwords").append(".kdbx"));
|
||||
}
|
||||
QString newFilePath = fileDialog()->getSaveFileName(this,
|
||||
tr("Save database as"),
|
||||
oldFilePath,
|
||||
tr("KeePass 2 Database").append(" (*.kdbx)"),
|
||||
nullptr,
|
||||
nullptr,
|
||||
"kdbx");
|
||||
const QString newFilePath = fileDialog()->getSaveFileName(
|
||||
this, tr("Save database as"), oldFilePath, tr("KeePass 2 Database").append(" (*.kdbx)"), nullptr, nullptr);
|
||||
|
||||
if (!newFilePath.isEmpty()) {
|
||||
// Ensure we don't recurse back into this function
|
||||
|
||||
Reference in New Issue
Block a user