[gedit] Update to libpeas 1.1 depreciations
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Update to libpeas 1.1 depreciations
- Date: Thu, 23 Jun 2011 22:43:40 +0000 (UTC)
commit 51db205e09f18dbf743d40596e33217538de43ec
Author: Garrett Regier <garrettregier gmail com>
Date: Thu Jun 23 15:43:15 2011 -0700
Update to libpeas 1.1 depreciations
configure.ac | 5 +++--
gedit/gedit-app.c | 8 +++++---
gedit/gedit-view.c | 8 +++++---
gedit/gedit-window.c | 45 +++++++++++++++++++++++++++++++++++----------
4 files changed, 48 insertions(+), 18 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ac79bdc..e1f2fc2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -327,7 +327,7 @@ PKG_CHECK_MODULES(GEDIT, [
gtk+-3.0 >= 3.1.6
gtksourceview-3.0 >= 3.0.0
libpeas-1.0 >= 0.7.3
- libpeas-gtk-1.0 >= 0.7.3
+ libpeas-gtk-1.0 >= 1.1.0
gsettings-desktop-schemas
])
@@ -402,7 +402,8 @@ if test "$enable_deprecations" = "yes"; then
-DGDK_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
--DGNOME_DISABLE_DEPRECATED"
+-DGNOME_DISABLE_DEPRECATED \
+-DPEAS_DISABLE_DEPRECATED"
AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
fi
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index 02cfc0c..ce6d726 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -494,7 +494,7 @@ extension_added (PeasExtensionSet *extensions,
PeasExtension *exten,
GeditApp *app)
{
- peas_extension_call (exten, "activate");
+ gedit_app_activatable_activate (GEDIT_APP_ACTIVATABLE (exten));
}
static void
@@ -503,7 +503,7 @@ extension_removed (PeasExtensionSet *extensions,
PeasExtension *exten,
GeditApp *app)
{
- peas_extension_call (exten, "deactivate");
+ gedit_app_activatable_deactivate (GEDIT_APP_ACTIVATABLE (exten));
}
static void
@@ -535,7 +535,9 @@ gedit_app_init (GeditApp *app)
G_CALLBACK (extension_removed),
app);
- peas_extension_set_call (app->priv->extensions, "activate");
+ peas_extension_set_foreach (app->priv->extensions,
+ (PeasExtensionSetForeachFunc) extension_added,
+ app);
}
/**
diff --git a/gedit/gedit-view.c b/gedit/gedit-view.c
index c639b6f..e476c27 100644
--- a/gedit/gedit-view.c
+++ b/gedit/gedit-view.c
@@ -174,7 +174,7 @@ extension_added (PeasExtensionSet *extensions,
PeasExtension *exten,
GeditView *view)
{
- peas_extension_call (exten, "activate");
+ gedit_view_activatable_activate (GEDIT_VIEW_ACTIVATABLE (exten));
}
static void
@@ -183,7 +183,7 @@ extension_removed (PeasExtensionSet *extensions,
PeasExtension *exten,
GeditView *view)
{
- peas_extension_call (exten, "deactivate");
+ gedit_view_activatable_deactivate (GEDIT_VIEW_ACTIVATABLE (exten));
}
static void
@@ -647,7 +647,9 @@ gedit_view_realize (GtkWidget *widget)
/* We only activate the extensions when the view is realized,
* because most plugins will expect this behaviour, and we won't
* change the buffer later anyway. */
- peas_extension_set_call (view->priv->extensions, "activate");
+ peas_extension_set_foreach (view->priv->extensions,
+ (PeasExtensionSetForeachFunc) extension_added,
+ view);
view->priv->view_realized = TRUE;
}
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 16b59e8..102e6f6 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -738,6 +738,15 @@ set_paste_sensitivity_according_to_clipboard (GeditWindow *window,
}
static void
+extension_update_state (PeasExtensionSet *extensions,
+ PeasPluginInfo *info,
+ PeasExtension *exten,
+ GeditWindow *window)
+{
+ gedit_window_activatable_update_state (GEDIT_WINDOW_ACTIVATABLE (exten));
+}
+
+static void
set_sensitivity_according_to_tab (GeditWindow *window,
GeditTab *tab)
{
@@ -911,7 +920,9 @@ set_sensitivity_according_to_tab (GeditWindow *window,
update_next_prev_doc_sensitivity (window, tab);
- peas_extension_set_call (window->priv->extensions, "update_state", window);
+ peas_extension_set_foreach (window->priv->extensions,
+ (PeasExtensionSetForeachFunc) extension_update_state,
+ window);
}
static void
@@ -2973,7 +2984,9 @@ sync_name (GeditTab *tab,
g_free (escaped_name);
g_free (tip);
- peas_extension_set_call (window->priv->extensions, "update_state");
+ peas_extension_set_foreach (window->priv->extensions,
+ (PeasExtensionSetForeachFunc) extension_update_state,
+ window);
}
static GeditWindow *
@@ -3364,7 +3377,9 @@ selection_changed (GeditDocument *doc,
editable &&
gtk_text_buffer_get_has_selection (GTK_TEXT_BUFFER (doc)));
- peas_extension_set_call (window->priv->extensions, "update_state");
+ peas_extension_set_foreach (window->priv->extensions,
+ (PeasExtensionSetForeachFunc) extension_update_state,
+ window);
}
static void
@@ -3373,7 +3388,9 @@ sync_languages_menu (GeditDocument *doc,
GeditWindow *window)
{
update_languages_menu (window);
- peas_extension_set_call (window->priv->extensions, "update_state");
+ peas_extension_set_foreach (window->priv->extensions,
+ (PeasExtensionSetForeachFunc) extension_update_state,
+ window);
}
static void
@@ -3386,7 +3403,9 @@ readonly_changed (GeditDocument *doc,
sync_name (gedit_window_get_active_tab (window), NULL, window);
- peas_extension_set_call (window->priv->extensions, "update_state");
+ peas_extension_set_foreach (window->priv->extensions,
+ (PeasExtensionSetForeachFunc) extension_update_state,
+ window);
}
static void
@@ -3394,7 +3413,9 @@ editable_changed (GeditView *view,
GParamSpec *arg1,
GeditWindow *window)
{
- peas_extension_set_call (window->priv->extensions, "update_state");
+ peas_extension_set_foreach (window->priv->extensions,
+ (PeasExtensionSetForeachFunc) extension_update_state,
+ window);
}
static void
@@ -3628,7 +3649,9 @@ on_tab_removed (GeditMultiNotebook *multi,
if (num_tabs == 0)
{
- peas_extension_set_call (window->priv->extensions, "update_state");
+ peas_extension_set_foreach (window->priv->extensions,
+ (PeasExtensionSetForeachFunc) extension_update_state,
+ window);
}
}
@@ -4061,7 +4084,7 @@ extension_added (PeasExtensionSet *extensions,
PeasExtension *exten,
GeditWindow *window)
{
- peas_extension_call (exten, "activate");
+ gedit_window_activatable_activate (GEDIT_WINDOW_ACTIVATABLE (exten));
}
static void
@@ -4070,7 +4093,7 @@ extension_removed (PeasExtensionSet *extensions,
PeasExtension *exten,
GeditWindow *window)
{
- peas_extension_call (exten, "deactivate");
+ gedit_window_activatable_deactivate (GEDIT_WINDOW_ACTIVATABLE (exten));
/* Ensure update of ui manager, because we suspect it does something
* with expected static strings in the type module (when unloaded the
@@ -4266,7 +4289,9 @@ gedit_window_init (GeditWindow *window)
"extension-removed",
G_CALLBACK (extension_removed),
window);
- peas_extension_set_call (window->priv->extensions, "activate");
+ peas_extension_set_foreach (window->priv->extensions,
+ (PeasExtensionSetForeachFunc) extension_added,
+ window);
/* set visibility of panels.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]