Fix editing encryption when using SQLCipher 4

It seems like we need to explicitly detach the newly encrypted database
when changing the encryption settings and using SQLCipher 4.

See issue #1829.
This commit is contained in:
Martin Kleusberg
2019-03-30 13:30:35 +01:00
parent dfa7e0d4d7
commit 2352943988

View File

@@ -3244,6 +3244,11 @@ void MainWindow::editEncryption()
if (ok)
ok = db.executeSQL(QString("PRAGMA sqlitebrowser_edit_encryption.user_version = %1;").arg(db.getPragma("user_version").toInt()), false, false);
// We need to detach the database before proceeding
qApp->processEvents();
if (ok)
ok = db.executeSQL("DETACH sqlitebrowser_edit_encryption;", false, false);
// Check for errors
qApp->processEvents();
if(ok)