D19299: Make it compile without foreach

David Faure noreply at phabricator.kde.org
Sat Mar 2 23:11:10 GMT 2019


dfaure requested changes to this revision.
dfaure added a comment.
This revision now requires changes to proceed.


  I can't review tests/faceicontest.cpp, phabricator thinks it's a binary file.

INLINE COMMENTS

> ktexttohtmltest.cpp:163
> +    for (const QString &schema : qAsConst(schemas)) {
> +        for (QString url : qAsConst(urls)) {   //krazy:exclude=foreach
>              // by definition: if the URL is enclosed in brackets, the URL itself is not allowed

I wonder if the krazy comment needs to be updated, but I don't know, feel free to leave it as is if you don't know either.

> kpluginloader.cpp:296
>      QPluginLoader loader;
> -    foreach (const KPluginMetaData &metadata, findPlugins(directory, filter)) {
> +    QVector<KPluginMetaData> listMetaData = findPlugins(directory, filter);
> +    for (const KPluginMetaData &metadata : listMetaData) {

const missing

> kpluginmetadata.cpp:233
>      } else if (people.isArray()) {
> -        foreach (const QJsonValue &val, people.toArray()) {
> +        for (const QJsonValue &val : people.toArray()) {
>              if (val.isObject()) {

needs a const local var, no?

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D19299

To: mlaurent, dfaure
Cc: kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190302/c9ece827/attachment.html>


More information about the Kde-frameworks-devel mailing list