diff options
author | Lukáš Lalinský <lalinsky@gmail.com> | 2009-04-07 18:42:40 +0200 |
---|---|---|
committer | Lukáš Lalinský <lalinsky@gmail.com> | 2009-04-07 18:42:40 +0200 |
commit | cd2fa6b503f08edfe0bff33aeb81235d66fb050f (patch) | |
tree | bc31f58b616e12ef0f9e8accf08f00ff9e9948d8 | |
parent | 93123b2cb3a1c3b9a15de7f5b34198dc6ebacc23 (diff) | |
download | dbmodel-cd2fa6b503f08edfe0bff33aeb81235d66fb050f.tar.gz dbmodel-cd2fa6b503f08edfe0bff33aeb81235d66fb050f.tar.bz2 |
Fix double updates of table properties
-rw-r--r-- | src/items/database/databasetableproperties.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/items/database/databasetableproperties.cpp b/src/items/database/databasetableproperties.cpp index 8bce7b5..1f54fe6 100644 --- a/src/items/database/databasetableproperties.cpp +++ b/src/items/database/databasetableproperties.cpp @@ -39,11 +39,13 @@ public: QPushButton *moveColumnUpButton; QPushButton *moveColumnDownButton; QtColorPicker *colorPicker; + bool ignoreUpdates; }; DatabaseTableProperties::DatabaseTableProperties(QWidget *parent) : DiagramItemProperties(parent), d(new PrivateData) { + d->ignoreUpdates = false; addPage(tr("&Table"), createTablePage()); addPage(tr("&Columns"), createColumnsPage()); } @@ -140,6 +142,8 @@ DatabaseTableProperties::switchCurrentItem(DiagramItem *oldItem, DiagramItem *) void DatabaseTableProperties::updateProperty(const QString &name, const QVariant &value) { + if (d->ignoreUpdates) + return; if (name == "name") { d->nameEdit->setText(value.toString()); } @@ -152,14 +156,18 @@ void DatabaseTableProperties::setTableName(const QString &name) { DatabaseTable *table = currentTable(); + d->ignoreUpdates = true; table->document()->undoStack()->push(new SetObjectPropertyCommand(table, "name", name)); + d->ignoreUpdates = false; } void DatabaseTableProperties::setTableColor(const QColor &color) { DatabaseTable *table = currentTable(); + d->ignoreUpdates = true; table->document()->undoStack()->push(new SetObjectPropertyCommand(table, "color", color)); + d->ignoreUpdates = false; } void |