diff --git a/src/contactgroupmodel.cpp b/src/contactgroupmodel.cpp index 31f713e..942fc40 100644 --- a/src/contactgroupmodel.cpp +++ b/src/contactgroupmodel.cpp @@ -144,7 +144,7 @@ void ContactGroupModelPrivate::setManager(GroupManager *m) emit q->contactGroupCreated(items[index]); } - qSort(items.begin(), items.end(), contactGroupSort); + std::sort(items.begin(), items.end(), contactGroupSort); } q->endResetModel(); diff --git a/src/conversationmodel.cpp b/src/conversationmodel.cpp index 642554b..2ee6957 100644 --- a/src/conversationmodel.cpp +++ b/src/conversationmodel.cpp @@ -71,7 +71,7 @@ void ConversationModelPrivate::groupsAddedSlot(const QList &/*groups*/) if (allGroups) q->getEvents(); else - q->getEvents(filterGroupIds.toList()); + q->getEvents(filterGroupIds.values()); } } @@ -93,7 +93,7 @@ void ConversationModelPrivate::groupsDeletedSlot(const QList &groupIds) if (allGroups) q->getEvents(); else - q->getEvents(filterGroupIds.toList()); + q->getEvents(filterGroupIds.values()); } } @@ -126,7 +126,7 @@ bool ConversationModelPrivate::acceptsEvent(const Event &event) const QSqlQuery ConversationModelPrivate::buildQuery() const { - QList groups = filterGroupIds.toList(); + QList groups = filterGroupIds.values(); QString q; int unionCount = 0; @@ -247,7 +247,7 @@ bool ConversationModel::setFilter(Event::EventType type, d->filterDirection = direction; if (!d->filterGroupIds.isEmpty()) { - return getEvents(d->filterGroupIds.toList()); + return getEvents(d->filterGroupIds.values()); } else if (d->allGroups) { return getEvents(); } diff --git a/src/draftsmodel.cpp b/src/draftsmodel.cpp index 9c02d55..485cd3f 100644 --- a/src/draftsmodel.cpp +++ b/src/draftsmodel.cpp @@ -55,7 +55,7 @@ DraftsModel::~DraftsModel() QList DraftsModel::filterGroups() const { Q_D(const DraftsModel); - return d->filterGroups.toList(); + return d->filterGroups.values(); } void DraftsModel::setFilterGroups(const QList &list) diff --git a/src/eventmodel_p.cpp b/src/eventmodel_p.cpp index bf66529..3fcd054 100644 --- a/src/eventmodel_p.cpp +++ b/src/eventmodel_p.cpp @@ -360,7 +360,7 @@ void EventModelPrivate::onDemandResolverFinished() resolvedRecipients.insert(*it); } - slotContactChanged(resolvedRecipients.toList()); + slotContactChanged(resolvedRecipients.values()); } void EventModelPrivate::modifyInModel(Event &event) diff --git a/src/groupmodel.cpp b/src/groupmodel.cpp index 978e207..953f6a0 100644 --- a/src/groupmodel.cpp +++ b/src/groupmodel.cpp @@ -94,7 +94,7 @@ void GroupModelPrivate::setManager(GroupManager *m) connect(manager, SIGNAL(groupsCommitted(QList,bool)), q, SIGNAL(groupsCommitted(QList,bool))); groups = manager->groups(); - qSort(groups.begin(), groups.end(), groupObjectSort); + std::sort(groups.begin(), groups.end(), groupObjectSort); } q->endResetModel(); diff --git a/src/recentcontactsmodel.cpp b/src/recentcontactsmodel.cpp index dcb8d6d..459cc69 100644 --- a/src/recentcontactsmodel.cpp +++ b/src/recentcontactsmodel.cpp @@ -271,8 +271,8 @@ void RecentContactsModelPrivate::prependEvents(QList events, bool resolve } // Remove the rows that have been made obsolete - QList removeIndices = removeSet.toList(); - qSort(removeIndices); + QList removeIndices = removeSet.values(); + std::sort(removeIndices.begin(), removeIndices.end()); int count; while ((count = removeIndices.count()) != 0) { diff --git a/src/recipient.cpp b/src/recipient.cpp index a656f70..8da8ac1 100644 --- a/src/recipient.cpp +++ b/src/recipient.cpp @@ -470,7 +470,7 @@ QList RecipientList::contactIds() const if (r.contactId() > 0) re.insert(r.contactId()); } - return re.toList(); + return re.values(); } QStringList RecipientList::remoteUids() const diff --git a/src/recipienteventmodel.cpp b/src/recipienteventmodel.cpp index 39a09d0..073608f 100644 --- a/src/recipienteventmodel.cpp +++ b/src/recipienteventmodel.cpp @@ -102,8 +102,6 @@ void RecipientEventModelPrivate::fetchEvents() void RecipientEventModelPrivate::fetcherFinished() { - Q_Q(RecipientEventModel); - // Our contact is now loaded in the cache if (m_contactId > 0) { m_recipients = RecipientList::fromContact(m_contactId); @@ -151,8 +149,6 @@ RecipientEventModel::~RecipientEventModel() void RecipientEventModel::setRecipients(const Recipient &recipient) { - Q_D(RecipientEventModel); - setRecipients(RecipientList() << recipient); } diff --git a/tests/common.cpp b/tests/common.cpp index 461f624..0a68b62 100644 --- a/tests/common.cpp +++ b/tests/common.cpp @@ -519,7 +519,7 @@ bool waitSignal(QSignalSpy &spy, int msec) if (!spy.isEmpty()) { return true; } - QTime timer; + QElapsedTimer timer; timer.start(); while (timer.elapsed() < msec && spy.isEmpty()) { QCoreApplication::sendPostedEvents(); @@ -539,7 +539,7 @@ void summarizeResults(const QString &className, QList ×, QFile *logFil timeList.append(QString::number(time)); } - qSort(times); + std::sort(times.begin(), times.end()); float median = 0.0; const int iterations(times.count()); if (iterations % 2 > 0) { diff --git a/tests/mem_eventmodel/mem_eventmodel.cpp b/tests/mem_eventmodel/mem_eventmodel.cpp index ec53979..3e95a29 100644 --- a/tests/mem_eventmodel/mem_eventmodel.cpp +++ b/tests/mem_eventmodel/mem_eventmodel.cpp @@ -41,7 +41,7 @@ Group group; static void waitWithDeletes(int msec) { - QTime timer; + QElapsedTimer timer; timer.start(); while (timer.elapsed() < msec) { QCoreApplication::sendPostedEvents(); diff --git a/tests/perf_callmodel/callmodelperftest.cpp b/tests/perf_callmodel/callmodelperftest.cpp index 6959714..2f6328b 100644 --- a/tests/perf_callmodel/callmodelperftest.cpp +++ b/tests/perf_callmodel/callmodelperftest.cpp @@ -201,7 +201,7 @@ void CallModelPerfTest::getEvents() fetchModel.setResolveContacts(resolve ? EventModel::ResolveImmediately : EventModel::DoNotResolve); fetchModel.setFilter(CallModel::SortByContact); - QTime time; + QElapsedTimer time; time.start(); bool result = fetchModel.getEvents(); diff --git a/tests/perf_conversationmodel/conversationmodelperftest.cpp b/tests/perf_conversationmodel/conversationmodelperftest.cpp index 8d651df..31b6d06 100644 --- a/tests/perf_conversationmodel/conversationmodelperftest.cpp +++ b/tests/perf_conversationmodel/conversationmodelperftest.cpp @@ -228,7 +228,7 @@ void ConversationModelPerfTest::getEvents() fetchModel.setChunkSize(limit); } - QTime time; + QElapsedTimer time; time.start(); bool result = fetchModel.getEvents(groupIds); QVERIFY(result); diff --git a/tests/perf_groupmodel/groupmodelperftest.cpp b/tests/perf_groupmodel/groupmodelperftest.cpp index bd34a84..a4e6c58 100644 --- a/tests/perf_groupmodel/groupmodelperftest.cpp +++ b/tests/perf_groupmodel/groupmodelperftest.cpp @@ -214,7 +214,7 @@ void GroupModelPerfTest::getGroups() fetchModel.setManager(&manager); - QTime time; + QElapsedTimer time; time.start(); bool result = fetchModel.getGroups(); QVERIFY(result); diff --git a/tests/perf_recentcontactsmodel/recentcontactsmodelperftest.cpp b/tests/perf_recentcontactsmodel/recentcontactsmodelperftest.cpp index a8a6ade..acde7cd 100644 --- a/tests/perf_recentcontactsmodel/recentcontactsmodelperftest.cpp +++ b/tests/perf_recentcontactsmodel/recentcontactsmodelperftest.cpp @@ -203,7 +203,7 @@ void RecentContactsModelPerfTest::getEvents() if (limit) fetchModel.setLimit(limit); - QTime time; + QElapsedTimer time; time.start(); bool result = fetchModel.getEvents(); diff --git a/tests/profile_callmodel/callmodelprofiletest.cpp b/tests/profile_callmodel/callmodelprofiletest.cpp index 4f005f5..d6be571 100644 --- a/tests/profile_callmodel/callmodelprofiletest.cpp +++ b/tests/profile_callmodel/callmodelprofiletest.cpp @@ -161,7 +161,7 @@ void CallModelProfileTest::execute() fetchModel.setResolveContacts(resolve ? EventModel::ResolveImmediately : EventModel::DoNotResolve); fetchModel.setFilter(CallModel::SortByContact); - QTime time; + QElapsedTimer time; time.start(); bool result = fetchModel.getEvents(); diff --git a/tests/profile_conversationmodel/conversationmodelprofiletest.cpp b/tests/profile_conversationmodel/conversationmodelprofiletest.cpp index 6330ede..72818b2 100644 --- a/tests/profile_conversationmodel/conversationmodelprofiletest.cpp +++ b/tests/profile_conversationmodel/conversationmodelprofiletest.cpp @@ -184,7 +184,7 @@ void ConversationModelProfileTest::execute() fetchModel.setChunkSize(limit); } - QTime time; + QElapsedTimer time; time.start(); bool result = fetchModel.getEvents(); QVERIFY(result); diff --git a/tests/profile_groupmodel/groupmodelprofiletest.cpp b/tests/profile_groupmodel/groupmodelprofiletest.cpp index 93fb90e..19745a1 100644 --- a/tests/profile_groupmodel/groupmodelprofiletest.cpp +++ b/tests/profile_groupmodel/groupmodelprofiletest.cpp @@ -169,7 +169,7 @@ void GroupModelProfileTest::execute() fetchModel.setManager(&manager); - QTime time; + QElapsedTimer time; time.start(); bool result = fetchModel.getGroups(); diff --git a/tests/profile_recentcontactsmodel/recentcontactsmodelprofiletest.cpp b/tests/profile_recentcontactsmodel/recentcontactsmodelprofiletest.cpp index 9c8da0f..84f3b92 100644 --- a/tests/profile_recentcontactsmodel/recentcontactsmodelprofiletest.cpp +++ b/tests/profile_recentcontactsmodel/recentcontactsmodelprofiletest.cpp @@ -173,7 +173,7 @@ void RecentContactsModelProfileTest::execute() RecentContactsModel fetchModel; fetchModel.setLimit(limit); - QTime time; + QElapsedTimer time; time.start(); bool result = fetchModel.getEvents(); diff --git a/tests/ut_groupmodel/groupmodeltest.cpp b/tests/ut_groupmodel/groupmodeltest.cpp index 2df3ea9..d182590 100644 --- a/tests/ut_groupmodel/groupmodeltest.cpp +++ b/tests/ut_groupmodel/groupmodeltest.cpp @@ -664,7 +664,7 @@ void GroupModelTest::streamingQuery() QList idsOrig; QList idsStream; - QTime timer; + int count = 0; int chunkSize = firstChunkSize; while (count < total) {