Skip to content

Commit

Permalink
Merge 958c95f into 278ac0e
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Colucci committed Jul 22, 2017
2 parents 278ac0e + 958c95f commit 4406775
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
9 changes: 5 additions & 4 deletions src/model/ircbuffermodel.cpp 100644 → 100755
Expand Up @@ -316,9 +316,9 @@ void IrcBufferModelPrivate::insertBuffer(int index, IrcBuffer* buffer, bool noti
if (sortMethod != Irc::SortByHand) {
QList<IrcBuffer*>::iterator it;
if (sortOrder == Qt::AscendingOrder)
it = qUpperBound(bufferList.begin(), bufferList.end(), buffer, IrcBufferLessThan(q, sortMethod));
it = std::upper_bound(bufferList.begin(), bufferList.end(), buffer, IrcBufferLessThan(q, sortMethod));
else
it = qUpperBound(bufferList.begin(), bufferList.end(), buffer, IrcBufferGreaterThan(q, sortMethod));
it = std::upper_bound(bufferList.begin(), bufferList.end(), buffer, IrcBufferGreaterThan(q, sortMethod));
index = it - bufferList.begin();
} else if (index == -1) {
index = bufferList.count();
Expand Down Expand Up @@ -605,6 +605,7 @@ void IrcBufferModelPrivate::_irc_restoreBuffers()
chans.clear();
keys.clear();
joinCommandLength = joinCommandMinLength;
(void)joinCommandLength; // Fix a Static Analyzer warning that the variable is never read
}

// Add channel to list
Expand Down Expand Up @@ -1064,9 +1065,9 @@ void IrcBufferModel::sort(Irc::SortMethod method, Qt::SortOrder order)
persistentBuffers += static_cast<IrcBuffer*>(index.internalPointer());

if (order == Qt::AscendingOrder)
qSort(d->bufferList.begin(), d->bufferList.end(), IrcBufferLessThan(this, method));
std::sort(d->bufferList.begin(), d->bufferList.end(), IrcBufferLessThan(this, method));
else
qSort(d->bufferList.begin(), d->bufferList.end(), IrcBufferGreaterThan(this, method));
std::sort(d->bufferList.begin(), d->bufferList.end(), IrcBufferGreaterThan(this, method));

QModelIndexList newPersistentIndexes;
foreach (IrcBuffer* buffer, persistentBuffers)
Expand Down
13 changes: 7 additions & 6 deletions src/model/ircusermodel.cpp
Expand Up @@ -33,6 +33,7 @@
#include "ircchannel_p.h"
#include "ircuser.h"
#include <qpointer.h>
#include <algorithm>

IRC_BEGIN_NAMESPACE

Expand Down Expand Up @@ -125,9 +126,9 @@ void IrcUserModelPrivate::insertUser(int index, IrcUser* user, bool notify)
if (sortMethod != Irc::SortByHand) {
QList<IrcUser*>::iterator it;
if (sortOrder == Qt::AscendingOrder)
it = qUpperBound(userList.begin(), userList.end(), user, IrcUserLessThan(q, sortMethod));
it = std::upper_bound(userList.begin(), userList.end(), user, IrcUserLessThan(q, sortMethod));
else
it = qUpperBound(userList.begin(), userList.end(), user, IrcUserGreaterThan(q, sortMethod));
it = std::upper_bound(userList.begin(), userList.end(), user, IrcUserGreaterThan(q, sortMethod));
index = it - userList.begin();
}
if (notify)
Expand Down Expand Up @@ -179,9 +180,9 @@ void IrcUserModelPrivate::setUsers(const QList<IrcUser*>& users, bool reset)
userList = users;
if (sortMethod != Irc::SortByHand) {
if (sortOrder == Qt::AscendingOrder)
qSort(userList.begin(), userList.end(), IrcUserLessThan(q, sortMethod));
std::sort(userList.begin(), userList.end(), IrcUserLessThan(q, sortMethod));
else
qSort(userList.begin(), userList.end(), IrcUserGreaterThan(q, sortMethod));
std::sort(userList.begin(), userList.end(), IrcUserGreaterThan(q, sortMethod));
}
updateTitles();
if (reset)
Expand Down Expand Up @@ -695,9 +696,9 @@ void IrcUserModel::sort(Irc::SortMethod method, Qt::SortOrder order)
persistentUsers += static_cast<IrcUser*>(index.internalPointer());

if (order == Qt::AscendingOrder)
qSort(d->userList.begin(), d->userList.end(), IrcUserLessThan(this, method));
std::sort(d->userList.begin(), d->userList.end(), IrcUserLessThan(this, method));
else
qSort(d->userList.begin(), d->userList.end(), IrcUserGreaterThan(this, method));
std::sort(d->userList.begin(), d->userList.end(), IrcUserGreaterThan(this, method));

if (d->updateTitles())
emit titlesChanged(d->titles);
Expand Down

0 comments on commit 4406775

Please sign in to comment.