Changeset View
Changeset View
Standalone View
Standalone View
tests/auto/recursivedirmodeltest.cpp
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | |||||
90 | static QList<QUrl> listModelUrls(QAbstractItemModel* model) | 90 | static QList<QUrl> listModelUrls(QAbstractItemModel* model) | ||
91 | { | 91 | { | ||
92 | QList<QUrl> out; | 92 | QList<QUrl> out; | ||
93 | for (int row = 0; row < model->rowCount(QModelIndex()); ++row) { | 93 | for (int row = 0; row < model->rowCount(QModelIndex()); ++row) { | ||
94 | QModelIndex index = model->index(row, 0); | 94 | QModelIndex index = model->index(row, 0); | ||
95 | KFileItem item = index.data(KDirModel::FileItemRole).value<KFileItem>(); | 95 | KFileItem item = index.data(KDirModel::FileItemRole).value<KFileItem>(); | ||
96 | out << item.url(); | 96 | out << item.url(); | ||
97 | } | 97 | } | ||
98 | qSort(out); | 98 | std::sort(out.begin(), out.end()); | ||
99 | return out; | 99 | return out; | ||
100 | } | 100 | } | ||
101 | 101 | | |||
102 | static QList<QUrl> listExpectedUrls(const QDir& dir, const QStringList& files) | 102 | static QList<QUrl> listExpectedUrls(const QDir& dir, const QStringList& files) | ||
103 | { | 103 | { | ||
104 | QList<QUrl> lst; | 104 | QList<QUrl> lst; | ||
105 | Q_FOREACH(const QString &name, files) { | 105 | Q_FOREACH(const QString &name, files) { | ||
106 | lst << QUrl::fromLocalFile(dir.absoluteFilePath(name)); | 106 | lst << QUrl::fromLocalFile(dir.absoluteFilePath(name)); | ||
107 | } | 107 | } | ||
108 | qSort(lst); | 108 | std::sort(lst.begin(), lst.end()); | ||
109 | return lst; | 109 | return lst; | ||
110 | } | 110 | } | ||
111 | 111 | | |||
112 | void logLst(const QList<QUrl>& lst) | 112 | void logLst(const QList<QUrl>& lst) | ||
113 | { | 113 | { | ||
114 | Q_FOREACH(const QUrl &url, lst) { | 114 | Q_FOREACH(const QUrl &url, lst) { | ||
115 | qWarning() << url.fileName(); | 115 | qWarning() << url.fileName(); | ||
116 | } | 116 | } | ||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |