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/QtVCardURLField.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/QtVCardURLField.cpp')
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardURLField.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardURLField.cpp b/Swift/QtUI/QtVCardWidget/QtVCardURLField.cpp
index 35cc4ce..b39eeaa 100644
--- a/Swift/QtUI/QtVCardWidget/QtVCardURLField.cpp
+++ b/Swift/QtUI/QtVCardWidget/QtVCardURLField.cpp
@@ -55,15 +55,16 @@ std::string QtVCardURLField::getURL() const {
}
void QtVCardURLField::handleEditibleChanged(bool isEditable) {
+ assert(urlLineEdit);
+ assert(urlLabel);
+
if (isEditable) {
- if (urlLineEdit) urlLineEdit->show();
- if (urlLabel) urlLabel->hide();
+ urlLineEdit->show();
+ urlLabel->hide();
} else {
- if (urlLineEdit) urlLineEdit->hide();
- if (urlLabel) {
- urlLabel->setText(QString("<a href=\"%1\">%1</a>").arg(QtUtilities::htmlEscape(urlLineEdit->text())));
- urlLabel->show();
- }
+ urlLineEdit->hide();
+ urlLabel->setText(QString("<a href=\"%1\">%1</a>").arg(QtUtilities::htmlEscape(urlLineEdit->text())));
+ urlLabel->show();
}
}