~unity-team/bamf/trunk

« back to all changes in this revision

Viewing changes to module/gapplaunchhandlerdbus.c

  • Committer: Neil Jagdish Patel
  • Date: 2010-01-18 10:13:30 UTC
  • Revision ID: neil.patel@canonical.com-20100118101330-xrptuzmf92d7ndlq
[copyright] Add LGPL license, license lib/ as LGPL and re-license model/ as LGPL (so it can be safely used with gio and non-gpl programs that use glib)

added:
  COPYING.LGPL
modified:
  lib/libwncksync/libwncksync.c
  lib/libwncksync/libwncksync.h
  module/dbus-module.c
  module/gapplaunchhandlerdbus.c
  module/gapplaunchhandlerdbus.h

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//  
2
 
//  Copyright (C) 2009 Canonical Ltd.
3
 
// 
4
 
//  This program is free software: you can redistribute it and/or modify
5
 
//  it under the terms of the GNU General Public License as published by
6
 
//  the Free Software Foundation, either version 3 of the License, or
7
 
//  (at your option) any later version.
8
 
// 
9
 
//  This program is distributed in the hope that it will be useful,
10
 
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
//  GNU General Public License for more details.
13
 
// 
14
 
//  You should have received a copy of the GNU General Public License
15
 
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
 
// 
 
1
/*
 
2
 * Copyright (C) 2009 Canonical, Ltd.
 
3
 *
 
4
 * This library is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU Lesser General Public License
 
6
 * version 3.0 as published by the Free Software Foundation.
 
7
 *
 
8
 * This library is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU Lesser General Public License version 3.0 for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public
 
14
 * License along with this library. If not, see
 
15
 * <http://www.gnu.org/licenses/>.
 
16
 *
 
17
 * Authored by Jason Smith <jason.smith@canonical.com>
 
18
 */
17
19
 
18
20
#include <config.h>
19
21
 
59
61
{
60
62
  GObject *object;
61
63
  GAppLaunchHandlerDBusClass *klass;
62
 
  GObjectClass *parent_class;  
 
64
  GObjectClass *parent_class;
63
65
 
64
66
  object = NULL;
65
67
 
103
105
        DBusGProxy *proxy;
104
106
 
105
107
        connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
106
 
        
 
108
 
107
109
        if (connection == NULL)
108
110
        {
109
111
                g_printerr ("Failed to open bus: %s\n", error->message);
110
 
                g_error_free (error);   
 
112
                g_error_free (error);
111
113
        }
112
 
        
 
114
 
113
115
        g_return_if_fail (connection);
114
 
        
 
116
 
115
117
        error = NULL;
116
 
        
117
 
        proxy = dbus_g_proxy_new_for_name (connection, 
118
 
                                           "org.wncksync.Matcher", 
119
 
                                           "/org/wncksync/Matcher", 
 
118
 
 
119
        proxy = dbus_g_proxy_new_for_name (connection,
 
120
                                           "org.wncksync.Matcher",
 
121
                                           "/org/wncksync/Matcher",
120
122
                                           "org.wncksync.Matcher");
121
 
        
 
123
 
122
124
        g_return_if_fail (proxy);
123
 
                        
124
 
        dbus_g_proxy_call (proxy, 
125
 
                           "RegisterDesktopFileForPid", 
 
125
 
 
126
        dbus_g_proxy_call (proxy,
 
127
                           "RegisterDesktopFileForPid",
126
128
                           &error,
127
 
                           G_TYPE_STRING, desktop_file_path, 
128
 
                           G_TYPE_INT, pid, 
 
129
                           G_TYPE_STRING, desktop_file_path,
 
130
                           G_TYPE_INT, pid,
129
131
                           G_TYPE_INVALID, G_TYPE_INVALID);
130
132
        g_object_unref (proxy);
131
133
        dbus_g_connection_unref (connection);
137
139
  iface->on_launched = on_launched;
138
140
}
139
141
 
140
 
void 
 
142
void
141
143
g_app_launch_handler_dbus_register (GIOModule *module)
142
144
{
143
145
  g_app_launch_handler_dbus_register_type (G_TYPE_MODULE (module));