[gnome-builder] libide/editor: remove inhibit code from page



commit 3314f8a60ac134a7f14501bb01f4abfd23f673ad
Author: Christian Hergert <chergert redhat com>
Date:   Tue Sep 13 19:51:44 2022 -0700

    libide/editor: remove inhibit code from page
    
    This is handled externally now in sessionui plugin.

 src/libide/editor/ide-editor-page-private.h |  3 ---
 src/libide/editor/ide-editor-page.c         | 34 -----------------------------
 2 files changed, 37 deletions(-)
---
diff --git a/src/libide/editor/ide-editor-page-private.h b/src/libide/editor/ide-editor-page-private.h
index d904d7c5b..86fa88ab9 100644
--- a/src/libide/editor/ide-editor-page-private.h
+++ b/src/libide/editor/ide-editor-page-private.h
@@ -37,9 +37,6 @@ struct _IdeEditorPage
   IdeBuffer               *buffer;
   IdeGutter               *gutter;
 
-  /* Inhibit logout from */
-  guint                    inhibit_cookie;
-
   /* Settings Management */
   IdeBindingGroup         *buffer_file_settings;
   IdeBindingGroup         *view_file_settings;
diff --git a/src/libide/editor/ide-editor-page.c b/src/libide/editor/ide-editor-page.c
index 5486bf45a..a7ec47817 100644
--- a/src/libide/editor/ide-editor-page.c
+++ b/src/libide/editor/ide-editor-page.c
@@ -50,38 +50,6 @@ G_DEFINE_TYPE (IdeEditorPage, ide_editor_page, IDE_TYPE_PAGE)
 
 static GParamSpec *properties [N_PROPS];
 
-static void
-ide_editor_page_set_inhibit_logout (IdeEditorPage *self,
-                                    gboolean       inhibit_logout)
-{
-  GtkApplication *app;
-  GtkRoot *window;
-
-  g_assert (IDE_IS_EDITOR_PAGE (self));
-
-  inhibit_logout = !!inhibit_logout;
-
-  if (inhibit_logout == !!self->inhibit_cookie)
-    return;
-
-  app = GTK_APPLICATION (IDE_APPLICATION_DEFAULT);
-  window = gtk_widget_get_root (GTK_WIDGET (self));
-
-  if (self->inhibit_cookie)
-    {
-      gtk_application_uninhibit (app, self->inhibit_cookie);
-      self->inhibit_cookie = 0;
-    }
-  else if (GTK_IS_WINDOW (window))
-    {
-      self->inhibit_cookie =
-        gtk_application_inhibit (app,
-                                 GTK_WINDOW (window),
-                                 GTK_APPLICATION_INHIBIT_LOGOUT,
-                                 _("There are unsaved documents"));
-    }
-}
-
 static void
 ide_editor_page_query_file_info_cb (GObject      *object,
                                     GAsyncResult *result,
@@ -643,8 +611,6 @@ ide_editor_page_dispose (GObject *object)
 {
   IdeEditorPage *self = (IdeEditorPage *)object;
 
-  ide_editor_page_set_inhibit_logout (self, FALSE);
-
   ide_editor_page_set_gutter (self, NULL);
 
   g_clear_object (&self->buffer_file_settings);


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