diff options
Diffstat (limited to 'utils/themeeditor/preferencesdialog.cpp')
-rw-r--r-- | utils/themeeditor/preferencesdialog.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/utils/themeeditor/preferencesdialog.cpp b/utils/themeeditor/preferencesdialog.cpp index 78f2ed7206..8cd9665779 100644 --- a/utils/themeeditor/preferencesdialog.cpp +++ b/utils/themeeditor/preferencesdialog.cpp | |||
@@ -165,7 +165,7 @@ void PreferencesDialog::setupUI() | |||
165 | 165 | ||
166 | void PreferencesDialog::colorClicked() | 166 | void PreferencesDialog::colorClicked() |
167 | { | 167 | { |
168 | QColor* toEdit = 0; | 168 | QColor* toEdit = 0, newColor; |
169 | 169 | ||
170 | if(QObject::sender() == ui->bgButton) | 170 | if(QObject::sender() == ui->bgButton) |
171 | toEdit = &bgColor; | 171 | toEdit = &bgColor; |
@@ -185,8 +185,12 @@ void PreferencesDialog::colorClicked() | |||
185 | if(!toEdit) | 185 | if(!toEdit) |
186 | return; | 186 | return; |
187 | 187 | ||
188 | *toEdit = QColorDialog::getColor(*toEdit, this); | 188 | newColor = QColorDialog::getColor(*toEdit, this); |
189 | setButtonColor(dynamic_cast<QPushButton*>(QObject::sender()), *toEdit); | 189 | if (newColor.isValid()) |
190 | { | ||
191 | *toEdit = newColor; | ||
192 | setButtonColor(dynamic_cast<QPushButton*>(QObject::sender()), *toEdit); | ||
193 | } | ||
190 | } | 194 | } |
191 | 195 | ||
192 | void PreferencesDialog::accept() | 196 | void PreferencesDialog::accept() |