2
* BeagleService.BeagleService.cs
5
* Stephane Delcroix <stephane@delcroix.org>
7
* This is free software. See COPYING for details.
13
using FSpot.Extensions;
16
namespace BeagleService {
17
public class BeagleService : IService
21
uint timer = Log.InformationTimerStart ("Starting BeagleService");
23
Core.Database.Photos.ItemsChanged += HandleDbItemsChanged;
25
Log.Warning ("unable to hook the BeagleNotifier. are you running --view mode?");
27
Log.DebugTimerPrint (timer, "BeagleService startup took {0}");
33
uint timer = Log.InformationTimerStart ("Stopping BeagleService");
34
Log.DebugTimerPrint (timer, "BeagleService shutdown took {0}");
38
private void HandleDbItemsChanged (object sender, DbItemEventArgs args)
41
Log.Debug ("Notifying beagle");
42
foreach (DbItem item in args.Items) {
43
if (item as Photo != null)
45
BeagleNotifier.SendUpdate (item as Photo);
46
} catch (Exception e) {
47
Log.DebugFormat ("BeagleNotifier.SendUpdate failed with {0}", e.Message);