[haiku-commits] haiku: hrev47135 - src/apps/aboutsystem

  • From: jessica.l.hamilton@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 19 Apr 2014 15:43:34 +0200 (CEST)

hrev47135 adds 1 changeset to branch 'master'
old head: 07fae11ef898713d80462312addd8136df9ec081
new head: 94febdfe8758216bf5b16197dac8dd1b34e06d6d
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=94febdf+%5E07fae11

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

94febdf: AboutSystem: use BPathFinder correctly

                         [ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

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

Revision:    hrev47135
Commit:      94febdfe8758216bf5b16197dac8dd1b34e06d6d
URL:         http://cgit.haiku-os.org/haiku/commit/?id=94febdf
Author:      Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date:        Sat Apr 19 13:41:38 2014 UTC

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

1 file changed, 11 insertions(+), 5 deletions(-)
src/apps/aboutsystem/AboutSystem.cpp | 16 +++++++++++-----

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

diff --git a/src/apps/aboutsystem/AboutSystem.cpp 
b/src/apps/aboutsystem/AboutSystem.cpp
index 71405ae..ec28655 100644
--- a/src/apps/aboutsystem/AboutSystem.cpp
+++ b/src/apps/aboutsystem/AboutSystem.cpp
@@ -36,6 +36,7 @@
 #include <Screen.h>
 #include <ScrollView.h>
 #include <String.h>
+#include <StringList.h>
 #include <StringView.h>
 #include <TranslationUtils.h>
 #include <TranslatorFormats.h>
@@ -1756,13 +1757,18 @@ status_t
 AboutView::_GetLicensePath(const char* license, BPath& path)
 {
        BPathFinder pathFinder;
+       BStringList paths;
        struct stat st;
 
-       status_t error = pathFinder.FindPath(B_FIND_PATH_DATA_DIRECTORY,
-               "licenses", path);
-       if (error == B_OK && path.Append(license) == B_OK
-               && lstat(path.Path(), &st) == 0) {
-               return B_OK;
+       status_t error = pathFinder.FindPaths(B_FIND_PATH_DATA_DIRECTORY,
+               "licenses", paths);
+
+       for (int i = 0; i < paths.CountStrings(); ++i) {
+               if (error == B_OK && path.SetTo(paths.StringAt(i)) == B_OK
+                       && path.Append(license) == B_OK
+                       && lstat(path.Path(), &st) == 0) {
+                       return B_OK;
+               }
        }
 
        path.Unset();


Other related posts: