diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-02-21 10:33:46 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-02-21 11:20:21 +0100 |
commit | bf75e8f16a5b8b55f9d5ab86734bf6054074d25f (patch) | |
tree | 34e7a193fcb29113cfeaee45557168d83f394308 /src | |
parent | 96e1544fb5679ec0beb16f24367e4088641f43bc (diff) | |
download | totem-bf75e8f16a5b8b55f9d5ab86734bf6054074d25f.tar.gz |
recent: Stop using intermediate private struct
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/recent/totem-recent.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/plugins/recent/totem-recent.c b/src/plugins/recent/totem-recent.c index 37ebded81..ad33d12ac 100644 --- a/src/plugins/recent/totem-recent.c +++ b/src/plugins/recent/totem-recent.c @@ -39,10 +39,12 @@ #define TOTEM_RECENT_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TOTEM_TYPE_RECENT_PLUGIN, TotemRecentPlugin)) typedef struct { + PeasExtensionBase parent; + guint signal_id; TotemObject *totem; GtkRecentManager *recent_manager; -} TotemRecentPluginPrivate; +} TotemRecentPlugin; TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_RECENT_PLUGIN, TotemRecentPlugin, totem_recent_plugin) @@ -80,7 +82,7 @@ recent_info_cb (GFile *file, data.app_name = g_strdup (g_get_application_name ()); data.app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL); data.groups = groups; - if (gtk_recent_manager_add_full (pi->priv->recent_manager, + if (gtk_recent_manager_add_full (pi->recent_manager, uri, &data) == FALSE) { g_warning ("Couldn't add recent file for '%s'", uri); } @@ -120,7 +122,7 @@ add_recent (TotemRecentPlugin *pi, data.app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL); data.groups = groups; - if (gtk_recent_manager_add_full (pi->priv->recent_manager, + if (gtk_recent_manager_add_full (pi->recent_manager, uri, &data) == FALSE) { g_warning ("Couldn't add recent file for '%s'", uri); } @@ -161,9 +163,9 @@ impl_activate (PeasActivatable *plugin) { TotemRecentPlugin *pi = TOTEM_RECENT_PLUGIN (plugin); - pi->priv->totem = g_object_ref (g_object_get_data (G_OBJECT (plugin), "object")); - pi->priv->recent_manager = gtk_recent_manager_get_default (); - pi->priv->signal_id = g_signal_connect (G_OBJECT (pi->priv->totem), "file-has-played", + pi->totem = g_object_ref (g_object_get_data (G_OBJECT (plugin), "object")); + pi->recent_manager = gtk_recent_manager_get_default (); + pi->signal_id = g_signal_connect (G_OBJECT (pi->totem), "file-has-played", G_CALLBACK (file_has_played_cb), pi); } @@ -172,13 +174,13 @@ impl_deactivate (PeasActivatable *plugin) { TotemRecentPlugin *pi = TOTEM_RECENT_PLUGIN (plugin); - if (pi->priv->signal_id) { - g_signal_handler_disconnect (pi->priv->totem, pi->priv->signal_id); - pi->priv->signal_id = 0; + if (pi->signal_id) { + g_signal_handler_disconnect (pi->totem, pi->signal_id); + pi->signal_id = 0; } - if (pi->priv->totem) { - g_object_unref (pi->priv->totem); - pi->priv->totem = NULL; + if (pi->totem) { + g_object_unref (pi->totem); + pi->totem = NULL; } } |