mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-30 03:16:42 -05:00
Improve handling of remote sync saving
* Fixes sporadic failures on gui tests on Windows * Corrects inability to write to temporary config file while running tests * Corrects errors when using MockRemoteProcess due to missing functions
This commit is contained in:
parent
9e64570e3a
commit
fcb32efd05
4 changed files with 21 additions and 6 deletions
|
|
@ -624,11 +624,13 @@ void Config::createTempFileInstance()
|
|||
if (m_instance) {
|
||||
delete m_instance;
|
||||
}
|
||||
auto* tmpFile = new QTemporaryFile();
|
||||
bool openResult = tmpFile->open();
|
||||
Q_ASSERT(openResult);
|
||||
Q_UNUSED(openResult);
|
||||
m_instance = new Config(tmpFile->fileName(), "", qApp);
|
||||
auto tmpFileName = QString("%1/%2_settings.XXXXXX").arg(QDir::tempPath(), QCoreApplication::applicationName());
|
||||
auto tmpFile = new QTemporaryFile(tmpFileName);
|
||||
if (!tmpFile->open()) {
|
||||
Q_ASSERT_X(false, __func__, "Failed to create temporary config settings file");
|
||||
}
|
||||
tmpFile->close();
|
||||
m_instance = new Config(tmpFileName, "", qApp);
|
||||
tmpFile->setParent(m_instance);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1426,7 +1426,7 @@ bool DatabaseWidget::syncWithDatabase(const QSharedPointer<Database>& otherDb, Q
|
|||
|
||||
if (!changeList.isEmpty()) {
|
||||
// Save synced databases
|
||||
if (!m_db->save(Database::Atomic, {}, &error)) {
|
||||
if (!save()) {
|
||||
error = tr("Error while saving database %1: %2").arg(m_db->filePath(), error);
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue