Skip to content

Commit

Permalink
Move validate () to FlatpakBackend (#2154)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Jun 5, 2024
1 parent d4eb368 commit 31a16fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/Core/BackendInterface.vala
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,4 @@ public interface AppCenterCore.Backend : Object {
public abstract async bool update_package (Package package, ChangeInformation? change_info, Cancellable? cancellable) throws GLib.Error;
public abstract async bool remove_package (Package package, ChangeInformation? change_info, Cancellable? cancellable) throws GLib.Error;
public abstract async bool repair (Cancellable? cancellable) throws GLib.Error;

protected bool validate (AppStream.Component component) {
if (component.get_kind () == AppStream.ComponentKind.CONSOLE_APP) {
return false;
}

if (component.get_kind () == AppStream.ComponentKind.RUNTIME) {
return false;
}

return true;
}
}
12 changes: 12 additions & 0 deletions src/Core/FlatpakBackend.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,18 @@ public class AppCenterCore.FlatpakBackend : Backend, Object {
package_list = new_package_list;
}

private bool validate (AppStream.Component component) {
if (component.get_kind () == CONSOLE_APP) {
return false;
}

if (component.get_kind () == RUNTIME) {
return false;
}

return true;
}

private string generate_package_list_key (bool system, string origin, string bundle_id) {
unowned string installation = system ? "system" : "user";
return "%s/%s/%s".printf (installation, origin, bundle_id);
Expand Down

0 comments on commit 31a16fa

Please sign in to comment.