lxqt / libqtxdg

Qt implementation of freedesktop.org xdg specs
https://lxqt.github.io
GNU Lesser General Public License v2.1
73 stars 35 forks source link

Drop Q_FOREACH #137

Closed luis-pereira closed 7 years ago

luis-pereira commented 7 years ago

Qt 5.9 deprecated it. Replaced with C++11 ranged for-loops. We don't use qAsConst(). It was introduced in Qt 5.7. We don't require Qt 5.7. qAsConst() replaced with const_cast<const T&>(t).

palinek commented 7 years ago

seems OK... GTM

agaida commented 7 years ago

GTM - but we should replace Q_FOREACH in the tests also

test/qtxdg_test.cpp:    Q_FOREACH (QString mimedir, mimedirs)
test/qtxdg_test.cpp:        Q_FOREACH(QFileInfo mediaDir, dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot))
test/qtxdg_test.cpp:            Q_FOREACH (QString mimeXmlFileName, QDir(mediaDir.absoluteFilePath()).entryList(filters, QDir::Files))

These three lines was left over with the PR applied, maybe i missed something.

luis-pereira commented 7 years ago

@agaida You didn't miss anything. I missed the test directory. Updated.