remove the defaultnewdata setting

it is useless now
This commit is contained in:
Peinthor Rene
2013-03-24 21:27:36 +01:00
parent d7d6a861b2
commit 7eb385b28d
5 changed files with 4 additions and 48 deletions

View File

@@ -959,7 +959,6 @@ void MainWindow::openPreferences()
PreferencesDialog dialog(this);
if(dialog.exec())
{
db.setDefaultNewData(PreferencesDialog::getSettingsValue("db", "defaultnewdata").toString());
resetBrowser();
}
}

View File

@@ -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();

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>492</width>
<height>147</height>
<height>135</height>
</rect>
</property>
<property name="windowTitle">
@@ -47,35 +47,6 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Default data for new records</string>
</property>
<property name="buddy">
<cstring>defaultdataComboBox</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="defaultdataComboBox">
<item>
<property name="text">
<string>NULL</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
<item>
<property name="text">
<string>''</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="toolTip">
<string>Open databases with foreign keys enabled.</string>
@@ -88,14 +59,14 @@
</property>
</widget>
</item>
<item row="2" column="1">
<item row="1" column="1">
<widget class="QCheckBox" name="foreignKeysCheckBox">
<property name="text">
<string>enabled</string>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Default location</string>
@@ -105,7 +76,7 @@
</property>
</widget>
</item>
<item row="3" column="1">
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="locationEdit">
@@ -139,7 +110,6 @@
</widget>
<tabstops>
<tabstop>encodingComboBox</tabstop>
<tabstop>defaultdataComboBox</tabstop>
<tabstop>foreignKeysCheckBox</tabstop>
<tabstop>locationEdit</tabstop>
<tabstop>setLocationButton</tabstop>

View File

@@ -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;

View File

@@ -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;