diff options
| author | Chris Adams <christopher.adams@nokia.com> | 2010-01-14 14:17:59 +1000 |
|---|---|---|
| committer | Chris Adams <christopher.adams@nokia.com> | 2010-01-14 14:17:59 +1000 |
| commit | 5523290d052480f8d34ba472bd47bfab3daa1be1 (patch) | |
| tree | 1d9abe2a92bb4b3e86d8358d35d9a7acfe23c017 /doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.cpp | |
| parent | 8a05e656cd3b9eedbfdfb4cc982dd17d12c81742 (diff) | |
Fix some documentation bugs (incl. snippet example code)
Diffstat (limited to 'doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.cpp')
| -rw-r--r-- | doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.cpp b/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.cpp index 571db656da..f140341f8c 100644 --- a/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.cpp +++ b/doc/src/snippets/qtcontactsdocsample/qtcontactsdocsample.cpp @@ -221,16 +221,16 @@ void detailSharing(QContactManager* cm) a.saveDetail(&newNumber); // since newNumber.key() == nnCopy.key(); /* Saving will cause overwrite */ - qDebug() << "Prior to saving nnCopy," << a.displayLabel() << "has" << a.details().count() << "details."; + qDebug() << "\tPrior to saving nnCopy," << a.displayLabel() << "has" << a.details().count() << "details."; a.saveDetail(&nnCopy); - qDebug() << "After saving nnCopy," << a.displayLabel() << "still has" << a.details().count() << "details."; + qDebug() << "\tAfter saving nnCopy," << a.displayLabel() << "still has" << a.details().count() << "details."; /* In order to save nnCopy as a new detail, we must reset its key */ nnCopy.resetKey(); - qDebug() << "The copy key is now" << nnCopy.key() << ", whereas the original key is" << newNumber.key(); - qDebug() << "Prior to saving (key reset) nnCopy," << a.displayLabel() << "has" << a.details().count() << "details."; + qDebug() << "\tThe copy key is now" << nnCopy.key() << ", whereas the original key is" << newNumber.key(); + qDebug() << "\tPrior to saving (key reset) nnCopy," << a.displayLabel() << "has" << a.details().count() << "details."; a.saveDetail(&nnCopy); - qDebug() << "After saving (key reset) nnCopy," << a.displayLabel() << "still has" << a.details().count() << "details."; + qDebug() << "\tAfter saving (key reset) nnCopy," << a.displayLabel() << "still has" << a.details().count() << "details."; a.removeDetail(&nnCopy); /* @@ -322,10 +322,12 @@ void RequestExample::performRequest() { // retrieve any contact whose first name is "Alice" QContactDetailFilter dfil; - dfil.setDetailDefinitionName(QContactName::DefinitionName, QContactName::FieldFirst); + dfil.setDetailDefinitionName(QContactName::DefinitionName, QContactName::FieldFirstName); dfil.setValue("Alice"); dfil.setMatchFlags(QContactFilter::MatchExactly); + // m_fetchRequest was created with m_fetchRequest = new QContactFetchRequest() in the ctor. + m_fetchRequest->setManager(this->m_manager); // m_manager is a QContactManager*. m_fetchRequest->setFilter(dfil); connect(m_fetchRequest, SIGNAL(progress(QContactFetchRequest*,bool)), this, SLOT(printContacts(QContactFetchRequest*,bool))); if (!m_fetchRequest->start()) { @@ -353,6 +355,7 @@ void RequestExample::printContacts(QContactFetchRequest* request, bool appendOnl // once we've finished retrieving results, stop processing events. if (request->state() == QContactAbstractRequest::FinishedState || request->state() == QContactAbstractRequest::CanceledState) { + qDebug() << "Finished displaying asynchronously retrieved contacts!"; QCoreApplication::exit(0); } } |
