[gtk+] Add print to PDF to recent manager



commit f682aabf74a3edf0bd0c518d05fb2bc57ea2227b
Author: Siegfried Gevatter (RainCT) <siggi gevatter gmail com>
Date:   Tue Jan 24 18:29:00 2012 +0000

    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

 modules/printbackends/file/gtkprintbackendfile.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/modules/printbackends/file/gtkprintbackendfile.c 
b/modules/printbackends/file/gtkprintbackendfile.c
index ff850f1..b687242 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);
 


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