KFileItem: call stat() on demand, add SkipMimeTypeDetermination option
Summary:
This changes the initialization of KFileItem. Constructors won't call init() which might do an unnecessary QT_LSTAT/stat() system call. Instead, only if a method which needs the information from stat() is called, init() and stat() are run.
In addition this adds a KFileItem constructor for passing an enum MimeTypeDetermination parameter. If set to SkipMimeTypeFromContent,
KFileItem::isDir(), KFileItem::determineMimeType() (via isDir()), KFileItem::currentMimeType() and KFileItem::iconName() (via isDir()) won't call init(), QT_LSTAT or read the file.
See also https://phabricator.kde.org/D19784
Reviewers: dfaure, Frameworks, Dolphin
Reviewed By: dfaure
Subscribers: kde-frameworks-devel
Tags: Frameworks
Differential Revision: https://phabricator.kde.org/D19887