empathy r1766 - trunk/libempathy-gtk
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r1766 - trunk/libempathy-gtk
- Date: Fri, 21 Nov 2008 16:15:39 +0000 (UTC)
Author: xclaesse
Date: Fri Nov 21 16:15:39 2008
New Revision: 1766
URL: http://svn.gnome.org/viewvc/empathy?rev=1766&view=rev
Log:
Added ability for the ft manager to stay around when closed. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny lamb collabora co uk>
Modified:
trunk/libempathy-gtk/empathy-ft-manager.c
trunk/libempathy-gtk/empathy-ft-manager.h
Modified: trunk/libempathy-gtk/empathy-ft-manager.c
==============================================================================
--- trunk/libempathy-gtk/empathy-ft-manager.c (original)
+++ trunk/libempathy-gtk/empathy-ft-manager.c Fri Nov 21 16:15:39 2008
@@ -116,6 +116,8 @@
G_DEFINE_TYPE (EmpathyFTManager, empathy_ft_manager, G_TYPE_OBJECT);
+static EmpathyFTManager *manager_p = NULL;
+
static void
empathy_ft_manager_class_init (EmpathyFTManagerClass *klass)
{
@@ -154,31 +156,26 @@
g_source_remove (priv->save_geometry_id);
}
- G_OBJECT_CLASS (empathy_ft_manager_parent_class)->finalize (object);
-}
-
-EmpathyFTManager *
-empathy_ft_manager_get_default (void)
-{
- static EmpathyFTManager *manager;
-
- if (!manager)
- manager = empathy_ft_manager_new ();
+ manager_p = NULL;
- return manager;
+ G_OBJECT_CLASS (empathy_ft_manager_parent_class)->finalize (object);
}
/**
- * empathy_ft_manager_new:
+ * empathy_ft_manager_get_default:
*
- * Creates a new #EmpathyFTManager.
+ * Returns a new #EmpathyFTManager if there is not already one, or the existing
+ * one if it exists.
*
- * Returns: a new #EmpathyFTManager
+ * Returns: a #EmpathyFTManager
*/
EmpathyFTManager *
-empathy_ft_manager_new (void)
+empathy_ft_manager_get_default (void)
{
- return g_object_new (EMPATHY_TYPE_FT_MANAGER, NULL);
+ if (!manager_p)
+ manager_p = g_object_new (EMPATHY_TYPE_FT_MANAGER, NULL);
+
+ return manager_p;
}
/**
@@ -674,15 +671,18 @@
priv = GET_PRIV (ft_manager);
+ ft_manager_clear (ft_manager);
if (g_hash_table_size (priv->file_to_row_ref) == 0) {
DEBUG ("Destroying window");
+ empathy_ft_manager_finalize (G_OBJECT (ft_manager));
+ manager_p = NULL;
return FALSE;
} else {
DEBUG ("Hiding window");
gtk_widget_hide (widget);
- ft_manager_clear (ft_manager);
return TRUE;
}
+
}
static gboolean
@@ -912,12 +912,6 @@
}
gtk_tree_row_reference_free (row_ref);
}
-
- if (g_hash_table_size (priv->file_to_row_ref) == 0 &&
- !GTK_WIDGET_VISIBLE (priv->window)) {
- DEBUG ("Destroying window");
- gtk_widget_destroy (priv->window);
- }
}
static void
Modified: trunk/libempathy-gtk/empathy-ft-manager.h
==============================================================================
--- trunk/libempathy-gtk/empathy-ft-manager.h (original)
+++ trunk/libempathy-gtk/empathy-ft-manager.h Fri Nov 21 16:15:39 2008
@@ -54,7 +54,6 @@
GType empathy_ft_manager_get_type (void);
EmpathyFTManager *empathy_ft_manager_get_default (void);
-EmpathyFTManager *empathy_ft_manager_new (void);
void empathy_ft_manager_add_file (EmpathyFTManager *ft_manager,
EmpathyFile *file);
GtkWidget *empathy_ft_manager_get_dialog (EmpathyFTManager *ft_manager);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]