[gnome-notes] window-base: Set last-opened-item to nothing if there is none



commit 660e617f64b85eebfd4204e12edaa294ed53d7af
Author: Jonathan Kang <jonathankang gnome org>
Date:   Thu Aug 5 15:14:51 2021 +0800

    window-base: Set last-opened-item to nothing if there is none
    
    Previously, when closing the application, if there is no note opened,
    bijiben doesn't clear the "last-opened-item" property. This make the
    application starts up with the last last opened item opened.
    
    Fix that in this commit.

 src/bjb-window.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/bjb-window.c b/src/bjb-window.c
index 968d2979..607539aa 100644
--- a/src/bjb-window.c
+++ b/src/bjb-window.c
@@ -229,6 +229,10 @@ bjb_window_finalize (GObject *object)
       g_clear_signal_handler (&self->note_deleted, self->note);
       g_clear_signal_handler (&self->note_trashed, self->note);
     }
+  else
+    {
+      g_settings_set_string (self->settings, "last-opened-item", ""); 
+    }
 
   note_view = g_object_get_data (object, "note-view");
   if (note_view)


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