[gnome-panel] remove bonobo compatibility



commit 9b2212b1cc83a9cd10a25798a282283a30cc8dfe
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Wed Oct 12 23:24:25 2016 +0300

    remove bonobo compatibility

 .../panel-applets-manager-dbus.c                   |   54 +-------------------
 gnome-panel/panel-applet-info.c                    |   26 +---------
 gnome-panel/panel-applet-info.h                    |    4 +-
 gnome-panel/panel-applets-manager.c                |   20 -------
 gnome-panel/panel-applets-manager.h                |    4 --
 gnome-panel/panel-compatibility.c                  |    5 +--
 6 files changed, 4 insertions(+), 109 deletions(-)
---
diff --git a/gnome-panel/libpanel-applet-private/panel-applets-manager-dbus.c 
b/gnome-panel/libpanel-applet-private/panel-applets-manager-dbus.c
index e691aed..0fdc40f 100644
--- a/gnome-panel/libpanel-applet-private/panel-applets-manager-dbus.c
+++ b/gnome-panel/libpanel-applet-private/panel-applets-manager-dbus.c
@@ -60,7 +60,6 @@ typedef struct _PanelAppletFactoryInfo {
        gchar              *srcdir;
 
        GList              *applet_list;
-       gboolean            has_old_ids;
 } PanelAppletFactoryInfo;
 
 #define PANEL_APPLET_FACTORY_GROUP "Applet Factory"
