summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSiegfried Gevatter (RainCT) <siggi.gevatter@gmail.com>2012-01-24 18:29:00 +0000
committerWilliam Jon McCann <william.jon.mccann@gmail.com>2013-11-14 03:56:47 -0500
commitf682aabf74a3edf0bd0c518d05fb2bc57ea2227b (patch)
tree2341d95d7e92b6f1af4de02f09fab0b6429cfd83 /modules
parent3f5af532f7e8cec7da7eef31bdfa9e25949cdbd3 (diff)
downloadgtk+-f682aabf74a3edf0bd0c518d05fb2bc57ea2227b.tar.gz
Add print to PDF to recent manager
Printing a file with to PDF/etc. with the virtual printer option doesn't add the file to the list of recently used files. It should be there, so I can easily access it. https://bugzilla.gnome.org/show_bug.cgi?id=668598
Diffstat (limited to 'modules')
-rw-r--r--modules/printbackends/file/gtkprintbackendfile.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/printbackends/file/gtkprintbackendfile.c b/modules/printbackends/file/gtkprintbackendfile.c
index ff850f1c2a..b6872421be 100644
--- a/modules/printbackends/file/gtkprintbackendfile.c
+++ b/modules/printbackends/file/gtkprintbackendfile.c
@@ -384,7 +384,10 @@ file_print_cb_locked (GtkPrintBackendFile *print_backend,
GError *error,
gpointer user_data)
{
+ gchar *uri;
+
_PrintStreamData *ps = (_PrintStreamData *) user_data;
+ GtkRecentManager *recent_manager;
if (ps->target_io_stream != NULL)
g_output_stream_close (G_OUTPUT_STREAM (ps->target_io_stream), NULL, NULL);
@@ -398,6 +401,11 @@ file_print_cb_locked (GtkPrintBackendFile *print_backend,
gtk_print_job_set_status (ps->job,
(error != NULL)?GTK_PRINT_STATUS_FINISHED_ABORTED:GTK_PRINT_STATUS_FINISHED);
+ recent_manager = gtk_recent_manager_get_default ();
+ uri = output_file_from_settings (gtk_print_job_get_settings (ps->job), NULL);
+ gtk_recent_manager_add_item (recent_manager, uri);
+ g_free (uri);
+
if (ps->job)
g_object_unref (ps->job);