Prevent that changed files in expanded folders are shown with a size of 16 EiB

Review Request #110428 - Created May 14, 2013 and submitted

Information
Frank Reininghaus
kde-baseapps
KDE/4.10
309740
Reviewers
dolphin
Even though KFileItemModelRolesUpdater sets up dir watches only for directories (to update the number of items shown in the "Size" column and to update the "isExpandable" state), we receive dirty() signals from KDirWatch also for the files inside those directories if INotify is used (this is documented in the KDirWatch source).

This results in the problem that KFileItemModelRolesUpdater::slotDirWatchDirty(const QString& path) calls KFileItemModelRolesUpdater::subItemsCount(const QString& path) to count the items inside the file, which obviously fails. That function returns -1, indicating an error, but because the type in which file sizes are measured, KIO::filesize_t, is an unsigned 64 bit integer, this becomes 2^64-1, which is rounded to 16 EiB.

We can fix this easily by ignoring the dirty() signal for files.
Works. No regressions found so far.
Emmanuel Pescosta
Commit Hook
Frank Reininghaus
Review request changed

Status: Closed (submitted)

Loading...