Commit 359559ec authored by Jonh Wendell's avatar Jonh Wendell Committed by Jonh Wendell S. Santana
Browse files

Some adjusts in GObject destructors. Also removed some deprecated gtk+

2008-12-11  Jonh Wendell <jwendell@gnome.org>

	* lots of files: Some adjusts in GObject destructors. Also removed
	some deprecated gtk+ symbols, closes #563462.


svn path=/trunk/; revision=534
parent 96dbfdab
2008-12-11 Jonh Wendell <jwendell@gnome.org>
* lots of files: Some adjusts in GObject destructors. Also removed
some deprecated gtk+ symbols, closes #563462.
2008-12-11 Jonh Wendell <jwendell@gnome.org>
* lots of files: Folders in bookmarks, closes #549649.
......
......@@ -43,26 +43,13 @@ vinagre_bookmarks_entry_init (VinagreBookmarksEntry *entry)
entry->priv->parent = NULL;
}
static void
vinagre_bookmarks_entry_clear (VinagreBookmarksEntry *entry)
{
if (entry->priv->node == VINAGRE_BOOKMARKS_ENTRY_NODE_FOLDER)
{
g_free (entry->priv->name);
g_slist_free (entry->priv->children);
}
}
static void
vinagre_bookmarks_entry_finalize (GObject *object)
{
VinagreBookmarksEntry *entry = VINAGRE_BOOKMARKS_ENTRY (object);
if (entry->priv->node == VINAGRE_BOOKMARKS_ENTRY_NODE_FOLDER)
{
g_free (entry->priv->name);
g_slist_free (entry->priv->children);
}
g_free (entry->priv->name);
G_OBJECT_CLASS (vinagre_bookmarks_entry_parent_class)->finalize (object);
}
......@@ -86,6 +73,7 @@ vinagre_bookmarks_entry_dispose (GObject *object)
if (entry->priv->children)
{
g_slist_foreach (entry->priv->children, (GFunc) g_object_unref, NULL);
g_slist_free (entry->priv->children);
entry->priv->children = NULL;
}
break;
......
......@@ -190,22 +190,14 @@ vinagre_bookmarks_tree_init (VinagreBookmarksTree *tree)
gtk_widget_show (tree->priv->tree);
}
static void
vinagre_bookmarks_tree_finalize (GObject *object)
{
G_OBJECT_CLASS (vinagre_bookmarks_tree_parent_class)->finalize (object);
}
static void
vinagre_bookmarks_tree_class_init (VinagreBookmarksTreeClass *klass)
{
GObjectClass* object_class = G_OBJECT_CLASS (klass);
object_class->finalize = vinagre_bookmarks_tree_finalize;
g_type_class_add_private (object_class, sizeof (VinagreBookmarksTreePrivate));
}
GtkWidget *
vinagre_bookmarks_tree_new (void)
{
......
......@@ -90,19 +90,10 @@ vinagre_connection_finalize (GObject *object)
VinagreConnection *conn = VINAGRE_CONNECTION (object);
g_free (conn->priv->host);
conn->priv->host = NULL;
g_free (conn->priv->username);
conn->priv->username = NULL;
g_free (conn->priv->password);
conn->priv->password = NULL;
g_free (conn->priv->name);
conn->priv->name = NULL;
g_free (conn->priv->desktop_name);
conn->priv->desktop_name = NULL;
G_OBJECT_CLASS (vinagre_connection_parent_class)->finalize (object);
}
......
......@@ -73,12 +73,6 @@ enum
static guint signals[LAST_SIGNAL] = { 0 };
static void
vinagre_fav_finalize (GObject *object)
{
G_OBJECT_CLASS (vinagre_fav_parent_class)->finalize (object);
}
static void
vinagre_fav_set_property (GObject *object,
guint prop_id,
......@@ -124,7 +118,6 @@ vinagre_fav_class_init (VinagreFavClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = vinagre_fav_finalize;
object_class->get_property = vinagre_fav_get_property;
object_class->set_property = vinagre_fav_set_property;
......@@ -312,9 +305,6 @@ show_popup_menu (VinagreFav *fav,
fav,
0,
gtk_get_current_event_time ());
//gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE);
}
return TRUE;
......
......@@ -187,25 +187,30 @@ vinagre_mdns_init (VinagreMdns *mdns)
}
static void
vinagre_mdns_clear_entries (VinagreMdns *mdns)
{
g_slist_foreach (mdns->priv->entries, (GFunc) g_object_unref, NULL);
g_slist_free (mdns->priv->entries);
mdns->priv->entries = NULL;
}
static void
vinagre_mdns_finalize (GObject *object)
vinagre_mdns_dispose (GObject *object)
{
VinagreMdns *mdns = VINAGRE_MDNS (object);
g_object_unref (mdns->priv->browser);
g_object_unref (mdns->priv->client);
if (mdns->priv->browser)
{
g_object_unref (mdns->priv->browser);
mdns->priv->browser = NULL;
}
if (mdns->priv->client)
{
g_object_unref (mdns->priv->client);
mdns->priv->client = NULL;
}
vinagre_mdns_clear_entries (mdns);
if (mdns->priv->entries)
{
g_slist_foreach (mdns->priv->entries, (GFunc) g_object_unref, NULL);
g_slist_free (mdns->priv->entries);
mdns->priv->entries = NULL;
}
G_OBJECT_CLASS (vinagre_mdns_parent_class)->finalize (object);
G_OBJECT_CLASS (vinagre_mdns_parent_class)->dispose (object);
}
static void
......@@ -216,7 +221,7 @@ vinagre_mdns_class_init (VinagreMdnsClass *klass)
g_type_class_add_private (klass, sizeof (VinagreMdnsPrivate));
object_class->finalize = vinagre_mdns_finalize;
object_class->dispose = vinagre_mdns_dispose;
signals[MDNS_CHANGED] =
g_signal_new ("changed",
......
......@@ -208,7 +208,7 @@ build_tab_label (VinagreNotebook *nb,
rcstyle = gtk_rc_style_new ();
rcstyle->xthickness = rcstyle->ythickness = 0;
gtk_widget_modify_style (close_button, rcstyle);
gtk_rc_style_unref (rcstyle);
g_object_unref (rcstyle);
gint w, h;
gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &w, &h);
gtk_widget_set_size_request (GTK_WIDGET (close_button), w+2, h+2);
......
......@@ -184,20 +184,6 @@ vinagre_prefs_init (VinagrePrefs *prefs)
}
static void
vinagre_prefs_finalize (GObject *object)
{
VinagrePrefs *prefs = VINAGRE_PREFS (object);
gconf_client_remove_dir (prefs->priv->gconf_client,
VINAGRE_BASE_KEY,
NULL);
g_object_unref (prefs->priv->gconf_client);
prefs->priv->gconf_client = NULL;
G_OBJECT_CLASS (vinagre_prefs_parent_class)->finalize (object);
}
static void
vinagre_prefs_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
......@@ -290,6 +276,24 @@ vinagre_prefs_get_property (GObject *object, guint prop_id, GValue *value, GPara
}
}
static void
vinagre_prefs_dispose (GObject *object)
{
VinagrePrefs *prefs = VINAGRE_PREFS (object);
if (prefs->priv->gconf_client)
{
gconf_client_remove_dir (prefs->priv->gconf_client,
VINAGRE_BASE_KEY,
NULL);
g_object_unref (prefs->priv->gconf_client);
prefs->priv->gconf_client = NULL;
}
G_OBJECT_CLASS (vinagre_prefs_parent_class)->dispose (object);
}
static void
vinagre_prefs_class_init (VinagrePrefsClass *klass)
{
......@@ -298,7 +302,7 @@ vinagre_prefs_class_init (VinagrePrefsClass *klass)
g_type_class_add_private (klass, sizeof (VinagrePrefsPrivate));
object_class->finalize = vinagre_prefs_finalize;
object_class->dispose = vinagre_prefs_dispose;
object_class->set_property = vinagre_prefs_set_property;
object_class->get_property = vinagre_prefs_get_property;
......
......@@ -186,24 +186,36 @@ vinagre_tab_finalize (GObject *object)
{
VinagreTab *tab = VINAGRE_TAB (object);
g_signal_handlers_disconnect_by_func (tab->priv->window,
vinagre_tab_window_state_cb,
tab);
g_object_unref (tab->priv->conn);
tab->priv->conn = NULL;
g_free (tab->priv->clipboard_str);
tab->priv->clipboard_str = NULL;
G_OBJECT_CLASS (vinagre_tab_parent_class)->finalize (object);
}
static void
vinagre_tab_dispose (GObject *object)
{
VinagreTab *tab = VINAGRE_TAB (object);
if (tab->priv->conn)
{
g_signal_handlers_disconnect_by_func (tab->priv->window,
vinagre_tab_window_state_cb,
tab);
g_object_unref (tab->priv->conn);
tab->priv->conn = NULL;
}
G_OBJECT_CLASS (vinagre_tab_parent_class)->dispose (object);
}
static void
vinagre_tab_class_init (VinagreTabClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = vinagre_tab_finalize;
object_class->dispose = vinagre_tab_dispose;
object_class->get_property = vinagre_tab_get_property;
object_class->set_property = vinagre_tab_set_property;
......@@ -789,7 +801,6 @@ setup_layout (VinagreTab *tab)
tab->priv->toolbar = gtk_toolbar_new ();
GTK_WIDGET_SET_FLAGS (tab->priv->toolbar, GTK_NO_SHOW_ALL);
gtk_toolbar_set_tooltips (GTK_TOOLBAR (tab->priv->toolbar), TRUE);
gtk_toolbar_set_style (GTK_TOOLBAR (tab->priv->toolbar), GTK_TOOLBAR_BOTH_HORIZ);
/* Leave fullscreen */
......@@ -1066,7 +1077,7 @@ vinagre_tab_take_screenshot (VinagreTab *tab)
}
gtk_widget_destroy (dialog);
gdk_pixbuf_unref (pix);
g_object_unref (pix);
g_string_free (suggested_filename, TRUE);
g_free (name);
}
......
......@@ -54,7 +54,7 @@ vinagre_utils_create_small_close_button ()
rcstyle = gtk_rc_style_new ();
rcstyle->xthickness = rcstyle->ythickness = 0;
gtk_widget_modify_style (close_button, rcstyle);
gtk_rc_style_unref (rcstyle),
g_object_unref (rcstyle),
image = gtk_image_new_from_stock (GTK_STOCK_CLOSE,
GTK_ICON_SIZE_MENU);
......
......@@ -94,12 +94,6 @@ vinagre_window_dispose (GObject *object)
G_OBJECT_CLASS (vinagre_window_parent_class)->dispose (object);
}
static void
vinagre_window_finalize (GObject *object)
{
G_OBJECT_CLASS (vinagre_window_parent_class)->finalize (object);
}
static gboolean
vinagre_window_delete_event (GtkWidget *widget,
GdkEventAny *event)
......@@ -201,7 +195,6 @@ vinagre_window_class_init (VinagreWindowClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->finalize = vinagre_window_finalize;
object_class->dispose = vinagre_window_dispose;
widget_class->window_state_event = vinagre_window_state_event_cb;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment