From 7eb385b28df36d4b2c8d898448e8d6f9e194a4de Mon Sep 17 00:00:00 2001 From: Peinthor Rene Date: Sun, 24 Mar 2013 21:27:36 +0100 Subject: [PATCH] remove the defaultnewdata setting it is useless now --- src/MainWindow.cpp | 1 - src/PreferencesDialog.cpp | 6 ------ src/PreferencesDialog.ui | 38 ++++---------------------------------- src/sqlitedb.cpp | 5 ----- src/sqlitedb.h | 2 -- 5 files changed, 4 insertions(+), 48 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 2fdfade0..b29892d1 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -959,7 +959,6 @@ void MainWindow::openPreferences() PreferencesDialog dialog(this); if(dialog.exec()) { - db.setDefaultNewData(PreferencesDialog::getSettingsValue("db", "defaultnewdata").toString()); resetBrowser(); } } diff --git a/src/PreferencesDialog.cpp b/src/PreferencesDialog.cpp index d1c38015..9858ca2b 100644 --- a/src/PreferencesDialog.cpp +++ b/src/PreferencesDialog.cpp @@ -39,7 +39,6 @@ void PreferencesDialog::chooseLocation() void PreferencesDialog::loadSettings() { ui->encodingComboBox->setCurrentIndex(ui->encodingComboBox->findText(getSettingsValue("db", "defaultencoding").toString(), Qt::MatchFixedString)); - ui->defaultdataComboBox->setCurrentIndex(ui->defaultdataComboBox->findText(getSettingsValue("db", "defaultnewdata").toString(), Qt::MatchFixedString)); ui->locationEdit->setText(getSettingsValue("db", "defaultlocation").toString()); ui->foreignKeysCheckBox->setChecked(getSettingsValue("db", "foreignkeys").toBool()); } @@ -47,7 +46,6 @@ void PreferencesDialog::loadSettings() void PreferencesDialog::saveSettings() { setSettingsValue("db", "defaultencoding", ui->encodingComboBox->currentText()); - setSettingsValue("db", "defaultnewdata", ui->defaultdataComboBox->currentText()); setSettingsValue("db", "defaultlocation", ui->locationEdit->text()); setSettingsValue("db", "foreignkeys", ui->foreignKeysCheckBox->isChecked()); accept(); @@ -89,10 +87,6 @@ QVariant PreferencesDialog::getSettingsDefaultValue(const QString& group, const if(group == "db" && name == "defaultencoding") return "UTF-8"; - // db/defaultnewdata? - if(group == "db" && name == "defaultnewdata") - return "NULL"; - // db/defaultlocation? if(group == "db" && name == "defaultlocation") return QDir::homePath(); diff --git a/src/PreferencesDialog.ui b/src/PreferencesDialog.ui index f3f63e05..bdb42048 100644 --- a/src/PreferencesDialog.ui +++ b/src/PreferencesDialog.ui @@ -7,7 +7,7 @@ 0 0 492 - 147 + 135 @@ -47,35 +47,6 @@ - - - Default data for new records - - - defaultdataComboBox - - - - - - - - NULL - - - - - 0 - - - - - '' - - - - - Open databases with foreign keys enabled. @@ -88,14 +59,14 @@ - + enabled - + Default location @@ -105,7 +76,7 @@ - + @@ -139,7 +110,6 @@ encodingComboBox - defaultdataComboBox foreignKeysCheckBox locationEdit setLocationButton diff --git a/src/sqlitedb.cpp b/src/sqlitedb.cpp index 6e4903d9..483597d6 100644 --- a/src/sqlitedb.cpp +++ b/src/sqlitedb.cpp @@ -32,11 +32,6 @@ bool DBBrowserDB::getDirty() const return dirty; } -void DBBrowserDB::setDefaultNewData( const QString & data ) -{ - curNewData = data; -} - bool DBBrowserDB::open ( const QString & db) { bool ok=false; diff --git a/src/sqlitedb.h b/src/sqlitedb.h index 960a74c2..80ac6105 100644 --- a/src/sqlitedb.h +++ b/src/sqlitedb.h @@ -122,7 +122,6 @@ public: void setDirty(bool dirtyval); bool getDirty() const; void logSQL(const QString& statement, int msgtype); - void setDefaultNewData( const QString & data ); QString getPragma(const QString& pragma); bool setPragma(const QString& pragma, const QString& value); @@ -142,7 +141,6 @@ public: QString curBrowseTableName; QString lastErrorMessage; QString curDBFilename; - QString curNewData; MainWindow* mainWindow;