D26407: KFileItem: Improve isSlow to not block when a network mount is unresponsive, make SkipMimeTypeFromContent skip only on slow fs

David Faure noreply at phabricator.kde.org
Sat Jan 18 18:00:20 GMT 2020


dfaure added inline comments.

INLINE COMMENTS

> kmountpoint.cpp:436
> +    if (result && !result->probablySlow()) {
> +        // check recursively its eventual parent dir transitive symlinks
> +        int cursor = path.lastIndexOf(QLatin1Char('/'));

is the word "for" missing in this sentence? (as in "check A for B?")

Even then I fail to parse it...

> kmountpoint.cpp:439
> +        while (cursor > 0) {
> +            const QFileInfo fileinfo = QFileInfo(path.mid(0, cursor));
> +            if (fileinfo.isSymLink()) {

Ctor syntax is simpler than assignment syntax (which is in fact a copy ctor). And mid(0,N) is left(N).

  const QFileInfo fileInfo(path.left(cursor));

> kmountpoint.h:53
> +         * Resolves symlinks before looking for mount point
> +         * Returns the first mountpoint that isProbablySlow
> +         *

Really? that's not what all callers might want.

e.g. for "free disk space" calculation we want the real final mountpoint for that path.

If you need something else, it should be a different method, or indeed a flag

> kmountpoint.h:56
> +         * @param path the path to check, must be absolute
> +         * @param a MountPointFlag enum value
>           * @return the mount point of the given file

where's this param? leftover docu?

REPOSITORY
  R241 KIO

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

To: meven, #frameworks, ngraham, broulik, dfaure
Cc: anthonyfieroni, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200118/2f495f6f/attachment.html>


More information about the Kde-frameworks-devel mailing list