D16311: RFC: [KFilePlacesView] Use asynchronous KIO::FileSystemFreeSpaceJob

Anthony Fieroni noreply at phabricator.kde.org
Wed Oct 24 09:07:57 BST 2018


anthonyfieroni added inline comments.

INLINE COMMENTS

> kfileplacesview.cpp:256
> +                    (!info.lastUpdated.isValid() || info.lastUpdated.secsTo(QDateTime::currentDateTimeUtc()) > 60)) {
> +                info.job = KIO::fileSystemFreeSpace(url);
> +                connect(info.job, &KIO::FileSystemFreeSpaceJob::result, this, [this, persistentIndex](KIO::Job *job, KIO::filesize_t size, KIO::filesize_t available) {

You will get the job as lambda parameter.

> kfileplacesview.cpp:257
> +                info.job = KIO::fileSystemFreeSpace(url);
> +                connect(info.job, &KIO::FileSystemFreeSpaceJob::result, this, [this, persistentIndex](KIO::Job *job, KIO::filesize_t size, KIO::filesize_t available) {
> +                    PlaceFreeSpaceInfo &info = m_freeSpaceInfo[persistentIndex];

You can make lambda mutable in there you can modify m_freeSpaceInfo without declare it mutable

REPOSITORY
  R241 KIO

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

To: broulik, #frameworks, dfaure, lbeltrame
Cc: anthonyfieroni, kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20181024/5c13a044/attachment.html>


More information about the Kde-frameworks-devel mailing list