Closed rschroll closed 10 years ago
There is a QFileSystemWatcher that could do some of what we want, but when watching directories, it doesn't seem to tell you which file therein changed. It's also not recursive, so we'd have to set up a watch for every subdirectory of the Books directory (see #30).
So I think the better solution is either to poll occasionally or put a "Refresh" button in the toolbar. Any thoughts, @stuartlangridge?
Arguing both sides of this:
I think that there are nice benefits in it being magic -- that is, that new books "Just Appear" when added. So I suggest adding a watch for every subdirectory. That's so much nicer than having to manually punch a button.
On the other hand, it's disconcerting to have things happen by magic. In particular, people often don't expect something to notice a change automatically, because they've been conditioned by the fact that almost every app does not. So they'll go searching for a "refresh" button without even looking to see if it happened automatically. It's the autocondimenting phenomenon applied to UI. That argues for an explicit refresh button in the toolbar.
I've gone with a manual refresh right now, since it was five lines of code or so. Issue #37 will track an automatic solution.
As we mentioned in #20, Beru won't notice books added to the library directory while it's running. This isn't a big deal, but it would be pretty easy to add a "Refresh" button to the LocalBooks page.
Alternatively, we could watch that directory for files being added or removed and update the list automatically.