~ubuntu-branches/debian/squeeze/f-spot/squeeze

« back to all changes in this revision

Viewing changes to extensions/Services/BeagleService/BeagleService.cs

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane, Mirco Bauer, Iain Lane
  • Date: 2009-02-07 20:23:32 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: james.westby@ubuntu.com-20090207202332-oc93rfjo1st0571s
Tags: 0.5.0.3-2
[ Mirco Bauer]
* Upload to unstable.
* debian/control:
  + Lowered GNOME# build-deps to 2.0 ABI as that transition didn't happen
    yet in unstable.

[ Iain Lane ]
* debian/patches/svn-r4545_locales-import.dpatch: Patch backported from SVN
  trunk revision 4545 - initialize the translation catalog earlier (LP: #293305)
  (Closes: #514457). Thanks to Florian Heinle for finding the patch and to
  Chris Coulson for preparing the update.
* debian/control: Build-depend on libmono-dev (>= 1.2.4) to match configure
  checks.
* debian/rules: Pass CSC=/usr/bin/csc to configure for gio-sharp to fix FTBFS

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * BeagleService.BeagleService.cs
 
3
 *
 
4
 * Author(s):
 
5
 *      Stephane Delcroix  <stephane@delcroix.org>
 
6
 *
 
7
 * This is free software. See COPYING for details.
 
8
 *
 
9
 */
 
10
 
 
11
using System;
 
12
using FSpot;
 
13
using FSpot.Extensions;
 
14
using FSpot.Utils;
 
15
 
 
16
namespace BeagleService {
 
17
        public class BeagleService : IService
 
18
        {
 
19
                public bool Start ()
 
20
                {
 
21
                        uint timer = Log.InformationTimerStart ("Starting BeagleService");
 
22
                        try {
 
23
                                Core.Database.Photos.ItemsChanged += HandleDbItemsChanged;
 
24
                        } catch {
 
25
                                Log.Warning ("unable to hook the BeagleNotifier. are you running --view mode?");
 
26
                        }
 
27
                        Log.DebugTimerPrint (timer, "BeagleService startup took {0}");
 
28
                        return true;
 
29
                }
 
30
 
 
31
                public bool Stop ()
 
32
                {
 
33
                        uint timer = Log.InformationTimerStart ("Stopping BeagleService");
 
34
                        Log.DebugTimerPrint (timer, "BeagleService shutdown took {0}");
 
35
                        return true;
 
36
                }
 
37
 
 
38
                private void HandleDbItemsChanged (object sender, DbItemEventArgs args)
 
39
                {
 
40
#if ENABLE_BEAGLE
 
41
                        Log.Debug ("Notifying beagle");
 
42
                        foreach (DbItem item in args.Items) {
 
43
                                if (item as Photo != null)
 
44
                                        try {
 
45
                                                BeagleNotifier.SendUpdate (item as Photo);
 
46
                                        } catch (Exception e) {
 
47
                                                Log.DebugFormat ("BeagleNotifier.SendUpdate failed with {0}", e.Message);
 
48
                                        }
 
49
                        }
 
50
#endif
 
51
                }
 
52
        }
 
53
}