Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Core/FlatpakBackend.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ public class AppCenterCore.FlatpakBackend : Object, Backend {

package_list = new_package_list;

if (MainContext.get_thread_default () == null) {
if (Thread.self<bool> () != worker_thread) {
// We are in the main thread so update immediately
update_package_store (removed, added);
} else {
Expand Down
6 changes: 1 addition & 5 deletions src/Core/Package.vala
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,7 @@ public class AppCenterCore.Package : Object {
return _component_id;
}

_component_id = component.id;
if (_component_id.has_suffix (".desktop")) {
// ".desktop" is always 8 bytes in UTF-8 so we can just chop 8 bytes off the end
_component_id = _component_id.substring (0, _component_id.length - 8);
}
_component_id = Utils.normalize_component_id (component.id);

return _component_id;
}
Expand Down
9 changes: 9 additions & 0 deletions src/Utils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,13 @@ namespace Utils {
public static bool is_running_in_guest_session () {
return Environment.get_user_name ().has_prefix ("guest-");
}

public static string normalize_component_id (string component_id) {
if (component_id.has_suffix (".desktop")) {
// ".desktop" is always 8 bytes in UTF-8 so we can just chop 8 bytes off the end
return component_id.substring (0, component_id.length - 8);
}

return component_id;
}
}