HaikuDepot: Update list on installation location package changes

Very dumb implementation (just does a full update). I leave it to the
HaikuDepot hackers to improve it.
This commit is contained in:
Ingo Weinhold
2014-06-17 20:32:26 +02:00
parent 5c9672edeb
commit a852846fc2
+11
View File
@@ -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");
@@ -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);
@@ -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;