mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-01-05 18:45:55 -05:00
Enhance last used directory settings
* Use hash based storage for last used directories instead of a key/value for each type * Explicitly declare certain operations as sensitive and follow the "Remember Last Database" setting for those. * Introduce database backup directory location (close #6619)
This commit is contained in:
parent
5e68cd2fa2
commit
746276edea
13 changed files with 92 additions and 107 deletions
|
|
@ -19,12 +19,11 @@
|
|||
#include "EditWidgetIcons.h"
|
||||
#include "ui_EditWidgetIcons.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
|
||||
#include "core/Config.h"
|
||||
#include "core/Database.h"
|
||||
#include "core/Metadata.h"
|
||||
#include "core/Tools.h"
|
||||
#include "gui/FileDialog.h"
|
||||
#include "gui/IconModels.h"
|
||||
#ifdef WITH_XC_NETWORKING
|
||||
#include "gui/IconDownloader.h"
|
||||
|
|
@ -232,9 +231,9 @@ void EditWidgetIcons::addCustomIconFromFile()
|
|||
return;
|
||||
}
|
||||
|
||||
QString filter = QString("%1 (%2);;%3 (*)").arg(tr("Images"), Tools::imageReaderFilter(), tr("All files"));
|
||||
|
||||
auto filenames = QFileDialog::getOpenFileNames(this, tr("Select Image(s)"), "", filter);
|
||||
auto filter = QString("%1 (%2);;%3 (*)").arg(tr("Images"), Tools::imageReaderFilter(), tr("All files"));
|
||||
auto filenames =
|
||||
fileDialog()->getOpenFileNames(this, tr("Select Image(s)"), FileDialog::getLastDir("icons"), filter);
|
||||
if (!filenames.empty()) {
|
||||
QStringList errornames;
|
||||
int numexisting = 0;
|
||||
|
|
@ -250,6 +249,9 @@ void EditWidgetIcons::addCustomIconFromFile()
|
|||
}
|
||||
}
|
||||
|
||||
// Save last used directory using first image path
|
||||
FileDialog::saveLastDir("icons", filenames[0]);
|
||||
|
||||
int numloaded = filenames.size() - errornames.size() - numexisting;
|
||||
QString msg;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue