Ticket #11886: 0001-HaikuDepot-Update-the-content-tab-when-the-state-of-.patch

File 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

  • src/apps/haikudepot/ui/PackageContentsView.cpp

    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()  
    283283void
    284284PackageContentsView::SetPackage(const PackageInfoRef& package)
    285285{
    286     if (fPackage == package)
     286    if (fPackage == package && fLastState == package.Get()->State())
    287287        return;
    288288
    289289//  printf("PackageContentsView::SetPackage(%s)\n",
    PackageContentsView::SetPackage(const PackageInfoRef& package)  
    294294    {
    295295        BAutolock lock(&fPackageLock);
    296296        fPackage = package;
     297        fLastState = fPackage.Get()->State();
    297298    }
    298299    release_sem_etc(fContentPopulatorSem, 1, 0);
    299300}
  • src/apps/haikudepot/ui/PackageContentsView.h

    diff --git a/src/apps/haikudepot/ui/PackageContentsView.h b/src/apps/haikudepot/ui/PackageContentsView.h
    index 2cd58a2..51f8218 100644
    a b private:  
    3939            sem_id              fContentPopulatorSem;
    4040            BLocker             fPackageLock;
    4141            PackageInfoRef      fPackage;
     42            PackageState        fLastState;
    4243};
    4344
    4445#endif // PACKAGE_CONTENTS_VIEW_H
  • src/apps/haikudepot/ui/PackageInfoView.cpp

    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)  
    14271427
    14281428            if ((changes & PKG_CHANGED_STATE) != 0) {
    14291429                fPackageActionView->SetPackage(*package.Get());
     1430                fPagesView->SetPackage(package, false);
    14301431            }
    14311432
    14321433            break;