Skip to content

Commit

Permalink
Remove problematic remote icon code
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Feb 7, 2024
1 parent 5ab9f76 commit 10605af
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions src/Core/Package.vala
Original file line number Diff line number Diff line change
Expand Up @@ -748,31 +748,6 @@ public class AppCenterCore.Package : Object {
current_scale = icon_scale;
}

break;
case AppStream.IconKind.REMOTE:
var icon_scale = _icon.get_scale ();
var icon_width = _icon.get_width () * icon_scale;
bool is_bigger = (icon_width > current_size && current_size < pixel_size);
bool has_better_dpi = (icon_width == current_size && current_scale < icon_scale && scale_factor <= icon_scale);
if (is_bigger || has_better_dpi) {
var server_file = File.new_for_uri (_icon.get_url ());
var local_file = File.new_for_path (
Path.build_filename (Environment.get_tmp_dir (), server_file.get_basename ())
);

// FIXME: Copy this async
try {
server_file.copy (local_file, FileCopyFlags.OVERWRITE, null, null);

icon = new FileIcon (local_file);
current_size = icon_width;
current_scale = icon_scale;
} catch (Error e) {
critical ("Unable to download remote icon: %s", e.message);
}

}

break;

case AppStream.IconKind.UNKNOWN:
Expand Down

0 comments on commit 10605af

Please sign in to comment.