Because it first builds a list of the files and then sorts the list .
...
{
d->updateFileLists();
return d->data->files.count();
}
...
inline void QDirPrivate::updateFileLists() const
{
if(data->listsDirty) {
QStringList l
= data
->fileEngine
->entryList
(data
->filters, data
->nameFilters
);
sortFileList(data->sort, l, &data->files, &data->fileInfos);
data->listsDirty = 0;
}
}
...
uint QDir::count() const
{
Q_D(const QDir);
d->updateFileLists();
return d->data->files.count();
}
...
inline void QDirPrivate::updateFileLists() const
{
if(data->listsDirty) {
QStringList l = data->fileEngine->entryList(data->filters, data->nameFilters);
sortFileList(data->sort, l, &data->files, &data->fileInfos);
data->listsDirty = 0;
}
}
To copy to clipboard, switch view to plain text mode
So, I think you should use platform API, and just count the files, no backstore, or anything similar.
Regards
Bookmarks