HaikuDepot: Show packages that don't have a repository.
- If a package was installed, but didn't have a corresponding remote repository package, it would have been missed in the list. Detect these and create a special local depot object to house them, so they also make their way into the visible package list. Thanks to diver for reporting the discrepancy.
This commit is contained in:
@@ -422,6 +422,8 @@ MainWindow::_RefreshPackageList()
|
|||||||
// is available in. The above map is used to ensure that in such
|
// is available in. The above map is used to ensure that in such
|
||||||
// cases we consolidate the information, rather than displaying
|
// cases we consolidate the information, rather than displaying
|
||||||
// duplicates
|
// duplicates
|
||||||
|
|
||||||
|
PackageInfoMap remotePackages;
|
||||||
for (int32 i = 0; i < packages.CountItems(); i++) {
|
for (int32 i = 0; i < packages.CountItems(); i++) {
|
||||||
BSolverPackage* package = packages.ItemAt(i);
|
BSolverPackage* package = packages.ItemAt(i);
|
||||||
const BPackageInfo& repoPackageInfo = package->Info();
|
const BPackageInfo& repoPackageInfo = package->Info();
|
||||||
@@ -458,6 +460,7 @@ MainWindow::_RefreshPackageList()
|
|||||||
if (dynamic_cast<BPackageManager::RemoteRepository*>(repository)
|
if (dynamic_cast<BPackageManager::RemoteRepository*>(repository)
|
||||||
!= NULL) {
|
!= NULL) {
|
||||||
depots[repository->Name()].AddPackage(modelInfo);
|
depots[repository->Name()].AddPackage(modelInfo);
|
||||||
|
remotePackages[modelInfo->Title()] = modelInfo;
|
||||||
} else {
|
} else {
|
||||||
const char* installationLocation = NULL;
|
const char* installationLocation = NULL;
|
||||||
if (repository == static_cast<const BSolverRepository*>(
|
if (repository == static_cast<const BSolverRepository*>(
|
||||||
@@ -479,6 +482,24 @@ MainWindow::_RefreshPackageList()
|
|||||||
|
|
||||||
fModel.Clear();
|
fModel.Clear();
|
||||||
|
|
||||||
|
// filter remote packages from the found list
|
||||||
|
// any packages remaining will be locally installed packages
|
||||||
|
// that weren't acquired from a repository
|
||||||
|
for (PackageInfoMap::iterator it = remotePackages.begin();
|
||||||
|
it != remotePackages.end(); ++it) {
|
||||||
|
foundPackages.erase(it->first);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!foundPackages.empty()) {
|
||||||
|
BString repoName = B_TRANSLATE("Local");
|
||||||
|
depots[repoName] = DepotInfo(repoName);
|
||||||
|
DepotInfoMap::iterator depot = depots.find(repoName);
|
||||||
|
for (PackageInfoMap::iterator it = foundPackages.begin();
|
||||||
|
it != foundPackages.end(); ++it) {
|
||||||
|
depot->second.AddPackage(it->second);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (DepotInfoMap::iterator it = depots.begin(); it != depots.end();
|
for (DepotInfoMap::iterator it = depots.begin(); it != depots.end();
|
||||||
++it) {
|
++it) {
|
||||||
fModel.AddDepot(it->second);
|
fModel.AddDepot(it->second);
|
||||||
|
|||||||
Reference in New Issue
Block a user