rsms/scrup — pull request #34 by abarisain (2012-06-26 13:49:31+00:00)
Title: Mountain Lion support

Hello !
I noticed that, since DP1, Scrup auto uploading is broken on Mountain Lion.

I tracked this down to NSDistributedNotification center + a carbon notification being deprecated (Apple deprecated Carbon in 10.8)

Changes were required so Scrup watches the screenshot folder using FSEvents. Since FSEvents is a C api (thanks for the downgrade apple !) I used a small library called SCEvents, wrapping the C apis into nice Obj-C.

The events are fired every second, so it might look like it lags a little, but when you copy a lot of files in a directory with screenshots (usually Desktop !) it saves quite a lot of cpu compared to 0,5 seconds.
Also, the screenshot directory is not scanned anymore if the FS event occured in a sub directory (I have not found any way to tell FSEvent that I don't want it to fire events from subdirectories).

I did quite a lot of commits, and accidentally committed my xcode user files (I removed them afterwards), so you might have quite a lot of work reviewing this pull request ...

I also hope that I did not make your code dirty or buggy, as I'm still a quite noob in "real" Obj-C dev, coming from the easy "hey let's just parse this json" iOS world.

Please note that since I am working on Mountain Lion, I could not compile against the 10.6 SDK, since it's now gone (yay apple). However, I set the target to 10.6, so it should run on it anyway. (I said should, because I couldn't test it on 10.6/10.7, since I only have one single boot mac)