Unverified Commit 5166de0e authored by Erik Reider's avatar Erik Reider Committed by GitHub

Always unescape image and app icon paths (#518)

parent 8ed5a805
......@@ -29,7 +29,7 @@ namespace SwayNotificationCenter {
if (is_uri) uri = uri.slice (URI_PREFIX.length, uri.length);
var pixbuf = new Gdk.Pixbuf.from_file_at_scale (
uri,
Uri.unescape_string (uri),
icon_size * img.scale_factor,
icon_size * img.scale_factor,
true);
......
......@@ -133,7 +133,7 @@ namespace SwayNotificationCenter {
this.applied_id = applied_id;
this.app_name = app_name;
this.replaces_id = replaces_id;
this.app_icon = app_icon;
this.app_icon = Uri.unescape_string (app_icon);
this.summary = summary;
this.body = body;
this.hints = hints;
......@@ -237,7 +237,7 @@ namespace SwayNotificationCenter {
case "image-path":
case "image_path":
if (hint_value.is_of_type (VariantType.STRING)) {
image_path = hint_value.get_string ();
image_path = Uri.unescape_string (hint_value.get_string ());
}
break;
case "desktop-entry":
......
......@@ -693,8 +693,7 @@ namespace SwayNotificationCenter {
img_app_icon.set_pixel_size (app_icon_size);
bool img_path_is_theme_icon = false;
bool img_path_exists = File.new_for_uri (
param.image_path ?? "").query_exists ();
bool img_path_exists = File.new_for_uri (param.image_path ?? "").query_exists ();
if (param.image_path != null && !img_path_exists) {
// Check if it's not a URI
img_path_exists = File.new_for_path (
......@@ -710,11 +709,10 @@ namespace SwayNotificationCenter {
img_path_is_theme_icon = img_path_exists;
}
}
var app_icon_exists = File.new_for_uri (app_icon_uri ?? "").query_exists ();
if (app_icon_uri != null && !img_path_exists) {
bool app_icon_exists = File.new_for_uri (app_icon_uri ?? "").query_exists ();
if (app_icon_uri != null && !app_icon_exists) {
// Check if it's not a URI
app_icon_exists = File.new_for_path (
app_icon_uri ?? "").query_exists ();
app_icon_exists = File.new_for_path (app_icon_uri ?? "").query_exists ();
}
// Get the image CSS corner radius in pixels
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment