Hello community, here is the log from the commit of package spice-up for openSUSE:Factory checked in at 2017-11-11 14:19:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/spice-up (Old) and /work/SRC/openSUSE:Factory/.spice-up.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "spice-up" Sat Nov 11 14:19:24 2017 rev:4 rq:539082 version:1.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/spice-up/spice-up.changes 2017-10-26 18:44:45.418907123 +0200 +++ /work/SRC/openSUSE:Factory/.spice-up.new/spice-up.changes 2017-11-11 14:19:30.199425958 +0100 @@ -1,0 +2,8 @@ +Sat Nov 4 23:56:32 UTC 2017 - [email protected] + +- Update to 1.1.0: + * Add images on Drag & Drop + * Update README.md + * Update com.github.philip-scott.spice-up.appdata.xml + +------------------------------------------------------------------- Old: ---- Spice-up-1.0.1.tar.gz New: ---- Spice-up-1.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ spice-up.spec ++++++ --- /var/tmp/diff_new_pack.KzVHvP/_old 2017-11-11 14:19:31.271386671 +0100 +++ /var/tmp/diff_new_pack.KzVHvP/_new 2017-11-11 14:19:31.271386671 +0100 @@ -17,7 +17,7 @@ Name: spice-up -Version: 1.0.1 +Version: 1.1.0 Release: 0 Summary: Desktop presentation application License: GPL-3.0 ++++++ Spice-up-1.0.1.tar.gz -> Spice-up-1.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Spice-up-1.0.1/README.md new/Spice-up-1.1.0/README.md --- old/Spice-up-1.0.1/README.md 2017-10-13 02:12:40.000000000 +0200 +++ new/Spice-up-1.1.0/README.md 2017-11-02 17:04:08.000000000 +0100 @@ -41,6 +41,7 @@ - **Controller Support**: If you have a USB or Bluetooth controller, plug it in and control your slides! - **Templates**, so you can whip up a presentation in a blink of an eye. - **Edit images** in your favorite editor, and it will automatically update when saved +- **Web Viewer**: Presentations can now be viewed from a web browser if Spice-Up is not installed, even if you're not using Linux - And much more! <p align="center"> Binary files old/Spice-up-1.0.1/Screenshot.png and new/Spice-up-1.1.0/Screenshot.png differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Spice-up-1.0.1/data/SaveFooter-min.html new/Spice-up-1.1.0/data/SaveFooter-min.html --- old/Spice-up-1.0.1/data/SaveFooter-min.html 1970-01-01 01:00:00.000000000 +0100 +++ new/Spice-up-1.1.0/data/SaveFooter-min.html 2017-11-02 17:04:08.000000000 +0100 @@ -0,0 +1,18 @@ +</content></body><script> +var SLIDES='<div class="slides">{0}</div>';var SLIDE_STYLE="background: {1}, {0};";var SLIDE='<div class="slide slide-{2}" style=\'{1}\'>{0}</div>';var TEXT_STYLE="color: {0}; font-family: {1}; font-size: {2}px; {3}; justify-content: {4}; text-align: {5}; font-weight: {6}";var TEXT_ITEM='<text-item class="canvas-item" style="{1}"><span>{0}</span></text-item>';var COLOR_STYLE="background: {0}; {1}";var COLOR_ITEM='<color-item class="canvas-item" style="{0}"></color-item>';var IMAGE_STYLE="background: url(data:image/{1};base64,{0}) no-repeat center; background-size: contain; {2}";var IMAGE_ITEM='<image-item class="canvas-item" style="{0}"></image-item>';var POSITION_STYLE="left: {0}px; top: {1}px; min-width: {2}px; max-width: {2}px; min-height: {3}px; max-height: {3}px;";function setAspectRatio(aspectRatio){switch(aspectRatio){case 1:SCREEN_W=1920;SCREEN_H=1440;X_OFFSET=280;Y_OFFSET=20;MAX_WIDTH=1800+X_OFFSET;MAX_HEIGHT=1532+Y_OFFSET;SLIDE_RATIO="4-3" +FONT_SCALE=4.8;break;case 2:SCREEN_W=1920;SCREEN_H=1080;X_OFFSET=631;Y_OFFSET=20;MAX_WIDTH=2150+X_OFFSET;MAX_HEIGHT=1532+Y_OFFSET;SLIDE_RATIO="16-9" +FONT_SCALE=3.8;break;case 3:SCREEN_W=1920;SCREEN_H=1200;X_OFFSET=540;Y_OFFSET=12;MAX_WIDTH=2065+X_OFFSET;MAX_HEIGHT=1532+Y_OFFSET +SLIDE_RATIO="16-10" +FONT_SCALE=3.9;break;case 4:SCREEN_W=1920;SCREEN_H=1280;X_OFFSET=400;Y_OFFSET=20;MAX_WIDTH=1920+X_OFFSET;MAX_HEIGHT=1350+Y_OFFSET;SLIDE_RATIO="4-3" +FONT_SCALE=4.4;break;case 5:SCREEN_W=2100;SCREEN_H=1280;X_OFFSET=210;Y_OFFSET=20;MAX_WIDTH=1920+X_OFFSET;MAX_HEIGHT=1350+Y_OFFSET;SLIDE_RATIO="4-3" +FONT_SCALE=5.2;break}} +function getPosition(item){var w_scale=SCREEN_W/MAX_WIDTH;var h_scale=SCREEN_H/MAX_HEIGHT;var x=(item.x+X_OFFSET)*w_scale;var y=(item.y+Y_OFFSET)*h_scale;var w=item.w*w_scale;var h=item.h*h_scale;return String.build(POSITION_STYLE,x,y,w,h)} +function renderSlides(file){let root_object=JSON.parse(file);let content="";for(var id in root_object.slides){setAspectRatio(root_object["aspect-ratio"]);let slide=root_object.slides[id];let slide_content="";for(var object_id in slide.items){let item=slide.items[object_id];var pos=getPosition(item);let style="";switch(item.type){case "text":let text=base64Decode(item['text-data']);let justification;let text_align="";switch(item.justification){case 0:justification="flex-start";text_align="left";break;case 1:justification="center";text_align="center";break;case 2:justification="flex-end";text_align="right";break;case 3:justification="center";text_align="justify";break} +let font_style=item["font-style"];if(font_style.indexOf("italic")!=-1){font_style=font_style.replace(" italic","")} +switch(font_style){case "black":font_style="900";break;case "extrabold":font_style="800";break;case "semibold":font_style="600";break;case "bold":font_style="700";break;case "medium":font_style="500";break;case "regular":font_style="400";break;case "extralight":font_style="300";break;case "light":font_style="200";break;case "thin":font_style="100";break} +style=String.build(TEXT_STYLE,item.color,item.font,item["font-size"]*FONT_SCALE,pos,justification,text_align,font_style);slide_content+=String.build(TEXT_ITEM,text,style);break;case "color":style=String.build(COLOR_STYLE,item.background_color,pos);slide_content+=String.build(COLOR_ITEM,style);break +case "image":style=String.build(IMAGE_STYLE,item["image-data"],item.image,pos);slide_content+=String.build(IMAGE_ITEM,style);break}} +let background_pattern=slide["background-pattern"];if(background_pattern!==""){let pattern=background_pattern.split("/");background_pattern="url(https://raw.githubusercontent.com/Philip-Scott/Spice-up/master/data/assets/patterns/"+pattern[pattern.length-1]+")"}else{background_pattern="none"} +let style=String.build(SLIDE_STYLE,slide["background-color"],background_pattern);content+=String.build(SLIDE,slide_content,style,SLIDE_RATIO);get('body').innerHTML=String.build(SLIDES,content)}} +renderSlides(get('content').innerHTML) +</script></html> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Spice-up-1.0.1/data/SaveFormat.html new/Spice-up-1.1.0/data/SaveFormat.html --- old/Spice-up-1.0.1/data/SaveFormat.html 1970-01-01 01:00:00.000000000 +0100 +++ new/Spice-up-1.1.0/data/SaveFormat.html 2017-11-02 17:04:08.000000000 +0100 @@ -0,0 +1,286 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="UTF-8"> + <title>Spice-Up - WebViewer</title> + <meta name="viewport" content="width=device-width, initial-scale=1" /> +</head> +<style> + .slides { + background-color: #363B3E; + } + + html, body { + background-color: #363B3E; + } + + #content { + display: none; + } + + .slide { + background-color: lightgray; + position: relative; + overflow: hidden; + margin-bottom: 16px; + margin-left: auto; + margin-right: auto; + border: solid 1px #0E0F10; + border-radius: 12px; + } + + .slide-16-9 { + min-width: 1920px; + max-width: 1920px; + min-height: 1080px; + max-height: 1080px; + } + + .slide-16-10 { + min-width: 1920px; + max-width: 1920px; + min-height: 1200px; + max-height: 1200px; + } + + .slide-4-3 { + min-width: 1920px; + max-width: 1920px; + min-height: 1440px; + max-height: 1440px; + } + + .slide-3-2 { + min-width: 1920px; + max-width: 1920px; + min-height: 1280px; + max-height: 1280px; + } + + .slide-5-4 { + min-width: 1920px; + max-width: 1920px; + min-height: 1536px; + max-height: 1536px; + } + + .canvas-item { + position: absolute; + display: flex; + } + + text-item { + white-space: pre-wrap; + } + + text-item span { + align-self: center; + } +</style> +<script> + if (!String.build) { + String.build = function (format) { + var args = Array.prototype.slice.call (arguments, 1); + return format.replace (/{(\d+)}/g, function (match, number) { + return typeof args[number] != 'undefined' + ? args[number] + : match; + }); + }; + } + + function base64Decode(str) { + return decodeURIComponent(Array.prototype.map.call(atob(str), function(c) { + return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); + }).join('')); + } + + function makeIdEditable (id) { + get (id).contentEditable = "true"; + } + + function get (id) { + return document.getElementById(id); + } + + function downloadString (element, fileName, mime) { + var dlAnchorElem = document.getElementById ('download-anchor'); + + if (dlAnchorElem === null) { + document.getElementById ("body").innerHTML += '<a id="download-anchor" style="display:none"></a>'; + dlAnchorElem = document.getElementById ('download-anchor'); + } + + var dataStr = "data:" + mime + ";charset=utf-8," + encodeURIComponent(element); + var dlAnchorElem = document.getElementById ('download-anchor'); + dlAnchorElem.setAttribute ("href", dataStr); + dlAnchorElem.setAttribute ("download", fileName); + dlAnchorElem.click (); + } +</script> +<body id="body"> + <h1 style="color: #dfdfdf; font-family: sans-serif; text-align: center; width: 100%; margin-top: 200px; font-size: 3em"> Loading presentation... </h1> + <content id="content"> + + </content> +</body> +</html> +<script> +var SLIDES = '<div class="slides">{0}</div>'; + +var SLIDE_STYLE = "background: {1}, {0};"; +var SLIDE = '<div class="slide slide-{2}" style=\'{1}\'>{0}</div>'; + +var TEXT_STYLE = "color: {0}; font-family: {1}; font-size: {2}px; {3}; justify-content: {4}; text-align: {5}; font-weight: {6}"; +var TEXT_ITEM = '<text-item class="canvas-item" style="{1}"><span>{0}</span></text-item>'; + +var COLOR_STYLE = "background: {0}; {1}"; +var COLOR_ITEM = '<color-item class="canvas-item" style="{0}"></color-item>'; + +var IMAGE_STYLE = "background: url(data:image/{1};base64,{0}) no-repeat center; background-size: contain; {2}"; +var IMAGE_ITEM = '<image-item class="canvas-item" style="{0}"></image-item>'; + +var POSITION_STYLE = "left: {0}px; top: {1}px; min-width: {2}px; max-width: {2}px; min-height: {3}px; max-height: {3}px;"; + +function setAspectRatio (aspectRatio) { + switch (aspectRatio) { + case 1: /* ASPECT_4_3 */ + SCREEN_W = 1920; + SCREEN_H = 1440; + X_OFFSET = 280; + Y_OFFSET = 20; + MAX_WIDTH = 1800 + X_OFFSET; + MAX_HEIGHT = 1532 + Y_OFFSET; + SLIDE_RATIO = "4-3" + FONT_SCALE = 4.8; + break; + case 2: /* ASPECT_16_9 */ + SCREEN_W = 1920; + SCREEN_H = 1080; + X_OFFSET = 631; + Y_OFFSET = 20; + MAX_WIDTH = 2150 + X_OFFSET; + MAX_HEIGHT = 1532 + Y_OFFSET; + SLIDE_RATIO = "16-9" + FONT_SCALE = 3.8; + break; + case 3: /* ASPECT_16_10 */ + SCREEN_W = 1920; + SCREEN_H = 1200; + X_OFFSET = 540; + Y_OFFSET = 12; + MAX_WIDTH = 2065 + X_OFFSET; + MAX_HEIGHT = 1532 + Y_OFFSET + SLIDE_RATIO = "16-10" + FONT_SCALE = 3.9; + break; + case 4: /* ASPECT_3_2 */ + SCREEN_W = 1920; + SCREEN_H = 1280; + X_OFFSET = 400; + Y_OFFSET = 20; + MAX_WIDTH = 1920 + X_OFFSET; + MAX_HEIGHT = 1350 + Y_OFFSET; + SLIDE_RATIO = "4-3" + FONT_SCALE = 4.4; + break; + case 5: /* ASPECT_5_4 */ + SCREEN_W = 2100; + SCREEN_H = 1280; + X_OFFSET = 210; + Y_OFFSET = 20; + MAX_WIDTH = 1920 + X_OFFSET; + MAX_HEIGHT = 1350 + Y_OFFSET; + SLIDE_RATIO = "4-3" + FONT_SCALE = 5.2; + break; + } +} + +function getPosition (item) { + var w_scale = SCREEN_W / MAX_WIDTH; + var h_scale = SCREEN_H / MAX_HEIGHT; + + var x = (item["x"] + X_OFFSET) * w_scale; + var y = (item["y"] + Y_OFFSET) * h_scale; + var w = item["w"] * w_scale; + var h = item["h"] * h_scale; + + return String.build (POSITION_STYLE, x, y, w, h); +} + +function renderSlides (file) { + let root_object = JSON.parse (file); + + let content = ""; + for (var id in root_object.slides) { + setAspectRatio (root_object["aspect-ratio"]); + let slide = root_object.slides[id]; + let slide_content = ""; + + for (var object_id in slide.items) { + let item = slide.items[object_id]; + var pos = getPosition(item); + let style = ""; + switch (item["type"]) { + case "text": + let text = base64Decode (item['text-data']); + let justification; + let text_align = ""; + + switch (item['justification']) { + case 0: justification = "flex-start"; text_align = "left"; break; + case 1: justification = "center"; text_align = "center"; break; + case 2: justification = "flex-end"; text_align = "right"; break; + case 3: justification = "center"; text_align = "justify"; break; + } + + let font_style = item["font-style"]; + if (font_style.indexOf("italic") != -1) { + font_style = font_style.replace(" italic", ""); + } + + switch (font_style) { + case "black": font_style = "900"; break; + case "extrabold": font_style = "800"; break; + case "semibold": font_style = "600"; break; + case "bold": font_style = "700"; break; + case "medium": font_style = "500"; break; + case "regular": font_style = "400"; break; + case "extralight": font_style = "300"; break; + case "light": font_style = "200"; break; + case "thin": font_style = "100"; break; + } + + style = String.build (TEXT_STYLE, item["color"], item["font"], item["font-size"] * FONT_SCALE, pos, justification, text_align, font_style); + slide_content += String.build (TEXT_ITEM, text, style); + break; + case "color": + style = String.build (COLOR_STYLE, item["background_color"], pos); + slide_content += String.build (COLOR_ITEM, style); + break + case "image": + style = String.build (IMAGE_STYLE, item["image-data"], item["image"], pos); + slide_content += String.build (IMAGE_ITEM, style); + break; + } + } + + let background_pattern = slide["background-pattern"]; + if (background_pattern !== "") { + let pattern = background_pattern.split ("/"); + background_pattern = "url(https://raw.githubusercontent.com/Philip-Scott/Spice-up/master/data/assets/patterns/" + pattern[pattern.length - 1] + ")"; + } else { + background_pattern = "none"; + } + + let style = String.build (SLIDE_STYLE, slide["background-color"], background_pattern); + content += String.build (SLIDE, slide_content, style, SLIDE_RATIO); + + get ('body').innerHTML = String.build (SLIDES, content); + } +} + +renderSlides (get('content').innerHTML); + +</script> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Spice-up-1.0.1/data/SaveHeader-min.html new/Spice-up-1.1.0/data/SaveHeader-min.html --- old/Spice-up-1.0.1/data/SaveHeader-min.html 1970-01-01 01:00:00.000000000 +0100 +++ new/Spice-up-1.1.0/data/SaveHeader-min.html 2017-11-02 17:04:08.000000000 +0100 @@ -0,0 +1 @@ +<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Spice-Up - WebViewer</title><meta name="viewport" content="width=device-width, initial-scale=1"/></head><style>.slides{background-color: #363B3E;}html, body{background-color: #363B3E;}#content{display: none;}.slide{ background-color: lightgray; position: relative; overflow: hidden; margin-bottom: 16px; margin-left: auto; margin-right: auto; border: solid 1px #0E0F10; border-radius: 12px;}.slide-16-9{min-width: 1920px; max-width: 1920px; min-height: 1080px; max-height: 1080px;}.slide-16-10{min-width: 1920px; max-width: 1920px; min-height: 1200px; max-height: 1200px;}.slide-4-3{min-width: 1920px; max-width: 1920px; min-height: 1440px; max-height: 1440px;}.slide-3-2{min-width: 1920px; max-width: 1920px; min-height: 1280px; max-height: 1280px;}.slide-5-4{min-width: 1920px; max-width: 1920px; min-height: 1536px; max-height: 1536px;}.canvas-item{position: absolute; display: flex;}text-item{white-space: pre-wrap;}text-item span{align-self: center;}</style><script>if (!String.build){String.build=function (format){var args=Array.prototype.slice.call (arguments, 1); return format.replace (/{(\d+)}/g, function (match, number){return typeof args[number] !='undefined' ? args[number] : match;});};}function base64Decode(str){return decodeURIComponent(Array.prototype.map.call(atob(str), function(c){return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);}).join(''));}function makeIdEditable (id){get (id).contentEditable="true";}function get (id){return document.getElementById(id);}function downloadString (element, fileName, mime){var dlAnchorElem=document.getElementById ('download-anchor'); if (dlAnchorElem===null){document.getElementById ("body").innerHTML +='<a id="download-anchor" style="display:none"></a>'; dlAnchorElem=document.getElementById ('download-anchor');}var dataStr="data:" + mime + ";charset=utf-8," + encodeURIComponent(element); var dlAnchorElem=document.getElementById ('download-anchor'); dlAnchorElem.setAttribute ("href", dataStr); dlAnchorElem.setAttribute ("download", fileName); dlAnchorElem.click ();}</script><body id="body"> <h1 style="color: #dfdfdf; font-family: sans-serif; text-align: center; width: 100%; margin-top: 200px; font-size: 3em"> Loading presentation... </h1> <content id="content"> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Spice-up-1.0.1/data/assets.gresource.xml new/Spice-up-1.1.0/data/assets.gresource.xml --- old/Spice-up-1.0.1/data/assets.gresource.xml 2017-10-13 02:12:40.000000000 +0200 +++ new/Spice-up-1.1.0/data/assets.gresource.xml 2017-11-02 17:04:08.000000000 +0100 @@ -9,6 +9,8 @@ <file alias="align-middle-symbolic" compressed="false" preprocess="xml-stripblanks">icons/align-middle-symbolic.svg</file> <file alias="align-bottom-symbolic" compressed="false" preprocess="xml-stripblanks">icons/align-bottom-symbolic.svg</file> <file alias="stylesheet.css" compressed="false" preprocess="">stylesheet.css</file> + <file alias="save-header" compressed="false" preprocess="">SaveHeader-min.html</file> + <file alias="save-footer" compressed="false" preprocess="">SaveFooter-min.html</file> </gresource> <gresource prefix="/com/github/philip-scott/spice-up/templates"> <file alias="BigCity.spice" compressed="false" preprocess="">assets/templates/BigCity.spice</file> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Spice-up-1.0.1/data/com.github.philip-scott.spice-up.appdata.xml new/Spice-up-1.1.0/data/com.github.philip-scott.spice-up.appdata.xml --- old/Spice-up-1.0.1/data/com.github.philip-scott.spice-up.appdata.xml 2017-10-13 02:12:40.000000000 +0200 +++ new/Spice-up-1.1.0/data/com.github.philip-scott.spice-up.appdata.xml 2017-11-02 17:04:08.000000000 +0100 @@ -15,16 +15,25 @@ </p> <ul> <li>Exporting to PDF!</li> - <li>Presentation Browser: Scroll though the presentations you have made and jump right into them with one click!.</li> + <li>Presentation Browser: Scroll through the presentations you have made and jump right into them with one click!.</li> <li>Controller Support: If you have a USB or Bluetooth controller, plug it in and control your slides!</li> <li>Templates, so you can whip up a presentation in a blink of an eye.</li> <li>You can edit images in your favorite editor, and it will automatically update when saved</li> + <li>Open Spice-Up files from a web browser by drag and drop if the app is not installed!</li> </ul> </description> <provides> <binary>spice-up</binary> </provides> <releases> + <release version="1.1.0" date="2017-11-2"> + <description> + <p>Huge Success!</p> + <ul> + <li>Presentations saved can now be viewed from a web browser by drag and drop if Spice-Up is not installed, and even if you're not using elementary OS or Linux</li> + </ul> + </description> + </release> <release version="1.0.1" date="2017-10-13"> <description> <p>I'm making a note here...</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Spice-up-1.0.1/pull_request_template.md new/Spice-up-1.1.0/pull_request_template.md --- old/Spice-up-1.0.1/pull_request_template.md 1970-01-01 01:00:00.000000000 +0100 +++ new/Spice-up-1.1.0/pull_request_template.md 2017-11-02 17:04:08.000000000 +0100 @@ -0,0 +1,9 @@ +Fixes # + +Changes made in this pull request: +- . +- . +- . + + +Thank you for making a pull request! I will try to review it as soon as possible. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Spice-up-1.0.1/src/Services/FileManager.vala new/Spice-up-1.1.0/src/Services/FileManager.vala --- old/Spice-up-1.0.1/src/Services/FileManager.vala 2017-10-13 02:12:40.000000000 +0200 +++ new/Spice-up-1.1.0/src/Services/FileManager.vala 2017-11-02 17:04:08.000000000 +0100 @@ -110,6 +110,10 @@ return result; } + private static string? header = null; + private static string? footer = null; + private const string RESOURCE_PATH = "resource:///com/github/philip-scott/spice-up/%s"; + public static void write_file (string contents) { if (current_file == null) { return; @@ -123,10 +127,26 @@ } } + if (header == null) { + var file = File.new_for_uri (RESOURCE_PATH.printf ("save-header")); + var dis = new DataInputStream (file.read ()); + size_t size; + + header = dis.read_upto ("\0", -1, out size); + } + + if (footer == null) { + var file = File.new_for_uri (RESOURCE_PATH.printf ("save-footer")); + var dis = new DataInputStream (file.read ()); + size_t size; + + footer = dis.read_upto ("\0", -1, out size); + } + create_file_if_not_exists (current_file); try { - GLib.FileUtils.set_data (current_file.get_path (), contents.data); + GLib.FileUtils.set_data (current_file.get_path (), (header + contents + footer).data); } catch (Error e) { warning ("Could not write file \"%s\": %s", current_file.get_basename (), e.message); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Spice-up-1.0.1/src/Services/Slide.vala new/Spice-up-1.1.0/src/Services/Slide.vala --- old/Spice-up-1.0.1/src/Services/Slide.vala 2017-10-13 02:12:40.000000000 +0200 +++ new/Spice-up-1.1.0/src/Services/Slide.vala 2017-11-02 17:04:08.000000000 +0100 @@ -136,7 +136,7 @@ } } - return """{%s, "items": [%s], "preview": "%s"}""".printf (canvas.serialise (), data, preview_data); + return "{%s, \"items\": [%s], \"preview\": \"%s\"}\n".printf (canvas.serialise (), data, preview_data); } public void delete () { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Spice-up-1.0.1/src/Widgets/CanvasItems/CanvasItem.vala new/Spice-up-1.1.0/src/Widgets/CanvasItems/CanvasItem.vala --- old/Spice-up-1.0.1/src/Widgets/CanvasItems/CanvasItem.vala 2017-10-13 02:12:40.000000000 +0200 +++ new/Spice-up-1.1.0/src/Widgets/CanvasItems/CanvasItem.vala 2017-11-02 17:04:08.000000000 +0100 @@ -176,7 +176,7 @@ protected abstract string serialise_item (); public string serialise () { - return """ {"x": %d,"y": %d,"w": %d,"h": %d,%s}""".printf (real_x, real_y, real_width, real_height, serialise_item ()); + return "{\"x\": %d,\"y\": %d,\"w\": %d,\"h\": %d,%s}\n".printf (real_x, real_y, real_width, real_height, serialise_item ()); } protected virtual void load_item_data () {}
