Fix check if file can be opened read only.

This commit is contained in:
Florian Geyer 2012-04-28 19:35:52 +02:00 committed by Felix Geyer
parent 64170a16ab
commit 272da8c99c

View File

@ -85,13 +85,13 @@ void DatabaseTabWidget::openDatabase(const QString& fileName, const QString& pw,
// TODO error handling // TODO error handling
if (!file->open(QIODevice::ReadWrite)) { if (!file->open(QIODevice::ReadWrite)) {
if (!file->open(QIODevice::ReadOnly)) { if (!file->open(QIODevice::ReadOnly)) {
// can only open read-only
m_curDbStruct.readOnly = true;
}
else {
// can't open // can't open
return; return;
} }
else {
// can only open read-only
m_curDbStruct.readOnly = true;
}
} }
m_curDbStruct.file = file.take(); m_curDbStruct.file = file.take();