~people-project/people-glib/trunk

« back to all changes in this revision

Viewing changes to people-glib/service.vala

  • Committer: Johann Prieur
  • Date: 2008-12-29 18:16:32 UTC
  • Revision ID: johann.prieur@gmail.com-20081229181632-hsp7dqk611ouqj8y
Added an AddressBook class and implemented Service.request_address_book

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
namespace People {
23
23
 
24
24
        internal static const string BUS_NAME = "net.launchpad.People";
25
 
        internal static const string SERVICE_PATH = "net/launchpad/People";
 
25
        internal static const string OBJECT_PATH = "net/launchpad/People";
26
26
 
27
27
        public class Service : DBusObject {
28
28
                public Service (DBus.Connection? connection = null) {
31
31
                        else
32
32
                                this.connection = connection;
33
33
 
34
 
                        this.object = this.connection.get_object (BUS_NAME, SERVICE_PATH);
 
34
                        this.object = this.connection.get_object (BUS_NAME, OBJECT_PATH);
 
35
                }
 
36
 
 
37
                public AddressBook request_address_book (string address_book_id) {
 
38
                        string bus_name, object_path;
 
39
 
 
40
                        try {
 
41
                                this.object.RequestAddressBook (address_book_id, out bus_name, out object_path);
 
42
                        } catch (Error e) {
 
43
                                warning (e.message);
 
44
                        }
 
45
 
 
46
                        return new AddressBook (connection, bus_name, object_path);
35
47
                }
36
48
        }
37
49