From 600c3327a46923b8a2abb0f429bf196c980ac5df Mon Sep 17 00:00:00 2001
From: Markus Himmel <markus@himmel-villmar.de>
Date: Mon, 27 Jul 2015 06:23:03 +0000
Subject: [PATCH] HaikuDepot: Update the content tab when the state of a
package changes
This fixes #11886
---
src/apps/haikudepot/ui/PackageContentsView.cpp | 3 ++-
src/apps/haikudepot/ui/PackageContentsView.h | 1 +
src/apps/haikudepot/ui/PackageInfoView.cpp | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/apps/haikudepot/ui/PackageContentsView.cpp b/src/apps/haikudepot/ui/PackageContentsView.cpp
index 6e6b08c..d18d8b5 100644
a
|
b
|
PackageContentsView::AllAttached()
|
283 | 283 | void |
284 | 284 | PackageContentsView::SetPackage(const PackageInfoRef& package) |
285 | 285 | { |
286 | | if (fPackage == package) |
| 286 | if (fPackage == package && fLastState == package.Get()->State()) |
287 | 287 | return; |
288 | 288 | |
289 | 289 | // printf("PackageContentsView::SetPackage(%s)\n", |
… |
… |
PackageContentsView::SetPackage(const PackageInfoRef& package)
|
294 | 294 | { |
295 | 295 | BAutolock lock(&fPackageLock); |
296 | 296 | fPackage = package; |
| 297 | fLastState = fPackage.Get()->State(); |
297 | 298 | } |
298 | 299 | release_sem_etc(fContentPopulatorSem, 1, 0); |
299 | 300 | } |
diff --git a/src/apps/haikudepot/ui/PackageContentsView.h b/src/apps/haikudepot/ui/PackageContentsView.h
index 2cd58a2..51f8218 100644
a
|
b
|
private:
|
39 | 39 | sem_id fContentPopulatorSem; |
40 | 40 | BLocker fPackageLock; |
41 | 41 | PackageInfoRef fPackage; |
| 42 | PackageState fLastState; |
42 | 43 | }; |
43 | 44 | |
44 | 45 | #endif // PACKAGE_CONTENTS_VIEW_H |
diff --git a/src/apps/haikudepot/ui/PackageInfoView.cpp b/src/apps/haikudepot/ui/PackageInfoView.cpp
index 5d95ce4..e880473 100644
a
|
b
|
PackageInfoView::MessageReceived(BMessage* message)
|
1427 | 1427 | |
1428 | 1428 | if ((changes & PKG_CHANGED_STATE) != 0) { |
1429 | 1429 | fPackageActionView->SetPackage(*package.Get()); |
| 1430 | fPagesView->SetPackage(package, false); |
1430 | 1431 | } |
1431 | 1432 | |
1432 | 1433 | break; |