@@ -94,7 +93,6 @@ _panel_applets_manager_get_applet_info (GKeyFile    *applet_file,
        char             *name;
        char             *comment;
        char             *icon;
-       char            **old_ids;
 
        iid = g_strdup_printf ("%s::%s", factory_id, group);
        name = g_key_file_get_locale_string (applet_file, group,
@@ -102,17 +100,13 @@ _panel_applets_manager_get_applet_info (GKeyFile    *applet_file,
        comment = g_key_file_get_locale_string (applet_file, group,
                                                "Description", NULL, NULL);
        icon = g_key_file_get_string (applet_file, group, "Icon", NULL);
-       /* Bonobo compatibility */
-       old_ids = g_key_file_get_string_list (applet_file, group,
-                                             "BonoboId", NULL, NULL);
 
-       info = panel_applet_info_new (iid, name, comment, icon, (const char **) old_ids);
+       info = panel_applet_info_new (iid, name, comment, icon);
 
        g_free (iid);
        g_free (name);
        g_free (comment);
        g_free (icon);
-       g_strfreev (old_ids);
 
        return info;
 }
@@ -168,8 +162,6 @@ panel_applets_manager_get_applet_factory_info_from_file (const gchar *filename)
                return NULL;
        }
 
-       info->has_old_ids = FALSE;
-
        groups = g_key_file_get_groups (applet_file, &n_groups);
        for (i = 0; i < n_groups; i++) {
                PanelAppletInfo *ainfo;
@@ -179,8 +171,6 @@ panel_applets_manager_get_applet_factory_info_from_file (const gchar *filename)
 
                ainfo = _panel_applets_manager_get_applet_info (applet_file,
                                                                groups[i], info->id);
-               if (panel_applet_info_get_old_ids (ainfo) != NULL)
-                       info->has_old_ids = TRUE;
 
                info->applet_list = g_list_prepend (info->applet_list, ainfo);
        }
@@ -532,47 +522,6 @@ panel_applets_manager_dbus_get_applet_info (PanelAppletsManager *manager,
        return NULL;
 }
 
-static PanelAppletInfo *
-panel_applets_manager_dbus_get_applet_info_from_old_id (PanelAppletsManager *manager,
-                                                       const gchar         *iid)
-{
-       PanelAppletsManagerDBus *dbus_manager = PANEL_APPLETS_MANAGER_DBUS (manager);
-
-       GHashTableIter iter;
-       gpointer       key, value;
-
-       g_hash_table_iter_init (&iter, dbus_manager->priv->applet_factories);
-       while (g_hash_table_iter_next (&iter, &key, &value)) {
-               PanelAppletFactoryInfo *info;
-               GList                  *l;
-
-               info = (PanelAppletFactoryInfo *) value;
-               if (!info->has_old_ids)
-                       continue;
-
-               for (l = info->applet_list; l; l = g_list_next (l)) {
-                       PanelAppletInfo *ainfo;
-                       gint             i = 0;
-                       const gchar * const *old_ids;
-
-                       ainfo = (PanelAppletInfo *) l->data;
-
-                       old_ids = panel_applet_info_get_old_ids (ainfo);
-
-                       if (old_ids == NULL)
-                               continue;
-
-                       while (old_ids[i]) {
-                               if (g_strcmp0 (old_ids[i], iid) == 0)
-                                       return ainfo;
-                               i++;
-                       }
-               }
-       }
-
-       return NULL;
-}
-
 static gboolean
 panel_applets_manager_dbus_load_applet (PanelAppletsManager         *manager,
                                        const gchar                 *iid,
@@ -641,7 +590,6 @@ panel_applets_manager_dbus_class_init (PanelAppletsManagerDBusClass *class)
        manager_class->factory_activate = panel_applets_manager_dbus_factory_activate;
        manager_class->factory_deactivate = panel_applets_manager_dbus_factory_deactivate;
        manager_class->get_applet_info = panel_applets_manager_dbus_get_applet_info;
-       manager_class->get_applet_info_from_old_id = panel_applets_manager_dbus_get_applet_info_from_old_id;
        manager_class->load_applet = panel_applets_manager_dbus_load_applet;
        manager_class->get_applet_widget = panel_applets_manager_dbus_get_applet_widget;
 
diff --git a/gnome-panel/panel-applet-info.c b/gnome-panel/panel-applet-info.c
index 5a39e7e..75b5272 100644
--- a/gnome-panel/panel-applet-info.c
+++ b/gnome-panel/panel-applet-info.c
@@ -28,19 +28,15 @@ struct _PanelAppletInfo {
        gchar  *name;
        gchar  *comment;
        gchar  *icon;
-
-       gchar **old_ids;
 };
 
 PanelAppletInfo *
 panel_applet_info_new (const gchar  *iid,
                       const gchar  *name,
                       const gchar  *comment,
-                      const gchar  *icon,
-                      const gchar **old_ids)
+                      const gchar  *icon)
 {
        PanelAppletInfo *info;
-       int len;
 
        info = g_slice_new0 (PanelAppletInfo);
 
@@ -49,19 +45,6 @@ panel_applet_info_new (const gchar  *iid,
        info->comment = g_strdup (comment);
        info->icon = g_strdup (icon);
 
-       /* Bonobo compatibility */
-       if (old_ids != NULL) {
-               len = g_strv_length ((gchar **) old_ids);
-               if (len > 0) {
-                       int i;
-
-                       info->old_ids = g_new0 (gchar *, len + 1);
-
-                       for (i = 0; i < len; i++)
-                               info->old_ids[i] = g_strdup (old_ids[i]);
-               }
-       }
-
        return info;
 }
 
@@ -75,7 +58,6 @@ panel_applet_info_free (PanelAppletInfo *info)
        g_free (info->name);
        g_free (info->comment);
        g_free (info->icon);
-       g_strfreev (info->old_ids);
 
        g_slice_free (PanelAppletInfo, info);
 }
@@ -103,9 +85,3 @@ panel_applet_info_get_icon (PanelAppletInfo *info)
 {
        return info->icon;
 }
-
-const gchar * const *
-panel_applet_info_get_old_ids (PanelAppletInfo *info)
-{
-       return (const gchar * const *) info->old_ids;
-}
diff --git a/gnome-panel/panel-applet-info.h b/gnome-panel/panel-applet-info.h
index f3e136a..039be33 100644
--- a/gnome-panel/panel-applet-info.h
+++ b/gnome-panel/panel-applet-info.h
@@ -30,15 +30,13 @@ typedef struct _PanelAppletInfo PanelAppletInfo;
 PanelAppletInfo *panel_applet_info_new                             (const gchar  *iid,
                                                                    const gchar  *name,
                                                                    const gchar  *comment,
-                                                                   const gchar  *icon,
-                                                                   const gchar **old_ids);
+                                                                   const gchar  *icon);
 void             panel_applet_info_free                            (PanelAppletInfo *info);
 
 const gchar     *panel_applet_info_get_iid                         (PanelAppletInfo *info);
 const gchar     *panel_applet_info_get_name                        (PanelAppletInfo *info);
 const gchar     *panel_applet_info_get_description                 (PanelAppletInfo *info);
 const gchar     *panel_applet_info_get_icon                        (PanelAppletInfo *info);
