aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/constraints/tablepkanduniquepanel.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2018-07-27 23:54:15 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2018-07-27 23:54:15 -0400
commit6d3d39356473078c6b47e03b8a7616e4b34de928 (patch)
treefe5be2e6a08e4cfc73207746aba4c9fccfecfa10 /SQLiteStudio3/guiSQLiteStudio/constraints/tablepkanduniquepanel.cpp
parentf98e49169a40876bcf1df832de6e908d1b350193 (diff)
parentfeda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (diff)
Update upstream source from tag 'upstream/3.2.1+dfsg1'
Update to upstream version '3.2.1+dfsg1' with Debian dir 5ea0333565de4dc898c062cc0ff4ba1153e2c1e4
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/constraints/tablepkanduniquepanel.cpp')
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/constraints/tablepkanduniquepanel.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/constraints/tablepkanduniquepanel.cpp b/SQLiteStudio3/guiSQLiteStudio/constraints/tablepkanduniquepanel.cpp
index f2a0ada..7c1c359 100644
--- a/SQLiteStudio3/guiSQLiteStudio/constraints/tablepkanduniquepanel.cpp
+++ b/SQLiteStudio3/guiSQLiteStudio/constraints/tablepkanduniquepanel.cpp
@@ -71,6 +71,7 @@ void TablePrimaryKeyAndUniquePanel::buildColumn(SqliteCreateTable::Column* colum
int col = 0;
QCheckBox* check = new QCheckBox(column->name);
+ check->setProperty(UI_PROP_COLUMN, column->name);
columnsLayout->addWidget(check, row, col++);
columnSignalMapping->setMapping(check, row);
connect(check, SIGNAL(toggled(bool)), columnSignalMapping, SLOT(map()));
@@ -109,7 +110,7 @@ int TablePrimaryKeyAndUniquePanel::getColumnIndex(const QString& colName)
{
item = columnsLayout->itemAtPosition(i, 0)->widget();
cb = qobject_cast<QCheckBox*>(item);
- if (cb->text().compare(colName, Qt::CaseInsensitive) == 0)
+ if (cb->property(UI_PROP_COLUMN).toString().compare(colName, Qt::CaseInsensitive) == 0)
return i;
}
return -1;
@@ -190,7 +191,7 @@ void TablePrimaryKeyAndUniquePanel::storeConfiguration()
constr->onConflict = sqliteConflictAlgo(ui->conflictComboBox->currentText());
// Columns
- foreach (SqliteIndexedColumn* idxCol, constr->indexedColumns)
+ for (SqliteIndexedColumn* idxCol : constr->indexedColumns)
delete idxCol;
constr->indexedColumns.clear();
@@ -207,7 +208,7 @@ void TablePrimaryKeyAndUniquePanel::storeConfiguration()
if (!check->isChecked())
continue;
- name = check->text();
+ name = check->property(UI_PROP_COLUMN).toString();
if (constr->dialect == Dialect::Sqlite3)
{
@@ -256,7 +257,7 @@ void TablePrimaryKeyAndUniquePanel::readConstraint()
int idx;
QCheckBox* check = nullptr;
QComboBox* combo = nullptr;
- foreach (SqliteIndexedColumn* idxCol, constr->indexedColumns)
+ for (SqliteIndexedColumn* idxCol : constr->indexedColumns)
{
idx = getColumnIndex(idxCol->name);
if (idx < 0)
@@ -294,6 +295,6 @@ void TablePrimaryKeyAndUniquePanel::buildColumns()
SqliteCreateTable* createTable = dynamic_cast<SqliteCreateTable*>(constraint->parentStatement());
int row = 0;
- foreach (SqliteCreateTable::Column* column, createTable->columns)
+ for (SqliteCreateTable::Column* column : createTable->columns)
buildColumn(column, row++);
}