Skip to content

Commit 1b1d5fd

Browse files
committed
fixed grabing page icon
1 parent c7d74f2 commit 1b1d5fd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

data/com.github.artemanufrij.webpin.appdata.xml

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<p>Fixed:</p>
4444
<ul>
4545
<li>Restore correct window size</li>
46+
<li>Grabing page icon</li>
4647
</ul>
4748
<p>Translation:</p>
4849
<ul>

src/Widgets/Views/Editor.vala

+7-1
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,13 @@ namespace Webpin.Widgets.Views {
490490
string icon = icon_name_entry.get_text ();
491491
if (tmp_icon_file != "") {
492492
var new_icon = GLib.Path.build_filename (WebpinApp.instance.CACHE_FOLDER, app_name_entry.get_text () + tmp_icon_ext);
493-
FileUtils.rename (tmp_icon_file, new_icon);
493+
uint8[] content;
494+
try {
495+
FileUtils.get_data (tmp_icon_file, out content);
496+
FileUtils.set_data (new_icon, content);
497+
} catch (Error err) {
498+
warning (err.message);
499+
}
494500
FileUtils.remove (tmp_icon_file);
495501
icon = new_icon;
496502
}

0 commit comments

Comments
 (0)