-const gchar * const *panel_applet_info_get_old_ids                 (PanelAppletInfo *info);
 
 G_END_DECLS
 
diff --git a/gnome-panel/panel-applets-manager.c b/gnome-panel/panel-applets-manager.c
index 2597fb3..16c3320 100644
--- a/gnome-panel/panel-applets-manager.c
+++ b/gnome-panel/panel-applets-manager.c
@@ -158,26 +158,6 @@ panel_applets_manager_get_applet_info (const gchar *iid)
        return NULL;
 }
 
-PanelAppletInfo *
-panel_applets_manager_get_applet_info_from_old_id (const gchar *iid)
-{
-       GSList *l;
-       PanelAppletInfo *retval = NULL;
-
-       _panel_applets_managers_ensure_loaded ();
-
-       for (l = panel_applets_managers; l != NULL; l = l->next) {
-               PanelAppletsManager *manager = PANEL_APPLETS_MANAGER (l->data);
-
-               retval = PANEL_APPLETS_MANAGER_GET_CLASS (manager)->get_applet_info_from_old_id (manager, 
iid);
-
-               if (retval != NULL)
-                       return retval;
-       }
-
-       return NULL;
-}
-
 gboolean
 panel_applets_manager_load_applet (const gchar                *iid,
                                   PanelAppletFrameActivating *frame_act)
diff --git a/gnome-panel/panel-applets-manager.h b/gnome-panel/panel-applets-manager.h
index 8c0649b..4539265 100644
--- a/gnome-panel/panel-applets-manager.h
+++ b/gnome-panel/panel-applets-manager.h
@@ -58,9 +58,6 @@ struct _PanelAppletsManagerClass {
        PanelAppletInfo  * (*get_applet_info)       (PanelAppletsManager  *manager,
                                                     const gchar          *iid);
 
-       PanelAppletInfo  * (*get_applet_info_from_old_id) (PanelAppletsManager  *manager,
-                                                          const gchar          *iid);
-
        gboolean           (*load_applet)           (PanelAppletsManager         *manager,
                                                     const gchar                 *iid,
                                                     PanelAppletFrameActivating  *frame_act);
@@ -82,7 +79,6 @@ gboolean          panel_applets_manager_factory_activate            (const gchar
 void              panel_applets_manager_factory_deactivate          (const gchar     *iid);
 
 PanelAppletInfo  *panel_applets_manager_get_applet_info             (const gchar     *iid);
-PanelAppletInfo  *panel_applets_manager_get_applet_info_from_old_id (const gchar     *iid);
 
 gboolean          panel_applets_manager_load_applet                 (const gchar                *iid,
                                                                     PanelAppletFrameActivating *frame_act);
diff --git a/gnome-panel/panel-compatibility.c b/gnome-panel/panel-compatibility.c
index 18d55cb..101ed79 100644
--- a/gnome-panel/panel-compatibility.c
+++ b/gnome-panel/panel-compatibility.c
@@ -45,10 +45,7 @@ panel_compatibility_get_applet_iid (GSettings   *settings,
                return NULL;
        }
 
-       info = panel_applets_manager_get_applet_info_from_old_id (object_iid);
-       if (!info)
-               info = panel_applets_manager_get_applet_info (object_iid);
-
+       info = panel_applets_manager_get_applet_info (object_iid);
        if (!info) {
                g_free (object_iid);
                return NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]