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.
This commit is contained in:
Steven Brudenell 2020-03-29 11:11:26 -08:00 committed by Jonathan White
parent 49487f9d4a
commit d5de042529

View File

@ -120,11 +120,14 @@ bool Database::open(const QString& filePath, QSharedPointer<const CompositeKey>
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);
}