Skip to content

Instantly share code, notes, and snippets.

@yuriks
Created February 14, 2017 08:01
Show Gist options
  • Save yuriks/92b0ae4badab745eaffb39e6b8758b63 to your computer and use it in GitHub Desktop.
Save yuriks/92b0ae4badab745eaffb39e6b8758b63 to your computer and use it in GitHub Desktop.
/**
* Adds the game list folder to the QFileSystemWatcher to check for updates.
*
* The file watcher will fire off an update to the game list when a change is detected in the
* game list folder.
*
* Notice: This method is run on the UI thread because QFileSystemWatcher is not thread safe
* and this function is fast enough to not stall the UI thread. If performance is an issue, it
* should be moved to another thread and properly locked to prevent concurrency issues.
*
* @param dir folder to check for changes in
* @param recursion 0 if recursion is disabled. Any positive number passed to this will add each
* directory recursively to the watcher and will update the file list if any of the folders
* change. The number determines how deep the recursion should traverse.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment