diff options
-rw-r--r-- | src/ld-window-main.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ld-window-main.c b/src/ld-window-main.c index cbf9fd9..51769f6 100644 --- a/src/ld-window-main.c +++ b/src/ld-window-main.c @@ -712,9 +712,10 @@ diagram_save (LdWindowMain *self, GtkWindow *dialog_parent, static gboolean diagram_open (LdWindowMain *self, const gchar *filename) { - GError *error; + GError *error = NULL; + GFile *file; + gchar *uri; - error = NULL; ld_diagram_load_from_file (self->priv->diagram, filename, &error); if (error) { @@ -748,6 +749,12 @@ diagram_open (LdWindowMain *self, const gchar *filename) return FALSE; } + file = g_file_new_for_path (filename); + uri = g_file_get_uri (file); + g_object_unref (file); + gtk_recent_manager_add_item (gtk_recent_manager_get_default (), uri); + g_free (uri); + ld_diagram_set_modified (self->priv->diagram, FALSE); diagram_set_filename (self, g_strdup (filename)); return TRUE; |