Skip to content

Commit

Permalink
Fix warnings and API for new Qt
Browse files Browse the repository at this point in the history
  • Loading branch information
neochapay authored and pvuorela committed May 19, 2021
1 parent 9fe0cd4 commit 334caec
Show file tree
Hide file tree
Showing 19 changed files with 23 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/contactgroupmodel.cpp
Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions src/conversationmodel.cpp
Expand Up @@ -71,7 +71,7 @@ void ConversationModelPrivate::groupsAddedSlot(const QList<Group> &/*groups*/)
if (allGroups)
q->getEvents();
else
q->getEvents(filterGroupIds.toList());
q->getEvents(filterGroupIds.values());
}
}

Expand All @@ -93,7 +93,7 @@ void ConversationModelPrivate::groupsDeletedSlot(const QList<int> &groupIds)
if (allGroups)
q->getEvents();
else
q->getEvents(filterGroupIds.toList());
q->getEvents(filterGroupIds.values());
}
}

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/draftsmodel.cpp
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/eventmodel_p.cpp
Expand Up @@ -360,7 +360,7 @@ void EventModelPrivate::onDemandResolverFinished()
resolvedRecipients.insert(*it);
}

slotContactChanged(resolvedRecipients.toList());
slotContactChanged(resolvedRecipients.values());
}

void EventModelPrivate::modifyInModel(Event &event)
Expand Down
2 changes: 1 addition & 1 deletion src/groupmodel.cpp
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/recentcontactsmodel.cpp
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/recipient.cpp
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/recipienteventmodel.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -151,8 +149,6 @@ RecipientEventModel::~RecipientEventModel()

void RecipientEventModel::setRecipients(const Recipient &recipient)
{
Q_D(RecipientEventModel);

setRecipients(RecipientList() << recipient);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/common.cpp
Expand Up @@ -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();
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tests/mem_eventmodel/mem_eventmodel.cpp
Expand Up @@ -41,7 +41,7 @@ Group group;

static void waitWithDeletes(int msec)
{
QTime timer;
QElapsedTimer timer;
timer.start();
while (timer.elapsed() < msec) {
QCoreApplication::sendPostedEvents();
Expand Down
2 changes: 1 addition & 1 deletion tests/perf_callmodel/callmodelperftest.cpp
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion tests/perf_conversationmodel/conversationmodelperftest.cpp
Expand Up @@ -228,7 +228,7 @@ void ConversationModelPerfTest::getEvents()
fetchModel.setChunkSize(limit);
}

QTime time;
QElapsedTimer time;
time.start();
bool result = fetchModel.getEvents(groupIds);
QVERIFY(result);
Expand Down
2 changes: 1 addition & 1 deletion tests/perf_groupmodel/groupmodelperftest.cpp
Expand Up @@ -214,7 +214,7 @@ void GroupModelPerfTest::getGroups()

fetchModel.setManager(&manager);

QTime time;
QElapsedTimer time;
time.start();
bool result = fetchModel.getGroups();
QVERIFY(result);
Expand Down
Expand Up @@ -203,7 +203,7 @@ void RecentContactsModelPerfTest::getEvents()
if (limit)
fetchModel.setLimit(limit);

QTime time;
QElapsedTimer time;
time.start();

bool result = fetchModel.getEvents();
Expand Down
2 changes: 1 addition & 1 deletion tests/profile_callmodel/callmodelprofiletest.cpp
Expand Up @@ -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();
Expand Down
Expand Up @@ -184,7 +184,7 @@ void ConversationModelProfileTest::execute()
fetchModel.setChunkSize(limit);
}

QTime time;
QElapsedTimer time;
time.start();
bool result = fetchModel.getEvents();
QVERIFY(result);
Expand Down
2 changes: 1 addition & 1 deletion tests/profile_groupmodel/groupmodelprofiletest.cpp
Expand Up @@ -169,7 +169,7 @@ void GroupModelProfileTest::execute()

fetchModel.setManager(&manager);

QTime time;
QElapsedTimer time;
time.start();

bool result = fetchModel.getGroups();
Expand Down
Expand Up @@ -173,7 +173,7 @@ void RecentContactsModelProfileTest::execute()
RecentContactsModel fetchModel;
fetchModel.setLimit(limit);

QTime time;
QElapsedTimer time;
time.start();

bool result = fetchModel.getEvents();
Expand Down
2 changes: 1 addition & 1 deletion tests/ut_groupmodel/groupmodeltest.cpp
Expand Up @@ -664,7 +664,7 @@ void GroupModelTest::streamingQuery()

QList<int> idsOrig;
QList<int> idsStream;
QTime timer;

int count = 0;
int chunkSize = firstChunkSize;
while (count < total) {
Expand Down

0 comments on commit 334caec

Please sign in to comment.