dhaumann added inline comments.

INLINE COMMENTS

> kfileplacesmodel.cpp:137
>  
> -        if (path.endsWith(QLatin1String("/documents"))) {
> -            searchUrl = searchUrlForType(QStringLiteral("Document"));
> -        } else if (path.endsWith(QLatin1String("/images"))) {
> -            searchUrl = searchUrlForType(QStringLiteral("Image"));
> -        } else if (path.endsWith(QLatin1String("/audio"))) {
> -            searchUrl = searchUrlForType(QStringLiteral("Audio"));
> -        } else if (path.endsWith(QLatin1String("/videos"))) {
> -            searchUrl = searchUrlForType(QStringLiteral("Video"));
> -        } else {
> -            qWarning() << "Invalid search url:" << url;
> -            searchUrl = url;
> +        const QStringList validSearchPaths = {
> +            QStringLiteral("/documents"),

const auto validSearchPaths = { ... }; Would use an initializer list. This 
would be likely faster, since it would avoid the QStringList.

REPOSITORY
  R241 KIO

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

To: broulik, #frameworks, bruns, dfaure, renatoo, franckarrecot, ngraham, hein
Cc: dhaumann, kde-frameworks-devel, michaelh, ngraham, bruns

Reply via email to