Unfortunately, it seems like QFSFileEngine is especially split between OS implementations, and is very connected to the local file system. I don't think subclassing is possible, or rather, it's pointless because so many methods would need to be overridden.
The files I want to list are not local to the file system, and therefore the FileDialog should never need to access the local file system (except to load icons).
I have started to write a QAbstractFileEngine subclass, but things don't seem to work right.
The example in the documentation on QAbstractFileEngineIterator has bugs in it. It puts the iterator on the first item, which means that the first item is never retrieved. I changed the index(0) to index(-1) which helps (after fixing currentFileName to check for -1). Also, filterNames and filters seems reversed in the documentation (which is easy to fix, but still seems like a typo).
But when the dialog is created it seems to search for history items, which seem to default to the currentDirectory (of the application). Then I set history to an empty list, and the sidebar urls to an empty list, but entries never show up in the dialog.
After searching, I find in the code that QDirIterator is a friend to QAbstractFileEngine, which is frustrating because this disallows me to set the path() of the iterator, and instead it inherits the dir from when the FileDialog was created. Perhaps my iterator has to subclass QDirIterator? But what do I do with QDirIteratorPrivate?
Is it really bad to use Q3NetworkProtocol, I mean, are they really gonna get rid of it?




Reply With Quote



Bookmarks