summaryrefslogtreecommitdiff
path: root/panels
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2018-01-23 15:47:53 +1300
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2018-01-23 00:59:53 -0200
commitd9f0b737ac8783458ff40c5d99dad7788212945b (patch)
treec7b7cf628e184fc6c6c20b60a8d09a32776e240d /panels
parent1e62c99f416ce0695e388b5ad57e790223254d1b (diff)
downloadgnome-control-center-d9f0b737ac8783458ff40c5d99dad7788212945b.tar.gz
mouse: Use g_auto for variables
https://bugzilla.gnome.org/show_bug.cgi?id=792808
Diffstat (limited to 'panels')
-rw-r--r--panels/mouse/cc-mouse-caps-helper.c8
-rw-r--r--panels/mouse/gnome-mouse-properties.c2
-rw-r--r--panels/mouse/gnome-mouse-test.c7
3 files changed, 8 insertions, 9 deletions
diff --git a/panels/mouse/cc-mouse-caps-helper.c b/panels/mouse/cc-mouse-caps-helper.c
index 65e11df67..acbe9c94a 100644
--- a/panels/mouse/cc-mouse-caps-helper.c
+++ b/panels/mouse/cc-mouse-caps-helper.c
@@ -30,7 +30,8 @@ touchpad_check_capabilities_x11 (gboolean *have_two_finger_scrolling,
gboolean *have_tap_to_click)
{
Display *display;
- GList *devicelist, *l;
+ g_autoptr(GList) devicelist = NULL;
+ GList *l;
Atom realtype, prop_scroll_methods, prop_tapping_enabled;
int realformat;
unsigned long nitems, bytes_after;
@@ -79,7 +80,6 @@ touchpad_check_capabilities_x11 (gboolean *have_two_finger_scrolling,
XFree (data);
}
}
- g_list_free (devicelist);
gdk_error_trap_pop_ignored ();
@@ -106,7 +106,8 @@ gboolean
cc_synaptics_check (void)
{
Display *display;
- GList *devicelist, *l;
+ g_autoptr(GList) devicelist = NULL;
+ GList *l;
Atom prop, realtype;
int realformat;
unsigned long nitems, bytes_after;
@@ -136,7 +137,6 @@ cc_synaptics_check (void)
if (have_synaptics)
break;
}
- g_list_free (devicelist);
gdk_error_trap_pop_ignored ();
diff --git a/panels/mouse/gnome-mouse-properties.c b/panels/mouse/gnome-mouse-properties.c
index 95a74e418..4d0920b2d 100644
--- a/panels/mouse/gnome-mouse-properties.c
+++ b/panels/mouse/gnome-mouse-properties.c
@@ -369,7 +369,7 @@ static void
cc_mouse_properties_init (CcMouseProperties *object)
{
CcMousePropertiesPrivate *d = object->priv = CC_MOUSE_PROPERTIES_GET_PRIVATE (object);
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
d->builder = gtk_builder_new ();
gtk_builder_add_from_resource (d->builder,
diff --git a/panels/mouse/gnome-mouse-test.c b/panels/mouse/gnome-mouse-test.c
index b0d251ed0..dac306737 100644
--- a/panels/mouse/gnome-mouse-test.c
+++ b/panels/mouse/gnome-mouse-test.c
@@ -117,8 +117,8 @@ scroll_image_timeout (CcMouseTestPrivate *d)
static void
setup_information_label (CcMouseTestPrivate *d)
{
- gchar *message = NULL;
- gchar *label_text = NULL;
+ const gchar *message = NULL;
+ g_autofree gchar *label_text = NULL;
gboolean double_click;
if (d->information_label_timeout_id != 0) {
@@ -150,7 +150,6 @@ setup_information_label (CcMouseTestPrivate *d)
label_text = g_strconcat ("<b>", message, "</b>", NULL);
gtk_label_set_markup (GTK_LABEL (WID ("information_label")), label_text);
- g_free (label_text);
d->information_label_timeout_id = g_timeout_add (2500, (GSourceFunc) information_label_timeout, d);
}
@@ -361,7 +360,7 @@ static void
cc_mouse_test_init (CcMouseTest *object)
{
CcMouseTestPrivate *d = object->priv = CC_MOUSE_TEST_GET_PRIVATE (object);
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
d->builder = gtk_builder_new ();
gtk_builder_add_from_resource (d->builder,