[gnome-software/wip/attente/gapplication: 3/4] Stop abusing GApplication
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/attente/gapplication: 3/4] Stop abusing GApplication
- Date: Tue, 22 Mar 2016 18:17:45 +0000 (UTC)
commit 3c42bde286814011b1262f6a11aa2d809c2ac7a8
Author: Allison Ryan Lortie <desrt desrt ca>
Date: Tue Mar 22 14:07:29 2016 -0400
Stop abusing GApplication
src/gs-application.c | 20 +++-----------------
src/gs-shell.c | 22 ----------------------
2 files changed, 3 insertions(+), 39 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index fa24d56..8776ebe 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -430,25 +430,11 @@ reboot_and_install (GSimpleAction *action,
static void
quit_activated (GSimpleAction *action,
GVariant *parameter,
- gpointer app)
+ gpointer data)
{
- GApplicationFlags flags;
- GList *windows;
- GtkWidget *window;
-
- flags = g_application_get_flags (app);
-
- if (flags & G_APPLICATION_IS_SERVICE) {
- windows = gtk_application_get_windows (GTK_APPLICATION (app));
- if (windows) {
- window = windows->data;
- gtk_widget_hide (window);
- }
-
- return;
- }
+ GsApplication *app = GS_APPLICATION (data);
- g_application_quit (G_APPLICATION (app));
+ gtk_widget_destroy (GTK_WIDGET (gs_shell_get_window (app->shell)));
}
static void
diff --git a/src/gs-shell.c b/src/gs-shell.c
index fb8a84b..66bbe38 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -604,25 +604,6 @@ window_button_press_event (GtkWidget *win, GdkEventButton *event, GsShell *shell
return GDK_EVENT_STOP;
}
-static gboolean
-main_window_closed_cb (GtkWidget *dialog, GdkEvent *event, gpointer user_data)
-{
- GsShell *shell = user_data;
- GsShellPrivate *priv = gs_shell_get_instance_private (shell);
- BackEntry *entry;
-
- /* When the window is closed, reset the initial mode to overview */
- priv->mode = GS_SHELL_MODE_OVERVIEW;
-
- /* ... and clear any remaining entries in the back button stack */
- while ((entry = g_queue_pop_head (priv->back_entry_stack)) != NULL) {
- free_back_entry (entry);
- }
-
- gtk_widget_hide (dialog);
- return TRUE;
-}
-
/**
* gs_shell_updates_changed_cb:
*/
@@ -719,9 +700,6 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can
gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
GS_DATA G_DIR_SEPARATOR_S "icons");
- g_signal_connect (priv->main_window, "delete-event",
- G_CALLBACK (main_window_closed_cb), shell);
-
/* fix up the header bar */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "header"));
if (in_desktop ("Unity")) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]