Commit 8ed5d7a5 authored by Robert Ancell's avatar Robert Ancell Committed by Robert Ancell

wacom: Use g_auto for variables

parent b181fccc
Pipeline #60647 passed with stages
in 7 minutes and 45 seconds
......@@ -44,54 +44,49 @@ G_DEFINE_TYPE (CcTabletToolMap, cc_tablet_tool_map, G_TYPE_OBJECT)
static void
load_keyfiles (CcTabletToolMap *map)
{
GError *error = NULL;
gchar *dir;
g_autoptr(GError) devices_error = NULL;
g_autoptr(GError) tools_error = NULL;
g_autofree gchar *dir = NULL;
dir = g_build_filename (g_get_user_cache_dir (), "gnome-control-center", "wacom", NULL);
if (g_mkdir_with_parents (dir, 0700) < 0) {
g_warning ("Could not create directory '%s', expect stylus mapping oddities: %m", dir);
g_free (dir);
return;
}
map->tablet_path = g_build_filename (dir, "devices", NULL);
g_key_file_load_from_file (map->tablets, map->tablet_path,
G_KEY_FILE_NONE, &error);
G_KEY_FILE_NONE, &devices_error);
if (error && !g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
if (devices_error && !g_error_matches (devices_error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
g_warning ("Could not load tablets keyfile '%s': %s",
map->tablet_path, error->message);
map->tablet_path, devices_error->message);
}
g_clear_error (&error);
map->tool_path = g_build_filename (dir, "tools", NULL);
g_key_file_load_from_file (map->tools, map->tool_path,
G_KEY_FILE_NONE, &error);
G_KEY_FILE_NONE, &tools_error);
if (error && !g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
if (tools_error && !g_error_matches (tools_error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
g_warning ("Could not load tools keyfile '%s': %s",
map->tool_path, error->message);
map->tool_path, tools_error->message);
}
g_clear_error (&error);
g_free (dir);
}
static void
cache_tools (CcTabletToolMap *map)
{
gchar **serials;
g_auto(GStrv) serials = NULL;
gsize n_serials, i;
serials = g_key_file_get_groups (map->tools, &n_serials);
for (i = 0; i < n_serials; i++) {
gchar *str, *end;
g_autofree gchar *str = NULL;
gchar *end;
guint64 serial, id;
GError *error = NULL;
g_autoptr(GError) error = NULL;
CcWacomTool *tool;
serial = g_ascii_strtoull (serials[i], &end, 16);
......@@ -102,26 +97,21 @@ cache_tools (CcTabletToolMap *map)
}
str = g_key_file_get_string (map->tools, serials[i], KEY_TOOL_ID, &error);
if (error) {
if (str == NULL) {
g_warning ("Could not get cached ID for tool with serial %s: %s",
serials[i], error->message);
g_clear_error (&error);
continue;
}
id = g_ascii_strtoull (str, &end, 16);
if (*end != '\0') {
g_warning ("Invalid tool ID %s", str);
g_free (str);
continue;
}
tool = cc_wacom_tool_new (serial, id, NULL);
g_hash_table_insert (map->tool_map, g_strdup (serials[i]), tool);
g_free (str);
}
g_strfreev (serials);
}
static void
......@@ -135,14 +125,13 @@ cache_devices (CcTabletToolMap *map)
for (i = 0; i < n_ids; i++) {
gchar **styli;
gsize n_styli, j;
GError *error = NULL;
g_autoptr(GError) error = NULL;
GList *tools = NULL;
styli = g_key_file_get_string_list (map->tablets, ids[i], KEY_DEVICE_STYLI, &n_styli, &error);
if (error) {
if (styli == NULL) {
g_warning ("Could not get cached styli for with ID %s: %s",
ids[i], error->message);
g_clear_error (&error);
continue;
}
......@@ -254,7 +243,7 @@ cc_tablet_tool_map_list_tools (CcTabletToolMap *map,
{
CcWacomTool *no_serial_tool;
GList *styli;
gchar *key;
g_autofree gchar *key = NULL;
g_return_val_if_fail (CC_IS_TABLET_TOOL_MAP (map), NULL);
g_return_val_if_fail (CC_IS_WACOM_DEVICE (device), NULL);
......@@ -274,8 +263,6 @@ cc_tablet_tool_map_list_tools (CcTabletToolMap *map,
styli = g_list_prepend (styli, no_serial_tool);
}
g_free (key);
return styli;
}
......@@ -285,7 +272,7 @@ cc_tablet_tool_map_lookup_tool (CcTabletToolMap *map,
guint64 serial)
{
CcWacomTool *tool = NULL;
gchar *key = NULL;
g_autofree gchar *key = NULL;
g_return_val_if_fail (CC_IS_TABLET_TOOL_MAP (map), FALSE);
g_return_val_if_fail (CC_IS_WACOM_DEVICE (device), FALSE);
......@@ -298,8 +285,6 @@ cc_tablet_tool_map_lookup_tool (CcTabletToolMap *map,
tool = g_hash_table_lookup (map->tool_map, key);
}
g_free (key);
return tool;
}
......@@ -308,8 +293,8 @@ keyfile_add_device_stylus (CcTabletToolMap *map,
const gchar *device_key,
const gchar *tool_key)
{
GArray *array;
gchar **styli;
g_autoptr(GArray) array = NULL;
g_auto(GStrv) styli = NULL;
gsize n_styli;
array = g_array_new (FALSE, FALSE, sizeof (gchar *));
......@@ -324,8 +309,6 @@ keyfile_add_device_stylus (CcTabletToolMap *map,
g_array_append_val (array, tool_key);
g_key_file_set_string_list (map->tablets, device_key, KEY_DEVICE_STYLI,
(const gchar **) array->data, array->len);
g_array_free (array, TRUE);
g_strfreev (styli);
}
static void
......@@ -333,12 +316,11 @@ keyfile_add_stylus (CcTabletToolMap *map,
const gchar *tool_key,
guint64 id)
{
gchar *str;
g_autofree gchar *str = NULL;
/* Also works for IDs */
str = get_tool_key (id);
g_key_file_set_string (map->tools, tool_key, KEY_TOOL_ID, str);
g_free (str);
}
void
......@@ -348,8 +330,8 @@ cc_tablet_tool_map_add_relation (CcTabletToolMap *map,
{
gboolean tablets_changed = FALSE, tools_changed = FALSE;
gboolean new_tool_without_serial = FALSE;
gchar *tool_key, *device_key;
GError *error = NULL;
g_autofree gchar *tool_key = NULL;
g_autofree gchar *device_key = NULL;
guint64 serial, id;
GList *styli;
......@@ -396,26 +378,21 @@ cc_tablet_tool_map_add_relation (CcTabletToolMap *map,
}
}
g_free (device_key);
g_free (tool_key);
if (tools_changed) {
g_key_file_save_to_file (map->tools, map->tool_path, &error);
g_autoptr(GError) error = NULL;
if (error) {
if (!g_key_file_save_to_file (map->tools, map->tool_path, &error)) {
g_warning ("Error saving tools keyfile: %s",
error->message);
g_clear_error (&error);
}
}
if (tablets_changed) {
g_key_file_save_to_file (map->tablets, map->tablet_path, &error);
g_autoptr(GError) error = NULL;
if (error) {
if (!g_key_file_save_to_file (map->tablets, map->tablet_path, &error)) {
g_warning ("Error saving tablets keyfile: %s",
error->message);
g_clear_error (&error);
}
}
}
......@@ -81,7 +81,7 @@ cc_wacom_button_row_update_shortcut (CcWacomButtonRow *row,
{
guint keyval;
GdkModifierType mask;
char *shortcut;
g_autofree gchar *shortcut = NULL;
if (action_type != G_DESKTOP_PAD_BUTTON_ACTION_KEYBINDING)
return;
......@@ -96,8 +96,6 @@ cc_wacom_button_row_update_shortcut (CcWacomButtonRow *row,
"key-value", keyval,
"key-mods", mask,
NULL);
g_free (shortcut);
}
}
......@@ -156,7 +154,7 @@ static void
on_key_shortcut_edited (GsdWacomKeyShortcutButton *shortcut_button,
CcWacomButtonRow *row)
{
char *custom_key;
g_autofree gchar *custom_key = NULL;
guint keyval;
GdkModifierType mask;
......@@ -172,8 +170,6 @@ on_key_shortcut_edited (GsdWacomKeyShortcutButton *shortcut_button,
custom_key = gtk_accelerator_name (keyval, mask);
g_settings_set_string (row->settings, KEYBINDING_KEY, custom_key);
g_free (custom_key);
}
static void
......@@ -238,7 +234,7 @@ cc_wacom_button_row_new (guint button,
{
CcWacomButtonRow *row;
GtkWidget *grid, *combo, *label, *shortcut_button;
char *name = NULL;
g_autofree gchar *name = NULL;
row = CC_WACOM_BUTTON_ROW (g_object_new (CC_WACOM_TYPE_BUTTON_ROW, NULL));
......@@ -282,7 +278,5 @@ cc_wacom_button_row_new (guint button,
cc_wacom_button_row_update (CC_WACOM_BUTTON_ROW (row));
g_free (name);
return GTK_WIDGET (row);
}
......@@ -266,7 +266,9 @@ find_output_by_edid (GnomeRRScreen *rr_screen,
rr_outputs = gnome_rr_screen_list_outputs (rr_screen);
for (i = 0; rr_outputs[i] != NULL; i++) {
gchar *o_vendor, *o_product, *o_serial;
g_autofree gchar *o_vendor = NULL;
g_autofree gchar *o_product = NULL;
g_autofree gchar *o_serial = NULL;
gboolean match;
gnome_rr_output_get_ids_from_edid (rr_outputs[i],
......@@ -281,10 +283,6 @@ find_output_by_edid (GnomeRRScreen *rr_screen,
(g_strcmp0 (product, o_product) == 0) && \
(g_strcmp0 (serial, o_serial) == 0);
g_free (o_vendor);
g_free (o_product);
g_free (o_serial);
if (match) {
retval = rr_outputs[i];
break;
......@@ -302,10 +300,9 @@ static GnomeRROutput *
find_output (GnomeRRScreen *rr_screen,
CcWacomDevice *device)
{
GSettings *settings;
GVariant *variant;
const gchar **edid;
GnomeRROutput *ret = NULL;
g_autoptr(GSettings) settings = NULL;
g_autoptr(GVariant) variant = NULL;
g_autofree const gchar **edid = NULL;
gsize n;
settings = cc_wacom_device_get_settings (device);
......@@ -314,20 +311,13 @@ find_output (GnomeRRScreen *rr_screen,
if (n != 3) {
g_critical ("Expected 'output' key to store %d values; got %"G_GSIZE_FORMAT".", 3, n);
goto out;
return NULL;
}
if (strlen (edid[0]) == 0 || strlen (edid[1]) == 0 || strlen (edid[2]) == 0)
goto out;
ret = find_output_by_edid (rr_screen, edid[0], edid[1], edid[2]);
out:
g_free (edid);
g_variant_unref (variant);
g_object_unref (settings);
return NULL;
return ret;
return find_output_by_edid (rr_screen, edid[0], edid[1], edid[2]);
}
GnomeRROutput *
......@@ -359,8 +349,10 @@ void
cc_wacom_device_set_output (CcWacomDevice *device,
GnomeRROutput *output)
{
GSettings *settings;
gchar *vendor, *product, *serial;
g_autoptr(GSettings) settings = NULL;
g_autofree gchar *vendor = NULL;
g_autofree gchar *product = NULL;
g_autofree gchar *serial = NULL;
const gchar *values[] = { "", "", "", NULL };
g_return_if_fail (CC_IS_WACOM_DEVICE (device));
......@@ -379,11 +371,6 @@ cc_wacom_device_set_output (CcWacomDevice *device,
}
g_settings_set_strv (settings, "output", values);
g_free (vendor);
g_free (product);
g_free (serial);
g_object_unref (settings);
}
guint
......@@ -398,8 +385,10 @@ GSettings *
cc_wacom_device_get_button_settings (CcWacomDevice *device,
guint button)
{
GSettings *tablet_settings, *settings;
gchar *path, *button_path;
g_autoptr(GSettings) tablet_settings = NULL;
GSettings *settings;
g_autofree gchar *path = NULL;
g_autofree gchar *button_path = NULL;
g_return_val_if_fail (CC_IS_WACOM_DEVICE (device), NULL);
......@@ -412,9 +401,6 @@ cc_wacom_device_get_button_settings (CcWacomDevice *device,
button_path = g_strdup_printf ("%sbutton%c/", path, 'A' + button);
settings = g_settings_new_with_path ("org.gnome.desktop.peripherals.tablet.pad-button",
button_path);
g_free (path);
g_free (button_path);
g_object_unref (tablet_settings);
return settings;
}
......@@ -77,7 +77,7 @@ set_combobox_sensitive (CcWacomMappingPanel *self,
static void
update_monitor_chooser (CcWacomMappingPanel *self)
{
GtkListStore *store;
g_autoptr(GtkListStore) store = NULL;
GnomeRROutput **outputs;
GSettings *settings;
GnomeRROutput *cur_output;
......@@ -88,7 +88,6 @@ update_monitor_chooser (CcWacomMappingPanel *self)
if (self->device == NULL) {
set_combobox_sensitive (self, FALSE);
g_object_unref (store);
return;
}
......@@ -105,8 +104,8 @@ update_monitor_chooser (CcWacomMappingPanel *self)
g_signal_handlers_unblock_by_func (G_OBJECT (self->aspectswitch), aspectswitch_toggled_cb, self);
if (!self->rr_screen) {
cur_output = NULL;
goto bail;
set_combobox_sensitive (self, FALSE);
return;
}
outputs = gnome_rr_screen_list_outputs (self->rr_screen);
......@@ -119,7 +118,7 @@ update_monitor_chooser (CcWacomMappingPanel *self)
if (crtc && gnome_rr_crtc_get_current_mode (crtc) != NULL) {
GtkTreeIter iter;
const gchar *name, *disp_name;
gchar *text;
g_autofree gchar *text = NULL;
name = gnome_rr_output_get_name (output);
disp_name = gnome_rr_output_get_display_name (output);
......@@ -133,14 +132,10 @@ update_monitor_chooser (CcWacomMappingPanel *self)
gtk_combo_box_set_active_iter (GTK_COMBO_BOX(self->combobox), &iter);
g_signal_handlers_unblock_by_func (G_OBJECT (self->combobox), combobox_changed_cb, self);
}
g_free (text);
}
}
bail:
set_combobox_sensitive (self, cur_output != NULL);
g_object_unref (store);
}
static void
......@@ -231,14 +226,12 @@ cc_wacom_mapping_panel_init (CcWacomMappingPanel *self)
{
GtkWidget *vbox, *grid;
GtkCellRenderer *renderer;
GError *error = NULL;
g_autoptr(GError) error = NULL;
self->rr_screen = gnome_rr_screen_new (gdk_screen_get_default (), &error);
if (error) {
if (error)
g_warning ("Could not get RR screen: %s", error->message);
g_error_free (error);
}
g_signal_connect_swapped (self->rr_screen, "changed",
G_CALLBACK (update_monitor_chooser), self);
......
......@@ -140,8 +140,8 @@ cc_wacom_nav_button_set_property (GObject *object,
g_signal_handler_disconnect (nav->notebook, nav->page_added_id);
g_signal_handler_disconnect (nav->notebook, nav->page_removed_id);
g_signal_handler_disconnect (nav->notebook, nav->page_switched_id);
g_object_unref (nav->notebook);
}
g_clear_object (&nav->notebook);
nav->notebook = g_value_dup_object (value);
nav->page_added_id = g_signal_connect (G_OBJECT (nav->notebook), "page-added",
G_CALLBACK (pages_changed), nav);
......@@ -172,8 +172,7 @@ cc_wacom_nav_button_dispose (GObject *object)
self->page_removed_id = 0;
g_signal_handler_disconnect (self->notebook, self->page_switched_id);
self->page_switched_id = 0;
g_object_unref (self->notebook);
self->notebook = NULL;
g_clear_object (&self->notebook);
}
G_OBJECT_CLASS (cc_wacom_nav_button_parent_class)->dispose (object);
......
......@@ -148,7 +148,7 @@ set_calibration (CcWacomDevice *device,
{
GVariant *current; /* current calibration */
GVariant *array; /* new calibration */
GVariant **tmp;
g_autofree GVariant **tmp = NULL;
gsize nvalues;
gint i;
......@@ -166,8 +166,6 @@ set_calibration (CcWacomDevice *device,
array = g_variant_new_array (G_VARIANT_TYPE_DOUBLE, tmp, nvalues);
g_settings_set_value (settings, "area", array);
g_free (tmp);
g_debug ("Setting area to %f, %f, %f, %f (left/right/top/bottom) (last used resolution: %d x %d)",
cal[0], cal[1], cal[2], cal[3],
display_width, display_height);
......@@ -216,7 +214,8 @@ cc_wacom_page_get_gdk_device (CcWacomPage *page)
GdkDevice *gdk_device = NULL;
GdkDisplay *display;
GdkSeat *seat;
GList *slaves, *l;
g_autoptr(GList) slaves = NULL;
GList *l;
gsd_device = cc_wacom_device_get_device (page->stylus);
g_return_val_if_fail (GSD_IS_DEVICE (gsd_device), NULL);
......@@ -226,7 +225,7 @@ cc_wacom_page_get_gdk_device (CcWacomPage *page)
slaves = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_TABLET_STYLUS);
for (l = slaves; l && !gdk_device; l = l->next) {
gchar *device_node = NULL;
g_autofree gchar *device_node = NULL;
if (gdk_device_get_source (l->data) != GDK_SOURCE_PEN)
continue;
......@@ -242,12 +241,8 @@ cc_wacom_page_get_gdk_device (CcWacomPage *page)
if (g_strcmp0 (device_node, gsd_device_get_device_file (gsd_device)) == 0)
gdk_device = l->data;
g_free (device_node);
}
g_list_free (slaves);
return gdk_device;
}
......@@ -289,21 +284,21 @@ static void
calibrate (CcWacomPage *page)
{
int i;
GVariant *old_calibration, **tmp, *array;
gdouble *calibration;
GVariant *old_calibration, *array;
g_autofree GVariant **tmp = NULL;
g_autofree gdouble *calibration = NULL;
gsize ncal;
GdkMonitor *monitor;
GdkScreen *screen;
GnomeRRScreen *rr_screen;
g_autoptr(GnomeRRScreen) rr_screen = NULL;
GnomeRROutput *output;
GError *error = NULL;
g_autoptr(GError) error = NULL;
gint x, y;
screen = gdk_screen_get_default ();
rr_screen = gnome_rr_screen_new (screen, &error);
if (error) {
g_warning ("Could not connect to display manager: %s", error->message);
g_error_free (error);
return;
}
......@@ -339,13 +334,9 @@ calibrate (CcWacomPage *page)
array = g_variant_new_array (G_VARIANT_TYPE_DOUBLE, tmp, ncal);
g_settings_set_value (page->wacom_settings, "area", array);
g_free (tmp);
run_calibration (page, old_calibration, calibration, monitor);
g_free (calibration);
gtk_widget_set_sensitive (WID ("button-calibrate"), FALSE);
g_object_unref (rr_screen);
}
static void
......@@ -408,15 +399,14 @@ button_mapping_dialog_closed (GtkDialog *dialog,
CcWacomPage *page)
{
gtk_widget_destroy (MWID ("button-mapping-dialog"));
g_object_unref (page->mapping_builder);
page->mapping_builder = NULL;
g_clear_object (&page->mapping_builder);
}
static void
show_button_mapping_dialog (CcWacomPage *page)
{
GtkWidget *toplevel;
GError *error = NULL;
g_autoptr(GError) error = NULL;
GtkWidget *dialog;
g_assert (page->mapping_builder == NULL);
......@@ -427,9 +417,7 @@ show_button_mapping_dialog (CcWacomPage *page)
if (error != NULL) {
g_warning ("Error loading UI file: %s", error->message);
g_object_unref (page->mapping_builder);
page->mapping_builder = NULL;
g_error_free (error);
g_clear_object (&page->mapping_builder);
return;
}
......@@ -453,7 +441,7 @@ set_osd_visibility_cb (GObject *source_object,
GAsyncResult *res,
gpointer data)
{
GError *error = NULL;
g_autoptr(GError) error = NULL;
GVariant *result;
CcWacomPage *page;
......@@ -464,10 +452,8 @@ set_osd_visibility_cb (GObject *source_object,
if (result == NULL) {
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
g_printerr ("Error setting OSD's visibility: %s\n", error->message);
g_error_free (error);
show_button_mapping_dialog (page);
} else {
g_error_free (error);
return;
}
}
......@@ -655,36 +641,13 @@ cc_wacom_page_dispose (GObject *object)
{
CcWacomPage *self = CC_WACOM_PAGE (object);
if (self->cancellable) {
g_cancellable_cancel (self->cancellable);
g_clear_object (&self->cancellable);
}
if (self->area) {
calib_area_free (self->area);
self->area = NULL;
}
if (self->button_map) {
gtk_widget_destroy (self->button_map);
self->button_map = NULL;
}
if (self->dialog) {
gtk_widget_destroy (self->dialog);
self->dialog = NULL;
}
if (self->builder) {
g_object_unref (self->builder);
self->builder = NULL;
}
if (self->header_group) {
g_object_unref (self->header_group);
self->header_group = NULL;
}
g_cancellable_cancel (self->cancellable);
g_clear_object (&self->cancellable);
g_clear_pointer (&self->area, calib_area_free);
g_clear_pointer (&self->button_map, gtk_widget_destroy);
g_clear_pointer (&self->dialog, gtk_widget_destroy);
g_clear_object (&self->builder);
g_clear_object (&self->header_group);
self->panel = NULL;
......@@ -717,7 +680,7 @@ remove_link_padding (GtkWidget *widget)
static void
cc_wacom_page_init (CcWacomPage *page)
{
GError *error = NULL;
g_autoptr(GError) error = NULL;
GtkComboBox *combo;
GtkWidget *box;
GtkSwitch *sw;
......@@ -738,8 +701,6 @@ cc_wacom_page_init (CcWacomPage *page)
&error);
if (error != NULL) {
g_warning ("Error loading UI file: %s", error->message);
g_object_unref (page->builder);
g_error_free (error);
return;
}
......@@ -786,11 +747,10 @@ set_icon_name (CcWacomPage *page,
const char *widget_name,
const char *icon_name)
{
char *resource;
g_autofree gchar *resource = NULL;
resource = g_strdup_printf ("/org/gnome/control-center/wacom/%s.svg", icon_name);
gtk_image_set_from_resource (GTK_IMAGE (WID (widget_name)), resource);
g_free (resource);
}
static void
......
......@@ -146,7 +146,8 @@ set_device_page (CcWacomPanel *self, const gchar *device_name)
static void
run_operation_from_params (CcWacomPanel *self, GVariant *parameters)
{
GVariant *v;
g_autoptr(GVariant) v = NULL;
g_autoptr(GVariant) v2 = NULL;
CcWacomPage *page;
const gchar *operation = NULL;
const gchar *device_name = NULL;
......@@ -160,28 +161,23 @@ run_operation_from_params (CcWacomPanel *self, GVariant *parameters)
if (!g_variant_is_of_type (v, G_VARIANT_TYPE_STRING)) {
g_warning ("Wrong type for the second argument GVariant, expected 's' but got '%s'",
g_variant_get_type_string (v));
g_variant_unref (v);
return;
}
g_variant_unref (v);
switch (n_params) {
case 3:
page = set_device_page (self, device_name);
if (page == NULL)
return;
g_variant_get_child (parameters, 1, "v", &v);
g_variant_get_child (parameters, 1, "v", &v2);
if (!g_variant_is_of_type (v, G_VARIANT_TYPE_STRING)) {
if (!g_variant_is_of_type (v2, G_VARIANT_TYPE_STRING)) {
g_warning ("Wrong type for the operation name argument. A string is expected.");
g_variant_unref (v);
break;
}
operation = g_variant_get_string (v, NULL);
operation = g_variant_get_string (v2, NULL);
if (g_strcmp0 (operation, "run-calibration") == 0) {
if (cc_wacom_page_can_calibrate (page))
cc_wacom_page_calibrate (page);
......@@ -190,7 +186,6 @@ run_operation_from_params (CcWacomPanel *self, GVariant *parameters)
} else {
g_warning ("Ignoring unrecognized operation '%s'", operation);
}
g_variant_unref (v);
case 2:
set_device_page (self, device_name);
break;
......@@ -248,11 +243,7 @@ cc_wacom_panel_dispose (GObject *object)
{
CcWacomPanel *self = CC_WACOM_PANEL (object);
if (self->builder)
{
g_object_unref (self->builder);
self->builder = NULL;
}
g_clear_object (&self->builder);