summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@nokia.com>2010-06-04 16:37:00 (GMT)
committerRobert Loehning <robert.loehning@nokia.com>2010-06-04 16:42:22 (GMT)
commit2b4d2fd1ada524f4780dd7633ca34bc72d823ff1 (patch)
treeb54e86be77665a608df2f57f304f0c48d3ba993a /examples
parentcd8a6d6836f04f66d3e7083c97f7873240afa433 (diff)
downloadQt-2b4d2fd1ada524f4780dd7633ca34bc72d823ff1.zip
Qt-2b4d2fd1ada524f4780dd7633ca34bc72d823ff1.tar.gz
Qt-2b4d2fd1ada524f4780dd7633ca34bc72d823ff1.tar.bz2
Fix in Addressbook tutorial
Don't add if name or address is empty. Reviewed-by: Alessandro Portale
Diffstat (limited to 'examples')
-rw-r--r--examples/tutorials/addressbook/part3/addressbook.cpp1
-rw-r--r--examples/tutorials/addressbook/part4/addressbook.cpp1
-rw-r--r--examples/tutorials/addressbook/part5/addressbook.cpp1
-rw-r--r--examples/tutorials/addressbook/part6/addressbook.cpp1
-rw-r--r--examples/tutorials/addressbook/part7/addressbook.cpp1
5 files changed, 5 insertions, 0 deletions
diff --git a/examples/tutorials/addressbook/part3/addressbook.cpp b/examples/tutorials/addressbook/part3/addressbook.cpp
index adb87ef..28a570a 100644
--- a/examples/tutorials/addressbook/part3/addressbook.cpp
+++ b/examples/tutorials/addressbook/part3/addressbook.cpp
@@ -125,6 +125,7 @@ void AddressBook::submitContact()
if (name == "" || address == "") {
QMessageBox::information(this, tr("Empty Field"),
tr("Please enter a name and address."));
+ return;
}
if (!contacts.contains(name)) {
diff --git a/examples/tutorials/addressbook/part4/addressbook.cpp b/examples/tutorials/addressbook/part4/addressbook.cpp
index 1b7a6c4..55d551f 100644
--- a/examples/tutorials/addressbook/part4/addressbook.cpp
+++ b/examples/tutorials/addressbook/part4/addressbook.cpp
@@ -134,6 +134,7 @@ void AddressBook::submitContact()
if (name == "" || address == "") {
QMessageBox::information(this, tr("Empty Field"),
tr("Please enter a name and address."));
+ return;
}
//! [submitContact() function part1]
if (currentMode == AddingMode) {
diff --git a/examples/tutorials/addressbook/part5/addressbook.cpp b/examples/tutorials/addressbook/part5/addressbook.cpp
index 80c18c3..1b3f451 100644
--- a/examples/tutorials/addressbook/part5/addressbook.cpp
+++ b/examples/tutorials/addressbook/part5/addressbook.cpp
@@ -141,6 +141,7 @@ void AddressBook::submitContact()
if (name == "" || address == "") {
QMessageBox::information(this, tr("Empty Field"),
tr("Please enter a name and address."));
+ return;
}
if (currentMode == AddingMode) {
diff --git a/examples/tutorials/addressbook/part6/addressbook.cpp b/examples/tutorials/addressbook/part6/addressbook.cpp
index fc41190..724971c 100644
--- a/examples/tutorials/addressbook/part6/addressbook.cpp
+++ b/examples/tutorials/addressbook/part6/addressbook.cpp
@@ -147,6 +147,7 @@ void AddressBook::submitContact()
if (name == "" || address == "") {
QMessageBox::information(this, tr("Empty Field"),
tr("Please enter a name and address."));
+ return;
}
if (currentMode == AddingMode) {
diff --git a/examples/tutorials/addressbook/part7/addressbook.cpp b/examples/tutorials/addressbook/part7/addressbook.cpp
index 3ab8702..bf00298 100644
--- a/examples/tutorials/addressbook/part7/addressbook.cpp
+++ b/examples/tutorials/addressbook/part7/addressbook.cpp
@@ -149,6 +149,7 @@ void AddressBook::submitContact()
if (name == "" || address == "") {
QMessageBox::information(this, tr("Empty Field"),
tr("Please enter a name and address."));
+ return;
}
if (currentMode == AddingMode) {