Opened 10 years ago

Closed 9 years ago

#11886 closed enhancement (fixed)

HaikuDepot's contents tab should live-update

Reported by: humdinger Owned by: stippi
Priority: normal Milestone: R1
Component: Applications/HaikuDepot Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

This is hrev48848.

HaikuDepot's "Contents" tab can only show a package's contents after it's been downloaded/installed. But currently, if I click the "Install" button, I still have to restart HaikuDepot for the "Contents" tab to show the contents. Would be nice if the tab's view could be informed that the contents is now available for displaying.

Attachments (2)

0001-HaikuDepot-Update-content-tab-when-package-is-instal.patch (1.4 KB ) - added by TwoFx 9 years ago.
Proposed patch
0001-HaikuDepot-Update-the-content-tab-when-the-state-of-.patch (2.2 KB ) - added by TwoFx 9 years ago.
Improved version of the proposed patch

Download all attachments as: .zip

Change History (9)

comment:1 by TwoFx, 9 years ago

patch: 01

comment:2 by TwoFx, 9 years ago

The attached patch updates the contents tab each time the status of the attached package changes.

comment:3 by stippi, 9 years ago

Thanks for your work / the patch! I faintly remember that checking and preventing the same package to be rescanned in PackageContentsView was done for performance reasons. Are you sure there is no performance regression now in certain use-cases? To make sure this cannot be the case, one could move code from SetPackage() into a separate public method (maybe ScanPackage() ?) and then call that method directly when the package status changes.

comment:4 by TwoFx, 9 years ago

Good idea. I will look into that as soon as I am home. Another option would be to reintroduce the check I removed but only return if the package is already known and its state has changed since it was last scanned.

Version 0, edited 9 years ago by TwoFx (next)

comment:5 by stippi, 9 years ago

Yes, the last idea is good.

comment:6 by TwoFx, 9 years ago

I believe that the fPackage == package check was there to circumvent a bug in PackageContentsView: fContentsView->MakeEmpty() is called outside the populator thread, so when SetPackage is called twice in a row for the same package in very quick succession, MakeEmpty is called twice and then the populator runs twice. Those quick successive calls seem to occur rather frequently in HaikuDepot, so with the check removed, you would sometimes see the "Package contents not available for remote packages" message twice in the content tab. Now, with the check reinstantiated, the bug does not occur any more, but I still suggest calling MakeEmpty again in either _ContentPopulatorThread or _PopulatePackageContents.

by TwoFx, 9 years ago

Improved version of the proposed patch

comment:7 by stippi, 9 years ago

Resolution: fixed
Status: newclosed

Somehow the patch did not apply anymore, and I noticed that there were no checks for packageRef.Get() != NULL. So I quickly re-implemented it based on your patch. Thanks! Fixed in hrev49557.

Note: See TracTickets for help on using tickets.