summaryrefslogtreecommitdiff
blob: e72a30f84bae0ca52da6e65743040254f5106ceb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
Remove all traces of HAL. The last hunk which removes test-hal-seats.c has been
deleted to save space; the file is manually removed instead.

http://bugs.gentoo.org/show_bug.cgi?id=295206
---
From 3daaac264df2f5a587c35cd8e41ecf18900fa9c9 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Thu, 21 Jan 2010 00:00:02 +0100
Subject: [PATCH] remove remaining traces of Hal

The code which used the Hal connection already was disabled, so gdm connected
to Hal in vain (which just triggered Hal startup when using D-Bus activation).
Remove all remaining traces of hal now.

https://bugzilla.gnome.org/show_bug.cgi?id=593787
---
 daemon/Makefile.am                 |    9 --
 daemon/gdm-local-display-factory.c |  110 -----------------------
 daemon/test-hal-seats.c            |  173 ------------------------------------
 3 files changed, 0 insertions(+), 293 deletions(-)
 delete mode 100644 daemon/test-hal-seats.c

diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index a122a15..79bb63e 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -75,18 +75,9 @@ gdm-product-display-glue.h: gdm-product-display.xml Makefile.am
 	dbus-binding-tool --prefix=gdm_product_display --mode=glib-server --output=gdm-product-display-glue.h $(srcdir)/gdm-product-display.xml
 
 noinst_PROGRAMS = 		\
-	test-hal-seats		\
 	test-session		\
 	$(NULL)
 
-test_hal_seats_SOURCES = 	\
-	test-hal-seats.c	\
-	$(NULL)
-
-test_hal_seats_LDADD =		\
-	$(DAEMON_LIBS)		\
-	$(NULL)
-
 test_session_SOURCES = 		\
 	test-session.c	 	\
 	gdm-session.c		\
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index 3984ada..69daf9e 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -45,12 +45,6 @@
 #define GDM_LOCAL_DISPLAY_FACTORY_DBUS_PATH GDM_DBUS_PATH "/LocalDisplayFactory"
 #define GDM_MANAGER_DBUS_NAME               "org.gnome.DisplayManager.LocalDisplayFactory"
 
-#define HAL_DBUS_NAME                           "org.freedesktop.Hal"
-#define HAL_DBUS_MANAGER_PATH                   "/org/freedesktop/Hal/Manager"
-#define HAL_DBUS_MANAGER_INTERFACE              "org.freedesktop.Hal.Manager"
-#define HAL_DBUS_DEVICE_INTERFACE               "org.freedesktop.Hal.Device"
-#define SEAT_PCI_DEVICE_CLASS                   3
-
 #define MAX_DISPLAY_FAILURES 5
 
 struct GdmLocalDisplayFactoryPrivate
@@ -372,83 +366,6 @@ create_display (GdmLocalDisplayFactory *factory)
         return display;
 }
 
-#if 0
-static void
-create_display_for_device (GdmLocalDisplayFactory *factory,
-                           DBusGProxy             *device_proxy)
-{
-        create_display (factory);
-}
-
-static void
-create_displays_for_pci_devices (GdmLocalDisplayFactory *factory)
-{
-        char      **devices;
-        const char *key;
-        const char *value;
-        GError     *error;
-        gboolean    res;
-        int         i;
-
-        g_debug ("GdmLocalDisplayFactory: Getting PCI seat devices");
-
-        key = "info.bus";
-        value = "pci";
-
-        devices = NULL;
-        error = NULL;
-        res = dbus_g_proxy_call (factory->priv->proxy,
-                                 "FindDeviceStringMatch",
-                                 &error,
-                                 G_TYPE_STRING, key,
-                                 G_TYPE_STRING, value,
-                                 G_TYPE_INVALID,
-                                 G_TYPE_STRV, &devices,
-                                 G_TYPE_INVALID);
-        if (! res) {
-                g_warning ("Unable to query HAL: %s", error->message);
-                g_error_free (error);
-        }
-
-        /* now look for pci class 3 */
-        key = "pci.device_class";
-        for (i = 0; devices [i] != NULL; i++) {
-                DBusGProxy *device_proxy;
-                int         class_val;
-
-                device_proxy = dbus_g_proxy_new_for_name (factory->priv->connection,
-                                                          HAL_DBUS_NAME,
-                                                          devices [i],
-                                                          HAL_DBUS_DEVICE_INTERFACE);
-                if (device_proxy == NULL) {
-                        continue;
-                }
-
-                error = NULL;
-                res = dbus_g_proxy_call (device_proxy,
-                                         "GetPropertyInteger",
-                                         &error,
-                                         G_TYPE_STRING, key,
-                                         G_TYPE_INVALID,
-                                         G_TYPE_INT, &class_val,
-                                         G_TYPE_INVALID);
-                if (! res) {
-                        g_warning ("Unable to query HAL: %s", error->message);
-                        g_error_free (error);
-                }
-
-                if (class_val == SEAT_PCI_DEVICE_CLASS) {
-                        g_debug ("GdmLocalDisplayFactory: Found device: %s", devices [i]);
-                        create_display_for_device (factory, device_proxy);
-                }
-
-                g_object_unref (device_proxy);
-        }
-
-        g_strfreev (devices);
-}
-#endif
-
 static gboolean
 gdm_local_display_factory_start (GdmDisplayFactory *base_factory)
 {
@@ -525,29 +442,6 @@ register_factory (GdmLocalDisplayFactory *factory)
         return TRUE;
 }
 
-static gboolean
-connect_to_hal (GdmLocalDisplayFactory *factory)
-{
-        factory->priv->proxy = dbus_g_proxy_new_for_name (factory->priv->connection,
-                                                          HAL_DBUS_NAME,
-                                                          HAL_DBUS_MANAGER_PATH,
-                                                          HAL_DBUS_MANAGER_INTERFACE);
-        if (factory->priv->proxy == NULL) {
-                g_warning ("Couldn't create proxy for HAL Manager");
-                return FALSE;
-        }
-
-        return TRUE;
-}
-
-static void
-disconnect_from_hal (GdmLocalDisplayFactory *factory)
-{
-        if (factory->priv->proxy == NULL) {
-                g_object_unref (factory->priv->proxy);
-        }
-}
-
 static GObject *
 gdm_local_display_factory_constructor (GType                  type,
                                        guint                  n_construct_properties,
@@ -565,8 +459,6 @@ gdm_local_display_factory_constructor (GType                  type,
                 g_warning ("Unable to register local display factory with system bus");
         }
 
-        connect_to_hal (factory);
-
         return G_OBJECT (factory);
 }
 
@@ -611,8 +503,6 @@ gdm_local_display_factory_finalize (GObject *object)
 
         g_hash_table_destroy (factory->priv->displays);
 
-        disconnect_from_hal (factory);
-
         G_OBJECT_CLASS (gdm_local_display_factory_parent_class)->finalize (object);
 }