Call clear() instead of empty() in addressbook/part6 tutorial.

empty() doesn't remove elements, it just returns whether it is empty.

Task-number: QTBUG-8849
Change-Id: I9bb8e855d96cecd2a0df336cb46e308ddedf0d07
Reviewed-by: Michalina Ziemba <michalina.ziemba@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Mitch Curtis 2012-08-08 13:48:07 +02:00 committed by Qt by Nokia
parent c856e37c5f
commit 7fc34bff78

View File

@ -373,7 +373,7 @@ void AddressBook::loadFromFile()
QDataStream in(&file);
in.setVersion(QDataStream::Qt_4_5);
contacts.empty(); // empty existing contacts
contacts.clear(); // clear existing contacts
in >> contacts;
//! [loadFromFile() function part2]