Get rid of qSort usages in QDir
QtAlgorithms is getting deprecated, see http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: I951a2b9b16fce9d6d29cca0012cdeb06cad79fce Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
b51b3e63a6
commit
38b92f5cba
@ -52,7 +52,6 @@
|
|||||||
#include "qstring.h"
|
#include "qstring.h"
|
||||||
#include "qregexp.h"
|
#include "qregexp.h"
|
||||||
#include "qvector.h"
|
#include "qvector.h"
|
||||||
#include "qalgorithms.h"
|
|
||||||
#include "qvarlengtharray.h"
|
#include "qvarlengtharray.h"
|
||||||
#include "qfilesystementry_p.h"
|
#include "qfilesystementry_p.h"
|
||||||
#include "qfilesystemmetadata_p.h"
|
#include "qfilesystemmetadata_p.h"
|
||||||
@ -64,6 +63,7 @@
|
|||||||
# include "private/qcoreglobaldata_p.h"
|
# include "private/qcoreglobaldata_p.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -308,7 +308,7 @@ inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QFileInfoList &l,
|
|||||||
QScopedArrayPointer<QDirSortItem> si(new QDirSortItem[n]);
|
QScopedArrayPointer<QDirSortItem> si(new QDirSortItem[n]);
|
||||||
for (int i = 0; i < n; ++i)
|
for (int i = 0; i < n; ++i)
|
||||||
si[i].item = l.at(i);
|
si[i].item = l.at(i);
|
||||||
qSort(si.data(), si.data() + n, QDirSortItemComparator(sort));
|
std::sort(si.data(), si.data() + n, QDirSortItemComparator(sort));
|
||||||
// put them back in the list(s)
|
// put them back in the list(s)
|
||||||
if (infos) {
|
if (infos) {
|
||||||
for (int i = 0; i < n; ++i)
|
for (int i = 0; i < n; ++i)
|
||||||
|
Loading…
Reference in New Issue
Block a user