mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Also set foreign key preferences when creating a new database
When opening a database we set the foreign key constraint checking according to the preferences set in the Preferences Dialog. But when creating a new database this wasn't done accordingly which means the behaviour of the application is different depending on wether a database was opened or newly created. This is changed by this commit.
This commit is contained in:
@@ -321,6 +321,12 @@ bool DBBrowserDB::create ( const QString & db)
|
||||
|
||||
if (_db)
|
||||
{
|
||||
// set preference defaults
|
||||
QSettings settings(QApplication::organizationName(), QApplication::organizationName());
|
||||
settings.sync();
|
||||
bool foreignkeys = settings.value( "/db/foreignkeys", false ).toBool();
|
||||
setPragma("foreign_keys", foreignkeys ? "1" : "0");
|
||||
|
||||
// Enable extension loading
|
||||
sqlite3_enable_load_extension(_db, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user