Repository navigation
Working demo for wxFileSystemWatcher - #113
Merged
Merged
Conversation
Member
|
Looks good! The trailing slash requirement may be reported at the wxwidgets bug tracker or ask them if that's the normal behavior, but I don't think it is a big issue. About the wxTimer I think it is fine too. So I will merge this now. |
jgmdev
added a commit
that referenced
this pull request
Dec 3, 2015
Working demo for wxFileSystemWatcher
Contributor
Author
|
Great! OK, good idea - I will log a ticket over there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here is a simple file watcher app, as discussed on #110. Tested on Ubuntu 14.04 with PHP 5.5.9.
There are a couple of oddities I'd draw attention to, in case you want to improve this before merging down. Firstly to watch what happens inside a folder, the watched folder must end in a trailing slash - if this behaviour is introduced by wxPHP and not wxWidgets, that might be worth looking at. (I don't have a view as to where it is introduced, but thought the behaviour was rather strange - if there is no trailing slash I imagine one would still want to know about file events directly in that folder).
Also, unlike other controls a watcher cannot be instantiated until the loop is running, and creating one in a frame constructor or app init bombs with an error (see the code comments). Ideally it could be instantiated at any time and start watching when the event loop starts, but I don't know how feasible this is (and the timer workaround feels perfectly clean). If there's a better way to delay this instantiation, do let me know.