added 1 changeset to branch 'refs/remotes/axeld-github/pkgman-progress' old head: 31dd73a57a9c24058e04efcde210db30f623f7c6 new head: 8430211a187db1fff545c482596dc75dc11ed94e overview: https://github.com/axeld/haiku/compare/31dd73a57a9c...8430211a187d ---------------------------------------------------------------------------- 8430211a187d: Build fixes. [ Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> ] ---------------------------------------------------------------------------- Commit: 8430211a187db1fff545c482596dc75dc11ed94e Author: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> Date: Sat Jan 24 16:45:02 2015 UTC ---------------------------------------------------------------------------- 5 files changed, 30 insertions(+), 24 deletions(-) src/apps/haikudepot/model/PackageManager.cpp | 42 ++++++++++++------------ src/apps/haikudepot/model/PackageManager.h | 4 ++- src/bin/pkgman/PackageManager.cpp | 3 ++ src/servers/package/PackageManager.cpp | 2 +- src/servers/package/PackageManager.h | 3 +- ---------------------------------------------------------------------------- diff --git a/src/apps/haikudepot/model/PackageManager.cpp b/src/apps/haikudepot/model/PackageManager.cpp index 8190d6e..e2f9e3b 100644 --- a/src/apps/haikudepot/model/PackageManager.cpp +++ b/src/apps/haikudepot/model/PackageManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014, Haiku, Inc. All Rights Reserved. + * Copyright 2013-2015, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -313,14 +313,14 @@ struct DeskbarLink { link(link) { } - + DeskbarLink(const DeskbarLink& other) : path(other.path), link(other.link) { } - + DeskbarLink& operator=(const DeskbarLink& other) { if (this == &other) @@ -329,17 +329,17 @@ struct DeskbarLink { link = other.link; return *this; } - + bool operator==(const DeskbarLink& other) { return path == other.path && link == other.link; } - + bool operator!=(const DeskbarLink& other) { return !(*this == other); } - + BString path; BString link; }; @@ -367,24 +367,24 @@ public: } return B_OK; } - + virtual status_t HandleEntryAttribute(BPackageEntry* entry, BPackageEntryAttribute* attribute) { return B_OK; } - + virtual status_t HandleEntryDone(BPackageEntry* entry) { return B_OK; } - + virtual status_t HandlePackageAttribute( const BPackageInfoAttributeValue& value) { return B_OK; } - + virtual void HandleErrorOccurred() { } @@ -419,7 +419,7 @@ public: int32 lastPathSeparator = target.FindLast('/'); if (lastPathSeparator > 0 && lastPathSeparator + 1 < target.Length()) target.Remove(0, lastPathSeparator + 1); - + fLabel.ReplaceAll("%DeskbarLink%", target); } @@ -448,7 +448,7 @@ public: } else { return B_ERROR; } - + status = path.Append(fDeskbarLink.path); if (status == B_OK) status = path.GetParent(&path); @@ -457,14 +457,14 @@ public: printf("trying to launch: %s\n", path.Path()); } } - + entry_ref ref; if (status == B_OK) status = get_ref_for_path(path.Path(), &ref); - + if (status == B_OK) status = be_roster->Launch(&ref); - + return status; } @@ -494,7 +494,7 @@ public: } packagePath.Append(package->FileName()); - + BNoErrorOutput errorOutput; BPackageReader reader(&errorOutput); @@ -505,7 +505,7 @@ public: packagePath.Path(), strerror(status)); return false; } - + // Scan package contents for Deskbar links DeskbarLinkFinder contentHandler(foundLinks); status = reader.ParseContent(&contentHandler); @@ -515,7 +515,7 @@ public: packagePath.Path(), strerror(status)); return false; } - + return foundLinks.CountItems() > 0; } @@ -567,7 +567,7 @@ PackageManager::GetPackageActions(PackageInfoRef package, Model* model) if (state == ACTIVATED || state == INSTALLED) { actionList.Add(PackageActionRef(new UninstallPackageAction( package, model), true)); - + // Add OpenPackageActions for each deskbar link found in the // package DeskbarLinkList foundLinks; @@ -721,13 +721,13 @@ PackageManager::Warn(status_t error, const char* format, ...) void PackageManager::ProgressPackageDownloadStarted(const char* packageName) { - ProgressPackageDownloadActive(packageName, 0.0f); + ProgressPackageDownloadActive(packageName, 0.0f, 0, 0); } void PackageManager::ProgressPackageDownloadActive(const char* packageName, - float completionPercentage) + float completionPercentage, off_t bytes, off_t totalBytes) { for (int32 i = 0; i < fPackageProgressListeners.CountItems(); i++) { fPackageProgressListeners.ItemAt(i)->DownloadProgressChanged( diff --git a/src/apps/haikudepot/model/PackageManager.h b/src/apps/haikudepot/model/PackageManager.h index f56a071..c5cb0b3 100644 --- a/src/apps/haikudepot/model/PackageManager.h +++ b/src/apps/haikudepot/model/PackageManager.h @@ -96,7 +96,9 @@ private: const char* packageName); virtual void ProgressPackageDownloadActive( const char* packageName, - float completionPercentage); + float completionPercentage, + off_t bytes, off_t totalBytes); + virtual void ProgressPackageDownloadComplete( const char* packageName); virtual void ProgressPackageChecksumStarted( diff --git a/src/bin/pkgman/PackageManager.cpp b/src/bin/pkgman/PackageManager.cpp index 6d9311f..00b60dc 100644 --- a/src/bin/pkgman/PackageManager.cpp +++ b/src/bin/pkgman/PackageManager.cpp @@ -9,6 +9,9 @@ */ +#include <StringForSize.h> + // Must be first, or the BPrivate namespaces are confused + #include "PackageManager.h" #include <package/CommitTransactionResult.h> diff --git a/src/servers/package/PackageManager.cpp b/src/servers/package/PackageManager.cpp index 2c1eb85..8799aa2 100644 --- a/src/servers/package/PackageManager.cpp +++ b/src/servers/package/PackageManager.cpp @@ -320,7 +320,7 @@ PackageManager::ProgressPackageDownloadStarted(const char* packageName) void PackageManager::ProgressPackageDownloadActive(const char* packageName, - float completionPercentage) + float completionPercentage, off_t bytes, off_t totalBytes) { } diff --git a/src/servers/package/PackageManager.h b/src/servers/package/PackageManager.h index 95106fb..56f3a44 100644 --- a/src/servers/package/PackageManager.h +++ b/src/servers/package/PackageManager.h @@ -65,7 +65,8 @@ private: const char* packageName); virtual void ProgressPackageDownloadActive( const char* packageName, - float completionPercentage); + float completionPercentage, + off_t bytes, off_t totalBytes); virtual void ProgressPackageDownloadComplete( const char* packageName); virtual void ProgressPackageChecksumStarted(