summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2013-10-15 14:31:02 (GMT)
committerSwift Review <review@swift.im>2013-10-17 08:03:37 (GMT)
commit5f0eeca41f0559c5b416c78fd51445fd93cf61ff (patch)
treead4b7bb586385be7916213999dfb4248dae2c437 /Swift/QtUI/QtVCardWidget/QtVCardAddressLabelField.cpp
parent040ceccfc67ce41fdd836ae874da68e04e6ca944 (diff)
downloadswift-5f0eeca41f0559c5b416c78fd51445fd93cf61ff.zip
swift-5f0eeca41f0559c5b416c78fd51445fd93cf61ff.tar.bz2
VCard: Assert existence of field widgets instead of if-testing.
Change-Id: Ie92f4f1714b8fb6dc5c1e2729151c8e00c33215b License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swift/QtUI/QtVCardWidget/QtVCardAddressLabelField.cpp')
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardAddressLabelField.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardAddressLabelField.cpp b/Swift/QtUI/QtVCardWidget/QtVCardAddressLabelField.cpp
index 20f48b9..98e313f 100644
--- a/Swift/QtUI/QtVCardWidget/QtVCardAddressLabelField.cpp
+++ b/Swift/QtUI/QtVCardWidget/QtVCardAddressLabelField.cpp
@@ -81,17 +81,19 @@ VCard::AddressLabel QtVCardAddressLabelField::getAddressLabel() const {
}
void QtVCardAddressLabelField::handleEditibleChanged(bool isEditable) {
- if (addressLabelPlainTextEdit) {
- addressLabelPlainTextEdit->setReadOnly(!isEditable);
- addressLabelPlainTextEdit->setStyleSheet(isEditable ? "" : "QPlainTextEdit { background: transparent; }");
- }
-
- if (deliveryTypeLabel) {
- deliveryTypeLabel->setText(buttonGroup->checkedButton() == 0 ? "" : buttonGroup->checkedButton()->text());
- deliveryTypeLabel->setVisible(!isEditable);
- }
- if (domesticRadioButton) domesticRadioButton->setVisible(isEditable);
- if (internationalRadioButton) internationalRadioButton->setVisible(isEditable);
+ assert(addressLabelPlainTextEdit);
+ assert(deliveryTypeLabel);
+ assert(domesticRadioButton);
+ assert(internationalRadioButton);
+
+ addressLabelPlainTextEdit->setReadOnly(!isEditable);
+ addressLabelPlainTextEdit->setStyleSheet(isEditable ? "" : "QPlainTextEdit { background: transparent; }");
+
+ deliveryTypeLabel->setText(buttonGroup->checkedButton() == 0 ? "" : buttonGroup->checkedButton()->text());
+ deliveryTypeLabel->setVisible(!isEditable);
+
+ domesticRadioButton->setVisible(isEditable);
+ internationalRadioButton->setVisible(isEditable);
}
}