static void impl_deactivate (PeasActivatable *bplugin) { RBGPMPlugin *plugin; GObject *shell_player; RBShell *shell; plugin = RB_GPM_PLUGIN (bplugin); if (plugin->timeout_id != 0) { g_source_remove (plugin->timeout_id); plugin->timeout_id = 0; } if (plugin->cookie != 0) { uninhibit (plugin); plugin->cookie = 0; } g_object_get (plugin, "object", &shell, NULL); g_object_get (shell, "shell-player", &shell_player, NULL); if (plugin->handler_id != 0) { g_signal_handler_disconnect (shell_player, plugin->handler_id); plugin->handler_id = 0; } g_object_unref (shell); g_object_unref (shell_player); }
static void impl_deactivate (RBPlugin *rbplugin, RBShell *shell) { RBGPMPlugin *plugin; GObject *shell_player; plugin = RB_GPM_PLUGIN (rbplugin); if (plugin->timeout_id != 0) { g_source_remove (plugin->timeout_id); plugin->timeout_id = 0; } if (plugin->cookie != 0) { uninhibit (plugin); plugin->cookie = 0; } g_object_get (shell, "shell-player", &shell_player, NULL); if (plugin->handler_id != 0) { g_signal_handler_disconnect (shell_player, plugin->handler_id); plugin->handler_id = 0; } g_object_unref (plugin->shell); g_object_unref (shell_player); if (plugin->proxy != NULL) { g_object_unref (plugin->proxy); plugin->proxy = NULL; } }
static void impl_activate (PeasActivatable *bplugin) { RBGPMPlugin *plugin; GObject *shell_player; gboolean playing; RBShell *shell; plugin = RB_GPM_PLUGIN (bplugin); g_object_get (plugin, "object", &shell, NULL); g_object_get (shell, "shell-player", &shell_player, NULL); plugin->handler_id = g_signal_connect_object (shell_player, "playing-changed", (GCallback) playing_changed_cb, plugin, 0); g_object_get (shell_player, "playing", &playing, NULL); if (playing) { inhibit (plugin); } g_object_unref (shell_player); g_object_unref (shell); }
static void impl_activate (RBPlugin *rbplugin, RBShell *shell) { RBGPMPlugin *plugin; GError *error = NULL; GObject *shell_player; gboolean playing; plugin = RB_GPM_PLUGIN (rbplugin); plugin->shell = g_object_ref (shell); plugin->bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); if (plugin->bus == NULL) { g_warning ("Couldn't connect to system bus: %s", (error) ? error->message : "(null)"); return; } g_object_get (shell, "shell-player", &shell_player, NULL); plugin->handler_id = g_signal_connect_object (shell_player, "playing-changed", (GCallback) playing_changed_cb, plugin, 0); g_object_get (shell_player, "playing", &playing, NULL); if (playing) { inhibit (plugin); } g_object_unref (shell_player); }