Add all opened files to the recent list
The GTK+ file open/save dialog has already been adding them, but opening files from the command line would circumvent that path.
This commit is contained in:
parent
7499f92811
commit
baaca4c58f
|
@ -712,9 +712,10 @@ diagram_save (LdWindowMain *self, GtkWindow *dialog_parent,
|
||||||
static gboolean
|
static gboolean
|
||||||
diagram_open (LdWindowMain *self, const gchar *filename)
|
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);
|
ld_diagram_load_from_file (self->priv->diagram, filename, &error);
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
|
@ -748,6 +749,12 @@ diagram_open (LdWindowMain *self, const gchar *filename)
|
||||||
return FALSE;
|
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);
|
ld_diagram_set_modified (self->priv->diagram, FALSE);
|
||||||
diagram_set_filename (self, g_strdup (filename));
|
diagram_set_filename (self, g_strdup (filename));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in New Issue