Commit 334caecd authored by neochapay's avatar neochapay Committed by pvuorela

Fix warnings and API for new Qt

parent 9fe0cd4d
......@@ -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();
......
......@@ -71,7 +71,7 @@ void ConversationModelPrivate::groupsAddedSlot(const QList<Group> &/*groups*/)
if (allGroups)
q->getEvents();
else
q->getEvents(filterGroupIds.toList());
q->getEvents(filterGroupIds.values());
}
}
......@@ -93,7 +93,7 @@ void ConversationModelPrivate::groupsDeletedSlot(const QList<int> &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<int> groups = filterGroupIds.toList();
QList<int> 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();
}
......
......@@ -55,7 +55,7 @@ DraftsModel::~DraftsModel()
QList<int> DraftsModel::filterGroups() const
{
Q_D(const DraftsModel);
return d->filterGroups.toList();
return d->filterGroups.values();
}
void DraftsModel::setFilterGroups(const QList<int> &list)
......
......@@ -360,7 +360,7 @@ void EventModelPrivate::onDemandResolverFinished()
resolvedRecipients.insert(*it);
}
slotContactChanged(resolvedRecipients.toList());
slotContactChanged(resolvedRecipients.values());
}
void EventModelPrivate::modifyInModel(Event &event)
......
......@@ -94,7 +94,7 @@ void GroupModelPrivate::setManager(GroupManager *m)
connect(manager, SIGNAL(groupsCommitted(QList<int>,bool)), q, SIGNAL(groupsCommitted(QList<int>,bool)));
groups = manager->groups();
qSort(groups.begin(), groups.end(), groupObjectSort);
std::sort(groups.begin(), groups.end(), groupObjectSort);
}
q->endResetModel();
......
......@@ -271,8 +271,8 @@ void RecentContactsModelPrivate::prependEvents(QList<Event> events, bool resolve
}
// Remove the rows that have been made obsolete
QList<int> removeIndices = removeSet.toList();
qSort(removeIndices);
QList<int> removeIndices = removeSet.values();
std::sort(removeIndices.begin(), removeIndices.end());
int count;
while ((count = removeIndices.count()) != 0) {
......
......@@ -470,7 +470,7 @@ QList<int> RecipientList::contactIds() const
if (r.contactId() > 0)
re.insert(r.contactId());
}
return re.toList();
return re.values();
}
QStringList RecipientList::remoteUids() const
......
......@@ -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);
}
......
......@@ -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<int> &times, 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) {
......
......@@ -41,7 +41,7 @@ Group group;
static void waitWithDeletes(int msec)
{
QTime timer;
QElapsedTimer timer;
timer.start();
while (timer.elapsed() < msec) {
QCoreApplication::sendPostedEvents();
......
......@@ -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();
......
......@@ -228,7 +228,7 @@ void ConversationModelPerfTest::getEvents()
fetchModel.setChunkSize(limit);
}
QTime time;
QElapsedTimer time;
time.start();
bool result = fetchModel.getEvents(groupIds);
QVERIFY(result);
......
......@@ -214,7 +214,7 @@ void GroupModelPerfTest::getGroups()
fetchModel.setManager(&manager);
QTime time;
QElapsedTimer time;
time.start();
bool result = fetchModel.getGroups();
QVERIFY(result);
......
......@@ -203,7 +203,7 @@ void RecentContactsModelPerfTest::getEvents()
if (limit)
fetchModel.setLimit(limit);
QTime time;
QElapsedTimer time;
time.start();
bool result = fetchModel.getEvents();
......
......@@ -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();
......
......@@ -184,7 +184,7 @@ void ConversationModelProfileTest::execute()
fetchModel.setChunkSize(limit);
}
QTime time;
QElapsedTimer time;
time.start();
bool result = fetchModel.getEvents();
QVERIFY(result);
......
......@@ -169,7 +169,7 @@ void GroupModelProfileTest::execute()
fetchModel.setManager(&manager);
QTime time;
QElapsedTimer time;
time.start();
bool result = fetchModel.getGroups();
......
......@@ -173,7 +173,7 @@ void RecentContactsModelProfileTest::execute()
RecentContactsModel fetchModel;
fetchModel.setLimit(limit);
QTime time;
QElapsedTimer time;
time.start();
bool result = fetchModel.getEvents();
......
......@@ -664,7 +664,7 @@ void GroupModelTest::streamingQuery()
QList<int> idsOrig;
QList<int> idsStream;
QTime timer;
int count = 0;
int chunkSize = firstChunkSize;
while (count < total) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment