[gnome-text-editor] app: always restore session



commit 06d617eadc880b2123ede4c7351419c99706ceb2
Author: Christian Hergert <chergert redhat com>
Date:   Mon Sep 5 15:30:52 2022 -0700

    app: always restore session
    
    This is essentially a revert of commit fd6f7027.
    
    https://gitlab.gnome.org/Teams/Design/app-mockups/-/issues/45#note_1541762

 src/editor-application.c | 29 ++++++++---------------------
 1 file changed, 8 insertions(+), 21 deletions(-)
---
diff --git a/src/editor-application.c b/src/editor-application.c
index 251c1e1..15b85ff 100644
--- a/src/editor-application.c
+++ b/src/editor-application.c
@@ -160,31 +160,18 @@ editor_application_open (GApplication  *application,
   g_assert (EDITOR_IS_APPLICATION (self));
   g_assert (files != NULL || n_files == 0);
 
-  /* If we're being asked to open files via this interface,
-   * we want to ignore restoring the previous session because
-   * the user has either provided a filename on the command line
-   * or has opened a file from something like Nautilus or another
-   * default file-handler situation.
-   *
-   * We either have 1) already restored a session, or 2) dont
-   * need to and instead should just show the window. However,
-   * in the case of #2, we need to at least restore our recent
-   * files so the sidebar can continue working. This is done by
-   * setting the restore_pages within EditorSession to FALSE.
-   */
-
   if (_editor_session_did_restore (self->session))
     {
       editor_session_open_files (self->session, files, n_files, hint);
-      return;
     }
-
-  g_application_hold (application);
-  _editor_session_set_restore_pages (self->session, FALSE);
-  editor_session_restore_async (self->session,
-                                NULL,
-                                editor_application_restore_cb,
-                                restore_new (files, n_files, hint));
+  else
+    {
+      g_application_hold (application);
+      editor_session_restore_async (self->session,
+                                    NULL,
+                                    editor_application_restore_cb,
+                                    restore_new (files, n_files, hint));
+    }
 }
 
 static gboolean


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