gpointing-device-settings r104 - in trunk/modules: . common gnome-settings-daemon-plugins
- From: hiikezoe svn gnome org
- To: svn-commits-list gnome org
- Subject: gpointing-device-settings r104 - in trunk/modules: . common gnome-settings-daemon-plugins
- Date: Tue, 3 Mar 2009 03:37:06 +0000 (UTC)
Author: hiikezoe
Date: Tue Mar 3 03:37:06 2009
New Revision: 104
URL: http://svn.gnome.org/viewvc/gpointing-device-settings?rev=104&view=rev
Log:
remove GPDS_TOUCHPAD_DEVICE_NAME, use gpds_touchpad_xinput_find_device_name.
Modified:
trunk/modules/common/gpds-touchpad-definitions.h
trunk/modules/common/gpds-touchpad-xinput.c
trunk/modules/common/gpds-touchpad-xinput.h
trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c
trunk/modules/gpds-touchpad-ui.c
Modified: trunk/modules/common/gpds-touchpad-definitions.h
==============================================================================
--- trunk/modules/common/gpds-touchpad-definitions.h (original)
+++ trunk/modules/common/gpds-touchpad-definitions.h Tue Mar 3 03:37:06 2009
@@ -20,8 +20,6 @@
#ifndef __GPDS_TOUCHPAD_GCONF_H__
#define __GPDS_TOUCHPAD_GCONF_H__
-#define GPDS_TOUCHPAD_DEVICE_NAME "SynPS/2 Synaptics TouchPad"
-
#define GPDS_TOUCHPAD_GCONF_DIR "/desktop/gnome/peripherals/touchpad"
#define GPDS_TOUCHPAD_EDGES_KEY GPDS_TOUCHPAD_GCONF_DIR "/edges"
Modified: trunk/modules/common/gpds-touchpad-xinput.c
==============================================================================
--- trunk/modules/common/gpds-touchpad-xinput.c (original)
+++ trunk/modules/common/gpds-touchpad-xinput.c Tue Mar 3 03:37:06 2009
@@ -26,6 +26,14 @@
#include <gconf/gconf-client.h>
#include <gpds-xinput.h>
+static const gchar *touchpad_device_names[] =
+{
+ "SynPS/2 Synaptics TouchPad",
+ "AlpsPS/2 ALPS GlidePoint"
+};
+
+static const gint n_touchpad_device_names = G_N_ELEMENTS(touchpad_device_names);
+
static GpdsTouchpadXInputProperty properties[] = {
{GPDS_TOUCHPAD_EDGES, "Synaptics Edges", 32, 4},
{GPDS_TOUCHPAD_FINGER, "Synaptics Finger", 32, 3},
@@ -101,6 +109,18 @@
return -1;
}
+const gchar *
+gpds_touchpad_xinput_find_device_name (void)
+{
+ gint i;
+
+ for (i = 0; i < n_touchpad_device_names; i++) {
+ if (gpds_xinput_exist_device(touchpad_device_names[i]))
+ return touchpad_device_names[i];
+ }
+ return NULL;
+}
+
/*
vi:ts=4:nowrap:ai:expandtab:sw=4
Modified: trunk/modules/common/gpds-touchpad-xinput.h
==============================================================================
--- trunk/modules/common/gpds-touchpad-xinput.h (original)
+++ trunk/modules/common/gpds-touchpad-xinput.h Tue Mar 3 03:37:06 2009
@@ -80,6 +80,7 @@
const gchar *gpds_touchpad_xinput_get_name (GpdsTouchpadProperty property);
gint gpds_touchpad_xinput_get_format_type (GpdsTouchpadProperty property);
gint gpds_touchpad_xinput_get_max_value_count (GpdsTouchpadProperty property);
+const gchar *gpds_touchpad_xinput_find_device_name (void);
#endif /* __GPDS_TOUCHPAD_XINPUT_H__ */
/*
Modified: trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c
==============================================================================
--- trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c (original)
+++ trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c Tue Mar 3 03:37:06 2009
@@ -84,11 +84,16 @@
const gchar *key;
GpdsXInput *xinput;
gint properties[4];
+ const gchar *device_name;
- if (!gpds_xinput_exist_device(GPDS_TOUCHPAD_DEVICE_NAME))
+ device_name = gpds_touchpad_xinput_find_device_name();
+ if (!device_name)
return;
- xinput = gpds_xinput_new(GPDS_TOUCHPAD_DEVICE_NAME);
+ if (!gpds_xinput_exist_device(device_name))
+ return;
+
+ xinput = gpds_xinput_new(device_name);
value = gconf_entry_get_value(entry);
key = gconf_entry_get_key(entry);
Modified: trunk/modules/gpds-touchpad-ui.c
==============================================================================
--- trunk/modules/gpds-touchpad-ui.c (original)
+++ trunk/modules/gpds-touchpad-ui.c Tue Mar 3 03:37:06 2009
@@ -30,14 +30,6 @@
#include "gpds-touchpad-definitions.h"
#include "gpds-touchpad-xinput.h"
-static const gchar *touchpad_device_names[] =
-{
- "SynPS/2 Synaptics TouchPad",
- "AlpsPS/2 ALPS GlidePoint"
-};
-
-static const gint n_touchpad_device_names = G_N_ELEMENTS(touchpad_device_names);
-
#define GPDS_TYPE_TOUCHPAD_UI (gpds_touchpad_ui_get_type())
#define GPDS_TOUCHPAD_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GPDS_TYPE_TOUCHPAD_UI, GpdsTouchpadUI))
#define GPDS_TOUCHPAD_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GPDS_TYPE_TOUCHPAD_UI, GpdsTouchpadUIClass))
@@ -714,23 +706,11 @@
set_circular_scrolling_trigger_property_from_preference(touchpad_ui, builder);
}
-static const gchar *
-find_device_name (void)
-{
- gint i;
-
- for (i = 0; i < n_touchpad_device_names; i++) {
- if (gpds_xinput_exist_device(touchpad_device_names[i]))
- return touchpad_device_names[i];
- }
- return NULL;
-}
-
static gboolean
is_available (GpdsUI *ui, GError **error)
{
const gchar *device_name;
- device_name = find_device_name();
+ device_name = gpds_touchpad_xinput_find_device_name();
if (!device_name) {
g_set_error(error,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]