mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Pre-select current file in save as dialog.
This commit is contained in:
parent
4d8e9561a7
commit
d2712b2a95
@ -158,11 +158,13 @@ void DatabaseManager::saveDatabase(Database* db)
|
||||
|
||||
void DatabaseManager::saveDatabaseAs(Database* db)
|
||||
{
|
||||
DatabaseManagerStruct& dbStruct = m_dbList[db];
|
||||
QString oldFileName = QString();
|
||||
if (dbStruct.file)
|
||||
oldFileName = dbStruct.fileName;
|
||||
QString fileName = fileDialog()->getSaveFileName(m_window, tr("Save database as"),
|
||||
QString(), tr("KeePass 2 Database").append(" (*.kdbx)"));
|
||||
oldFileName, tr("KeePass 2 Database").append(" (*.kdbx)"));
|
||||
if (!fileName.isEmpty()) {
|
||||
DatabaseManagerStruct& dbStruct = m_dbList[db];
|
||||
|
||||
delete dbStruct.file;
|
||||
QScopedPointer<QFile> file(new QFile(fileName));
|
||||
// TODO error handling
|
||||
|
Loading…
Reference in New Issue
Block a user