aboutsummaryrefslogtreecommitdiffstats
path: root/embed/print-dialog.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-09-22 04:21:44 +0800
committerChristian Persch <chpe@src.gnome.org>2005-09-22 04:21:44 +0800
commit40949719c38f6ff13b25c5b664d7b74e7e8f8b8e (patch)
tree3a53191e7ad114ad72f43221d8aee7bd75fac476 /embed/print-dialog.c
parentfefb3cc908e332a2dd5c1bb9cc9df2853a25c4a1 (diff)
downloadgsoc2013-epiphany-40949719c38f6ff13b25c5b664d7b74e7e8f8b8e.tar
gsoc2013-epiphany-40949719c38f6ff13b25c5b664d7b74e7e8f8b8e.tar.gz
gsoc2013-epiphany-40949719c38f6ff13b25c5b664d7b74e7e8f8b8e.tar.bz2
gsoc2013-epiphany-40949719c38f6ff13b25c5b664d7b74e7e8f8b8e.tar.lz
gsoc2013-epiphany-40949719c38f6ff13b25c5b664d7b74e7e8f8b8e.tar.xz
gsoc2013-epiphany-40949719c38f6ff13b25c5b664d7b74e7e8f8b8e.tar.zst
gsoc2013-epiphany-40949719c38f6ff13b25c5b664d7b74e7e8f8b8e.zip
Don't use "cat >" as output command, it fails inpredicably. Instead, use
2005-09-21 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/EphyUtils.cpp: * embed/print-dialog.c: (ephy_print_do_print_idle_cb): Don't use "cat >" as output command, it fails inpredicably. Instead, use the tempfile setting, and set "PostScript/default" as printer name. fflush before printing the temp file using gnome-print. If not using gecko 1.9, translate the paper name to the one mozilla expects (mozilla bug https://bugzilla.mozilla.org/show_bug.cgi?id=307404).
Diffstat (limited to 'embed/print-dialog.c')
-rwxr-xr-xembed/print-dialog.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/embed/print-dialog.c b/embed/print-dialog.c
index 69140ca8d..cc920d181 100755
--- a/embed/print-dialog.c
+++ b/embed/print-dialog.c
@@ -34,6 +34,7 @@
#include <unistd.h>
#include <string.h>
+#include <stdio.h>
#include <gtk/gtkwindow.h>
#include <gtk/gtkdialog.h>
#include <gtk/gtkentry.h>
@@ -309,14 +310,22 @@ static gboolean
ephy_print_do_print_idle_cb (EmbedPrintInfo *info)
{
GnomePrintJob *job;
+ int ret;
+
+ /* Sometimes mozilla doesn't even create the temp file!? */
+ if (g_file_test (info->tempfile, G_FILE_TEST_EXISTS) == FALSE) return FALSE;
+
+ /* FIXME: is this actually necessary? libc docs say all streams
+ * are flushed when reading from any stream.
+ */
+ fflush(NULL);
job = gnome_print_job_new (info->config);
gnome_print_job_set_file (job, info->tempfile);
gnome_print_job_print (job);
-
g_object_unref (job);
-
+
unlink (info->tempfile);
ephy_print_info_free (info);