Use same 'force' logic sequence for sqlite and other dbs

This commit is contained in:
Geert Janssens
2018-07-06 22:32:01 +02:00
parent 875781847a
commit 9d5712ef09

View File

@@ -405,7 +405,9 @@ GncDbiBackend<DbType::DBI_SQLITE>::session_begin(QofSession* session,
if (create && file_exists) if (create && file_exists)
{ {
if (!force) if (force)
g_unlink (filepath.c_str());
else
{ {
set_error (ERR_BACKEND_STORE_EXISTS); set_error (ERR_BACKEND_STORE_EXISTS);
auto msg = "Might clobber, no force"; auto msg = "Might clobber, no force";
@@ -413,8 +415,6 @@ GncDbiBackend<DbType::DBI_SQLITE>::session_begin(QofSession* session,
LEAVE("Error"); LEAVE("Error");
return; return;
} }
else
g_unlink (filepath.c_str());
} }
connect(nullptr); connect(nullptr);