diff options
Diffstat (limited to 'examples/tutorials/addressbook-fr/part6/addressbook.cpp')
-rw-r--r-- | examples/tutorials/addressbook-fr/part6/addressbook.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/tutorials/addressbook-fr/part6/addressbook.cpp b/examples/tutorials/addressbook-fr/part6/addressbook.cpp index fc41190..7c57db7 100644 --- a/examples/tutorials/addressbook-fr/part6/addressbook.cpp +++ b/examples/tutorials/addressbook-fr/part6/addressbook.cpp @@ -144,9 +144,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 (currentMode == AddingMode) { |