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/QtVCardInternetEMailField.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/QtVCardInternetEMailField.cpp')
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardInternetEMailField.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardInternetEMailField.cpp b/Swift/QtUI/QtVCardWidget/QtVCardInternetEMailField.cpp
index b946fc4..e6f8298 100644
--- a/Swift/QtUI/QtVCardWidget/QtVCardInternetEMailField.cpp
+++ b/Swift/QtUI/QtVCardWidget/QtVCardInternetEMailField.cpp
@@ -66,15 +66,16 @@ VCard::EMailAddress QtVCardInternetEMailField::getInternetEMailAddress() const {
}
void QtVCardInternetEMailField::handleEditibleChanged(bool isEditable) {
+ assert(emailLineEdit);
+ assert(emailLabel);
+
if (isEditable) {
- if (emailLineEdit) emailLineEdit->show();
- if (emailLabel) emailLabel->hide();
+ emailLineEdit->show();
+ emailLabel->hide();
} else {
- if (emailLineEdit) emailLineEdit->hide();
- if (emailLabel) {
- emailLabel->setText(QString("<a href=\"mailto:%1\">%1</a>").arg(QtUtilities::htmlEscape(emailLineEdit->text())));
- emailLabel->show();
- }
+ emailLineEdit->hide();
+ emailLabel->setText(QString("<a href=\"mailto:%1\">%1</a>").arg(QtUtilities::htmlEscape(emailLineEdit->text())));
+ emailLabel->show();
}
}