Commit 22396884 authored by Renee Wright's avatar Renee Wright Committed by Commit Bot

Instead of rebuilding updated Crostini apps, just update the name

The name should be the only member of the app item that can change
as a result of the app being updated (i.e. changes to the .desktop
file), so that is the only thing we need to update on the app item.

This fixes the problem of app items moving or changing folder when
the app is updated.

I have tried this on hardware and it works as intended.

Bug: 861524
Change-Id: I20e413991609f861b0b371856e8fc96e4905978c
Reviewed-on: https://chromium-review.googlesource.com/1160067Reviewed-by: default avatarTimothy Loh <timloh@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Renée Wright <rjwright@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581153}
parent 3bc8200d
...@@ -69,8 +69,20 @@ void CrostiniAppModelBuilder::OnRegistryUpdated( ...@@ -69,8 +69,20 @@ void CrostiniAppModelBuilder::OnRegistryUpdated(
for (const std::string& app_id : removed_apps) for (const std::string& app_id : removed_apps)
RemoveApp(app_id, unsynced_change); RemoveApp(app_id, unsynced_change);
for (const std::string& app_id : updated_apps) { for (const std::string& app_id : updated_apps) {
RemoveApp(app_id, unsynced_change); crostini::CrostiniRegistryService::Registration registration =
InsertCrostiniAppItem(registry_service, app_id); *registry_service->GetRegistration(app_id);
if (registration.NoDisplay()) {
RemoveApp(app_id, unsynced_change);
continue;
}
CrostiniAppItem* app_item =
static_cast<CrostiniAppItem*>(GetAppItem(app_id));
if (!app_item) {
InsertCrostiniAppItem(registry_service, app_id);
continue;
}
app_item->SetName(registration.Name());
} }
for (const std::string& app_id : inserted_apps) { for (const std::string& app_id : inserted_apps) {
// If the app has been installed before and has not been cleaned up // If the app has been installed before and has not been cleaned up
......
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