Skip to content

Commit

Permalink
HaikuDepot: Update list on installation location package changes
Browse files Browse the repository at this point in the history
Very dumb implementation (just does a full update). I leave it to the
HaikuDepot hackers to improve it.
  • Loading branch information
weinhold committed Jun 17, 2014
1 parent 5c9672e commit a852846
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/apps/haikudepot/MainWindow.cpp
Expand Up @@ -126,6 +126,9 @@ MainWindow::MainWindow(BRect frame, const BMessage& settings)
if (settings.FindBool("show source packages", &showOption) == B_OK)
fModel.SetShowSourcePackages(showOption);

BPackageRoster().StartWatching(this,
B_WATCH_PACKAGE_INSTALLATION_LOCATIONS);

_StartRefreshWorker();

fPendingActionsSem = create_sem(0, "PendingPackageActions");
Expand All @@ -140,6 +143,8 @@ MainWindow::MainWindow(BRect frame, const BMessage& settings)

MainWindow::~MainWindow()
{
BPackageRoster().StopWatching(this);

fTerminating = true;
if (fModelWorker > 0)
wait_for_thread(fModelWorker, NULL);
Expand Down Expand Up @@ -180,6 +185,12 @@ MainWindow::MessageReceived(BMessage* message)
// TODO: ?
break;

case B_PACKAGE_UPDATE:
// TODO: We should do a more selective update depending on the
// "event", "location", and "change count" fields!
_StartRefreshWorker(false);
break;

case MSG_REFRESH_DEPOTS:
_StartRefreshWorker(true);
break;
Expand Down

0 comments on commit a852846

Please sign in to comment.