From 50d5a10ff0d71c42212464491d5419b80105717e Mon Sep 17 00:00:00 2001 From: sniperbeamer Date: Sat, 20 Jun 2009 16:47:53 +0000 Subject: [PATCH] Another fix to stop incorrectly removing the lock file git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@321 b624d157-de02-0410-bad0-e51aec6abb33 --- src/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index a0861b4..ecc3464 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -473,7 +473,8 @@ bool KeepassMainWindow::openDatabase(QString filename,bool IsAuto){ setStateFileModified(static_cast(db)->hasPasswordEncodingChanged()); } else{ - QFile::remove(filename+".lock"); + if (!dbReadOnly && QFile::exists(filename+".lock")) + QFile::remove(filename+".lock"); setStatusBarMsg(StatusBarLoadingFailed); QString error=db->getError(); if(error.isEmpty())error=tr("Unknown error while loading database.");