[haiku-commits] BRANCH HaikuPM-github.package-management [f4058a3] src/apps/haiku-depot

  • From: HaikuPM-github.package-management <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 22 Sep 2013 23:00:33 +0200 (CEST)

added 2 changesets to branch 'refs/remotes/HaikuPM-github/package-management'
old head: d68208fa16f6716c53d598d3aa65ed1d4659d06a
new head: f4058a3f9f229a812fd5a0d3e33011aacec25d05
overview: https://github.com/haiku/HaikuPM/compare/d68208f...f4058a3

----------------------------------------------------------------------------

34f4c3e: HaikuDepot: Fix #10000.
  
  - When switching selected packages, compare the new and old package action
    list. If they're the same, don't bother rebuilding the button bar.

f4058a3: HaikuDepot: Adjust displayed publisher.
  
  - If available, show the package's copyright information for the
    publisher rather than the vendor, as the latter simply indicates
    the maintainer of the repository rather than the actual developers
    of the software contained in the package.

                                      [ Rene Gollent <anevilyak@xxxxxxxxx> ]

----------------------------------------------------------------------------

2 files changed, 26 insertions(+), 6 deletions(-)
src/apps/haiku-depot/MainWindow.cpp      |  6 +++++-
src/apps/haiku-depot/PackageInfoView.cpp | 26 +++++++++++++++++++++-----

############################################################################

Commit:      34f4c3ec4f135fee3ff025ab530b0df11f267452
Author:      Rene Gollent <anevilyak@xxxxxxxxx>
Date:        Sun Sep 22 20:46:33 2013 UTC

Ticket:      https://dev.haiku-os.org/ticket/10000

HaikuDepot: Fix #10000.

- When switching selected packages, compare the new and old package action
  list. If they're the same, don't bother rebuilding the button bar.

----------------------------------------------------------------------------

diff --git a/src/apps/haiku-depot/PackageInfoView.cpp 
b/src/apps/haiku-depot/PackageInfoView.cpp
index 859ddf3..11d24a8 100644
--- a/src/apps/haiku-depot/PackageInfoView.cpp
+++ b/src/apps/haiku-depot/PackageInfoView.cpp
@@ -537,14 +537,31 @@ public:
 
        void SetPackage(const PackageInfo& package)
        {
-               Clear();
-
                PackageManager manager(
                        BPackageKit::B_PACKAGE_INSTALLATION_LOCATION_HOME);
 
-               fPackageActions = manager.GetPackageActions(
+               PackageActionList actions = manager.GetPackageActions(
                        const_cast<PackageInfo*>(&package));
 
+               bool clearNeeded = false;
+               if (actions.CountItems() != fPackageActions.CountItems())
+                       clearNeeded = true;
+               else {
+                       for (int32 i = 0; i < actions.CountItems(); i++) {
+                               if (strcasecmp(actions.ItemAtFast(i)->Label(),
+                                               
fPackageActions.ItemAtFast(i)->Label()) != 0) {
+                                       clearNeeded = true;
+                                       break;
+                               }
+                       }
+               }
+
+               fPackageActions = actions;
+               if (!clearNeeded)
+                       return;
+
+               Clear();
+
                // Add Buttons in reverse action order
                for (int32 i = fPackageActions.CountItems() - 1; i >= 0; i--) {
                        const PackageActionRef& action = 
fPackageActions.ItemAtFast(i);

############################################################################

Commit:      f4058a3f9f229a812fd5a0d3e33011aacec25d05
Author:      Rene Gollent <anevilyak@xxxxxxxxx>
Date:        Sun Sep 22 20:48:10 2013 UTC

HaikuDepot: Adjust displayed publisher.

- If available, show the package's copyright information for the
  publisher rather than the vendor, as the latter simply indicates
  the maintainer of the repository rather than the actual developers
  of the software contained in the package.

----------------------------------------------------------------------------

diff --git a/src/apps/haiku-depot/MainWindow.cpp 
b/src/apps/haiku-depot/MainWindow.cpp
index 8e1f4bf..d791aa4 100644
--- a/src/apps/haiku-depot/MainWindow.cpp
+++ b/src/apps/haiku-depot/MainWindow.cpp
@@ -405,10 +405,14 @@ MainWindow::_RefreshPackageList()
                        BString publisherURL;
                        if (repoPackageInfo.URLList().CountStrings() > 0)
                                publisherURL = 
repoPackageInfo.URLList().StringAt(0);
+                       const BStringList& rightsList = 
repoPackageInfo.CopyrightList();
+                       BString publisherName = repoPackageInfo.Vendor();
+                       if (rightsList.CountStrings() > 0)
+                               publisherName = rightsList.StringAt(0);
                        modelInfo.SetTo(new(std::nothrow) PackageInfo(NULL,
                                        repoPackageInfo.Name(),
                                        repoPackageInfo.Version().ToString(),
-                                       PublisherInfo(BitmapRef(), 
repoPackageInfo.Vendor(),
+                                       PublisherInfo(BitmapRef(), 
publisherName,
                                        "", publisherURL), 
repoPackageInfo.Summary(),
                                        repoPackageInfo.Description(), ""),
                                true);
diff --git a/src/apps/haiku-depot/PackageInfoView.cpp 
b/src/apps/haiku-depot/PackageInfoView.cpp
index 11d24a8..75c6a96 100644
--- a/src/apps/haiku-depot/PackageInfoView.cpp
+++ b/src/apps/haiku-depot/PackageInfoView.cpp
@@ -431,8 +431,7 @@ public:
 
                fTitleView->SetText(package.Title());
 
-               BString publisher = B_TRANSLATE("by %Publisher%");
-               publisher.ReplaceAll("%Publisher%", package.Publisher().Name());
+               BString publisher = package.Publisher().Name();
                fPublisherView->SetText(publisher);
 
                BString version = B_TRANSLATE("%Version%");


Other related posts:

  • » [haiku-commits] BRANCH HaikuPM-github.package-management [f4058a3] src/apps/haiku-depot - HaikuPM-github . package-management