diff options
author | Sebastian Reichel <sre@ring0.de> | 2018-07-16 00:32:57 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2018-07-17 12:17:06 +0200 |
commit | d6cc1e7da591f784bddecce19e12097de88d0fe8 (patch) | |
tree | 34876d476761fbb52f638ce0039b801a8018433b /src/pdf-invoice | |
parent | e821aca14ee3c59380c82e32c9cfcdbcca144a96 (diff) | |
download | serial-barcode-scanner-d6cc1e7da591f784bddecce19e12097de88d0fe8.tar.bz2 |
fix templatedir
Diffstat (limited to 'src/pdf-invoice')
-rw-r--r-- | src/pdf-invoice/pdf-invoice.vala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pdf-invoice/pdf-invoice.vala b/src/pdf-invoice/pdf-invoice.vala index b41817d..d3177c9 100644 --- a/src/pdf-invoice/pdf-invoice.vala +++ b/src/pdf-invoice/pdf-invoice.vala @@ -86,14 +86,14 @@ public class InvoicePDF { ctx.save(); ctx.translate(-20, 818); ctx.scale(1.42, 1.42); - render_svg(ctx, datadir + "/footer-line.svg"); + render_svg(ctx, Path.build_filename(datadir, "footer-line.svg")); ctx.restore(); } private void draw_logo(Cairo.Context ctx) { ctx.save(); ctx.translate(366,25); - render_svg(ctx, datadir + "/logo.svg"); + render_svg(ctx, Path.build_filename(datadir, "logo.svg")); ctx.restore(); } @@ -362,7 +362,7 @@ public class InvoicePDF { /* load text template */ try { var text = ""; - FileUtils.get_contents(datadir + "/pdf-template.txt", out text); + FileUtils.get_contents(Path.build_filename(datadir, "pdf-template.txt"), out text); text = text.replace("{{{ADDRESS}}}", address); text = text.replace("{{{LASTNAME}}}", invoice_recipient.lastname); text = text.replace("{{{SUM}}}", @"$sum"); @@ -374,7 +374,7 @@ public class InvoicePDF { string vattext; try { - FileUtils.get_contents(datadir + "/" + "vat.txt", out vattext); + FileUtils.get_contents(Path.build_filename(datadir, "vat.txt"), out vattext); } catch(GLib.FileError e) { throw new IOError.FAILED(_("Could not open VAT template: %s"), e.message); } |