summaryrefslogtreecommitdiffstats
path: root/examples/tutorials/addressbook-fr/part3/addressbook.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/tutorials/addressbook-fr/part3/addressbook.cpp')
-rw-r--r--examples/tutorials/addressbook-fr/part3/addressbook.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/tutorials/addressbook-fr/part3/addressbook.cpp b/examples/tutorials/addressbook-fr/part3/addressbook.cpp
index 840f52935b..2d182c55ba 100644
--- a/examples/tutorials/addressbook-fr/part3/addressbook.cpp
+++ b/examples/tutorials/addressbook-fr/part3/addressbook.cpp
@@ -122,9 +122,10 @@ void AddressBook::submitContact()
QString name = nameLine->text();
QString address = addressText->toPlainText();
- if (name == "" || address == "") {
+ if (name.isEmpty() || address.isEmpty()) {
QMessageBox::information(this, tr("Empty Field"),
tr("Please enter a name and address."));
+ return;
}
if (!contacts.contains(name)) {