Do not use QFileInfo to obtain the size of a symlink in kio_trash
Review Request #112173 - Created Aug. 20, 2013 and submitted
The attached patch fixes a bug where deleting a symlink to a very large file causes a "trash has reached its limit error. This happens because the code that is used to determine the amount of space available in the trashcan uses QFileInfo::size to determine the size of a file. This will not work because QFileInfo::size returns the size of the actual file the symlink points to and not the size of the symlink itself. See the documentation for QFileInfo.
QFileInfo is more portable. Why not just write || info.isSymlink() in the first if?
And if you really want to use stat, then this is a bit convoluted. No need to write a perfect isDir(), you're only using it in an "else" branch, i.e. you know that isFile() returned false already. IMHO just else if (S_ISDIR(buff.st_mode)) would be simpler and easier to read. (and folding isFile, too) But anyway, QFileInfo can do the job just fine IMHO.