~ubuntu-branches/ubuntu/quantal/zeitgeist/quantal

« back to all changes in this revision

Viewing changes to src/errors.vala

  • Committer: Package Import Robot
  • Author(s): Didier Roche
  • Date: 2011-11-15 11:15:56 UTC
  • mto: (6.2.2 experimental) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 19.
  • Revision ID: package-import@ubuntu.com-20111115111556-so7cmhfbqongw7hf
Tags: upstream-0.8.99~alpha1
Import upstream version 0.8.99~alpha1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* zeitgeist-daemon.vala
 
2
 *
 
3
 * Copyright © 2011 Collabora Ltd.
 
4
 *             By Siegfried-Angel Gevatter Pujals <siegfried@gevatter.com>
 
5
 *
 
6
 * This program is free software: you can redistribute it and/or modify
 
7
 * it under the terms of the GNU Lesser General Public License as published by
 
8
 * the Free Software Foundation, either version 2.1 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Lesser General Public License
 
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 *
 
19
 */
 
20
 
 
21
namespace Zeitgeist
 
22
{
 
23
    [DBus (name = "org.gnome.zeitgeist.EngineError")]
 
24
    public errordomain EngineError
 
25
    {
 
26
        DATABASE_ERROR,
 
27
        INVALID_ARGUMENT,
 
28
        INVALID_KEY,
 
29
        BACKUP_FAILED,
 
30
    }
 
31
 
 
32
    // vala doesn't include proper headers, this fixes it
 
33
    private static void vala_bug_workaround ()
 
34
    {
 
35
        try
 
36
        {
 
37
            Bus.get_sync (BusType.SESSION, null);
 
38
        }
 
39
        catch (Error err)
 
40
        {
 
41
            i_know_its_unused ();
 
42
        }
 
43
    }
 
44
 
 
45
    // also screw your warnings vala
 
46
    private static void i_know_its_unused ()
 
47
    {
 
48
        vala_bug_workaround ();
 
49
    }
 
50
}
 
51
 
 
52
// vim:expandtab:ts=4:sw=4