[gnome-control-center] mouse: Adapt to changes in gsd-input-helper
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] mouse: Adapt to changes in gsd-input-helper
- Date: Thu, 2 Jul 2015 13:56:04 +0000 (UTC)
commit f290d71e9a20c757ef285a4e7abaac5d8330718e
Author: Ondrej Holy <oholy redhat com>
Date: Fri Jun 26 15:55:06 2015 +0200
mouse: Adapt to changes in gsd-input-helper
Redundant code can be removed from mouse panel thanks to changes
in gsd-input-helper.
https://bugzilla.gnome.org/show_bug.cgi?id=749818
panels/mouse/gnome-mouse-properties.c | 22 +++++-----------------
1 files changed, 5 insertions(+), 17 deletions(-)
---
diff --git a/panels/mouse/gnome-mouse-properties.c b/panels/mouse/gnome-mouse-properties.c
index 7de3e94..2eb3531 100644
--- a/panels/mouse/gnome-mouse-properties.c
+++ b/panels/mouse/gnome-mouse-properties.c
@@ -342,24 +342,12 @@ create_dialog (CcMousePropertiesPrivate *d)
/* Callback issued when a button is clicked on the dialog */
-static gboolean
-have_device_type (GsdDeviceManager *manager,
- GsdDeviceType type)
-{
- GList *l;
-
- l = gsd_device_manager_list_devices (manager, type);
- g_list_free (l);
-
- return l != NULL;
-}
-
static void
device_changed (GsdDeviceManager *device_manager,
GsdDevice *device,
CcMousePropertiesPrivate *d)
{
- d->have_touchpad = have_device_type (d->device_manager, GSD_DEVICE_TYPE_TOUCHPAD);
+ d->have_touchpad = touchpad_is_present ();
gtk_widget_set_visible (WID ("touchpad_vbox"), d->have_touchpad);
if (d->have_touchpad) {
@@ -369,7 +357,7 @@ device_changed (GsdDeviceManager *device_manager,
d->changing_scroll = FALSE;
}
- d->have_mouse = have_device_type (d->device_manager, GSD_DEVICE_TYPE_MOUSE);
+ d->have_mouse = mouse_is_present ();
gtk_widget_set_visible (WID ("mouse_vbox"), d->have_mouse);
gtk_widget_set_visible (WID ("touchpad_enabled_switch"),
show_touchpad_enabling_switch (d));
@@ -429,9 +417,9 @@ cc_mouse_properties_init (CcMouseProperties *object)
d->device_removed_id = g_signal_connect (d->device_manager, "device-removed",
G_CALLBACK (device_changed), d);
- d->have_mouse = have_device_type (d->device_manager, GSD_DEVICE_TYPE_MOUSE);
- d->have_touchpad = have_device_type (d->device_manager, GSD_DEVICE_TYPE_TOUCHPAD);
- d->have_touchscreen = have_device_type (d->device_manager, GSD_DEVICE_TYPE_TOUCHSCREEN);
+ d->have_mouse = mouse_is_present ();
+ d->have_touchpad = touchpad_is_present ();
+ d->have_touchscreen = touchscreen_is_present ();
d->changing_scroll = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]