[gtk+/open-with-dialog: 41/52] open-with: add a public _refresh() method
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/open-with-dialog: 41/52] open-with: add a public _refresh() method
- Date: Tue, 23 Nov 2010 15:58:33 +0000 (UTC)
commit 3b6941f08702c732045412eb603789a4cbbc9c9b
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Nov 22 23:02:57 2010 +0100
open-with: add a public _refresh() method
This can be useful now that we're splitting some items from the widget.
gtk/gtkopenwith.c | 6 ++++++
gtk/gtkopenwith.h | 1 +
gtk/gtkopenwithdialog.c | 11 ++++++++++-
gtk/gtkopenwithprivate.h | 3 +--
gtk/gtkopenwithwidget.c | 20 ++++++++++----------
5 files changed, 28 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkopenwith.c b/gtk/gtkopenwith.c
index e5123b0..0bd4c1a 100644
--- a/gtk/gtkopenwith.c
+++ b/gtk/gtkopenwith.c
@@ -66,3 +66,9 @@ gtk_open_with_get_app_info (GtkOpenWith *self)
{
return GTK_OPEN_WITH_GET_IFACE (self)->get_app_info (self);
}
+
+void
+gtk_open_with_refresh (GtkOpenWith *self)
+{
+ GTK_OPEN_WITH_GET_IFACE (self)->refresh (self);
+}
diff --git a/gtk/gtkopenwith.h b/gtk/gtkopenwith.h
index 09bca2f..c77029b 100644
--- a/gtk/gtkopenwith.h
+++ b/gtk/gtkopenwith.h
@@ -46,6 +46,7 @@ GType gtk_open_with_get_type () G_GNUC_CONST;
GAppInfo * gtk_open_with_get_app_info (GtkOpenWith *self);
gchar * gtk_open_with_get_content_type (GtkOpenWith *self);
+void gtk_open_with_refresh (GtkOpenWith *self);
G_END_DECLS
diff --git a/gtk/gtkopenwithdialog.c b/gtk/gtkopenwithdialog.c
index 596b06a..12d93b3 100644
--- a/gtk/gtkopenwithdialog.c
+++ b/gtk/gtkopenwithdialog.c
@@ -106,7 +106,7 @@ search_for_mimetype_ready_cb (GObject *source,
}
else
{
- _gtk_open_with_widget_refilter (GTK_OPEN_WITH_WIDGET (self->priv->open_with_widget));
+ gtk_open_with_refresh (GTK_OPEN_WITH (self->priv->open_with_widget));
}
g_object_unref (online);
@@ -418,6 +418,14 @@ gtk_open_with_dialog_get_app_info (GtkOpenWith *object)
}
static void
+gtk_open_with_dialog_refresh (GtkOpenWith *object)
+{
+ GtkOpenWithDialog *self = GTK_OPEN_WITH_DIALOG (object);
+
+ gtk_open_with_refresh (GTK_OPEN_WITH (self->priv->open_with_widget));
+}
+
+static void
gtk_open_with_dialog_constructed (GObject *object)
{
GtkOpenWithDialog *self = GTK_OPEN_WITH_DIALOG (object);
@@ -496,6 +504,7 @@ static void
gtk_open_with_dialog_iface_init (GtkOpenWithIface *iface)
{
iface->get_app_info = gtk_open_with_dialog_get_app_info;
+ iface->refresh = gtk_open_with_dialog_refresh;
}
static void
diff --git a/gtk/gtkopenwithprivate.h b/gtk/gtkopenwithprivate.h
index c25b487..a4205ec 100644
--- a/gtk/gtkopenwithprivate.h
+++ b/gtk/gtkopenwithprivate.h
@@ -39,8 +39,7 @@ struct _GtkOpenWithIface {
GTypeInterface base_iface;
GAppInfo * (* get_app_info) (GtkOpenWith *object);
+ void (* refresh) (GtkOpenWith *object);
};
-void _gtk_open_with_widget_refilter (GtkOpenWithWidget *self);
-
#endif /* __GTK_OPEN_WITH_PRIVATE_H__ */
diff --git a/gtk/gtkopenwithwidget.c b/gtk/gtkopenwithwidget.c
index cfe6c97..8edeb6d 100644
--- a/gtk/gtkopenwithwidget.c
+++ b/gtk/gtkopenwithwidget.c
@@ -197,7 +197,7 @@ item_forget_association_cb (GtkMenuItem *item,
g_app_info_remove_supports_type (info, self->priv->content_type, NULL);
}
- _gtk_open_with_widget_refilter (self);
+ gtk_open_with_refresh (GTK_OPEN_WITH (self));
}
static GtkWidget *
@@ -1061,16 +1061,9 @@ gtk_open_with_widget_get_app_info (GtkOpenWith *object)
}
static void
-gtk_open_with_widget_iface_init (GtkOpenWithIface *iface)
-{
- iface->get_app_info = gtk_open_with_widget_get_app_info;
-}
-
-void
-_gtk_open_with_widget_refilter (GtkOpenWithWidget *self)
+gtk_open_with_widget_refresh (GtkOpenWith *object)
{
-
- gtk_open_with_widget_ensure_show_more_button (self);
+ GtkOpenWithWidget *self = GTK_OPEN_WITH_WIDGET (object);
if (self->priv->program_list_store != NULL)
{
@@ -1085,6 +1078,13 @@ _gtk_open_with_widget_refilter (GtkOpenWithWidget *self)
}
}
+static void
+gtk_open_with_widget_iface_init (GtkOpenWithIface *iface)
+{
+ iface->get_app_info = gtk_open_with_widget_get_app_info;
+ iface->refresh = gtk_open_with_widget_refresh;
+}
+
GtkWidget *
gtk_open_with_widget_new (const gchar *content_type)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]