mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-21 05:58:44 -04:00
Normalize path (slashes to be precise) when opening a database or saving the last used database paths (#7864)
Fixes #7821
This commit is contained in:
parent
5916a8f8dd
commit
692c95b11e
2 changed files with 4 additions and 2 deletions
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
|
@ -1388,7 +1389,7 @@ bool MainWindow::saveLastDatabases()
|
||||||
QStringList openDatabases;
|
QStringList openDatabases;
|
||||||
for (int i = 0; i < m_ui->tabWidget->count(); ++i) {
|
for (int i = 0; i < m_ui->tabWidget->count(); ++i) {
|
||||||
auto dbWidget = m_ui->tabWidget->databaseWidgetFromIndex(i);
|
auto dbWidget = m_ui->tabWidget->databaseWidgetFromIndex(i);
|
||||||
openDatabases.append(dbWidget->database()->filePath());
|
openDatabases.append(QDir::toNativeSeparators(dbWidget->database()->filePath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
config()->set(Config::LastOpenedDatabases, openDatabases);
|
config()->set(Config::LastOpenedDatabases, openDatabases);
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QWindow>
|
#include <QWindow>
|
||||||
|
|
||||||
|
@ -180,7 +181,7 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!filename.isEmpty() && QFile::exists(filename) && !filename.endsWith(".json", Qt::CaseInsensitive)) {
|
if (!filename.isEmpty() && QFile::exists(filename) && !filename.endsWith(".json", Qt::CaseInsensitive)) {
|
||||||
mainWindow.openDatabase(filename, password, parser.value(keyfileOption));
|
mainWindow.openDatabase(QDir::toNativeSeparators(filename), password, parser.value(keyfileOption));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue