From d5de0425299b8fba8b9a384075b12603538526b6 Mon Sep 17 00:00:00 2001 From: Steven Brudenell Date: Sun, 29 Mar 2020 11:11:26 -0800 Subject: [PATCH] Deactivate read-only mode for now. Fixes #803. Read-only mode isn't in a good state and is triggering bugs. We'll come up with a good design for read-only mode at a later time. --- src/core/Database.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/core/Database.cpp b/src/core/Database.cpp index e634cd75..49f83aa1 100644 --- a/src/core/Database.cpp +++ b/src/core/Database.cpp @@ -120,11 +120,14 @@ bool Database::open(const QString& filePath, QSharedPointer return false; } - if (!readOnly && !dbFile.open(QIODevice::ReadWrite)) { - readOnly = true; - } - - if (!dbFile.isOpen() && !dbFile.open(QIODevice::ReadOnly)) { + // Don't autodetect read-only mode, as it triggers an upstream bug. + // See https://github.com/keepassxreboot/keepassxc/issues/803 + // if (!readOnly && !dbFile.open(QIODevice::ReadWrite)) { + // readOnly = true; + // } + // + // if (!dbFile.isOpen() && !dbFile.open(QIODevice::ReadOnly)) { + if (!dbFile.open(QIODevice::ReadOnly)) { if (error) { *error = tr("Unable to open file %1.").arg(filePath); }