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:
parent
c856e37c5f
commit
7fc34bff78
@ -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]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user