[totem] Clean up totem-open-location destruction
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] Clean up totem-open-location destruction
- Date: Fri, 28 May 2010 15:04:46 +0000 (UTC)
commit 5d2eb4c0c35b77ea78a13e33e1adc273e73b3491
Author: Alexander Saprykin <xelfium gmail com>
Date: Fri May 28 01:40:56 2010 +0400
Clean up totem-open-location destruction
totem_open_location_destroy() was useless as we were already
destroying ->open_location, and resetting its value with a
weak pointer.
https://bugzilla.gnome.org/show_bug.cgi?id=619883
src/totem-object.c | 14 ++------------
src/totem-open-location.c | 5 +----
2 files changed, 3 insertions(+), 16 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index d3977d4..51ec6bb 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -1518,22 +1518,12 @@ totem_action_open (Totem *totem)
}
static void
-totem_open_location_destroy (Totem *totem)
-{
- if (totem->open_location != NULL) {
- g_object_remove_weak_pointer (G_OBJECT (totem->open_location), (gpointer *)&(totem->open_location));
- gtk_widget_destroy (GTK_WIDGET (totem->open_location));
- totem->open_location = NULL;
- }
-}
-
-static void
totem_open_location_response_cb (GtkDialog *dialog, gint response, Totem *totem)
{
char *uri;
if (response != GTK_RESPONSE_OK) {
- totem_open_location_destroy (totem);
+ gtk_widget_destroy (totem->open_location);
return;
}
@@ -1558,7 +1548,7 @@ totem_open_location_response_cb (GtkDialog *dialog, gint response, Totem *totem)
}
g_free (uri);
- totem_open_location_destroy (totem);
+ gtk_widget_destroy (totem->open_location);
}
void
diff --git a/src/totem-open-location.c b/src/totem-open-location.c
index 3973144..a479fe0 100644
--- a/src/totem-open-location.c
+++ b/src/totem-open-location.c
@@ -64,7 +64,7 @@ totem_open_location_class_init (TotemOpenLocationClass *klass)
static void
totem_open_location_init (TotemOpenLocation *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TOTEM_TYPE_OPEN_LOCATION, TotemOpenLocationPrivate);
+ self->priv = TOTEM_OPEN_LOCATION_GET_PRIVATE (self);
self->priv->xml = totem_interface_load ("uri.ui", FALSE, NULL, self);
self->priv->uri_entry = GTK_ENTRY (gtk_builder_get_object (self->priv->xml, "uri"));
@@ -177,9 +177,6 @@ totem_open_location_new (Totem *totem)
gtk_container_set_border_width (GTK_CONTAINER (open_location), 5);
gtk_dialog_set_default_response (GTK_DIALOG (open_location), GTK_RESPONSE_OK);
- g_signal_connect (G_OBJECT (open_location), "delete-event",
- G_CALLBACK (gtk_widget_destroy), open_location);
-
/* Get item from clipboard to fill GtkEntry */
clipboard_location = totem_open_location_set_from_clipboard (open_location);
if (clipboard_location != NULL && strcmp (clipboard_location, "") != 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]