ModelWindow: Populate publisher URL if available.
- Also rework things a bit to fix passing the same reference into the installed package list repeatedly, thus causing only the first package to be marked as actually being installed.
This commit is contained in:
@@ -274,15 +274,23 @@ MainWindow::_InitModel()
|
|||||||
PackageInfoMap::iterator it = foundPackages.find(
|
PackageInfoMap::iterator it = foundPackages.find(
|
||||||
repoPackageInfo.Name());
|
repoPackageInfo.Name());
|
||||||
if (it != foundPackages.end())
|
if (it != foundPackages.end())
|
||||||
modelInfo = it->second;
|
modelInfo.SetTo(it->second);
|
||||||
else {
|
else {
|
||||||
|
BString publisherURL;
|
||||||
|
if (repoPackageInfo.URLList().CountStrings() > 0)
|
||||||
|
publisherURL = repoPackageInfo.URLList().StringAt(0);
|
||||||
modelInfo.SetTo(new(std::nothrow) PackageInfo(NULL,
|
modelInfo.SetTo(new(std::nothrow) PackageInfo(NULL,
|
||||||
repoPackageInfo.Name(), repoPackageInfo.Version().ToString(),
|
repoPackageInfo.Name(),
|
||||||
PublisherInfo(BitmapRef(), repoPackageInfo.Vendor(), "", ""),
|
repoPackageInfo.Version().ToString(),
|
||||||
repoPackageInfo.Summary(), repoPackageInfo.Description(), ""),
|
PublisherInfo(BitmapRef(), repoPackageInfo.Vendor(),
|
||||||
|
"", publisherURL), repoPackageInfo.Summary(),
|
||||||
|
repoPackageInfo.Description(), ""),
|
||||||
true);
|
true);
|
||||||
|
|
||||||
if (modelInfo.Get() == NULL)
|
if (modelInfo.Get() == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
foundPackages[repoPackageInfo.Name()] = modelInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
BSolverRepository* repository = package->Repository();
|
BSolverRepository* repository = package->Repository();
|
||||||
@@ -302,13 +310,17 @@ MainWindow::_InitModel()
|
|||||||
installationLocation = "home";
|
installationLocation = "home";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (installationLocation != NULL)
|
if (installationLocation != NULL) {
|
||||||
packageLocations[installationLocation].AddItem(modelInfo.Get());
|
packageLocations[installationLocation].AddItem(
|
||||||
|
modelInfo.Get());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (DepotInfoMap::iterator it = depots.begin(); it != depots.end(); ++it)
|
for (DepotInfoMap::iterator it = depots.begin(); it != depots.end();
|
||||||
|
++it) {
|
||||||
fModel.AddDepot(it->second);
|
fModel.AddDepot(it->second);
|
||||||
|
}
|
||||||
|
|
||||||
for (PackageLocationMap::iterator it = packageLocations.begin();
|
for (PackageLocationMap::iterator it = packageLocations.begin();
|
||||||
it != packageLocations.end(); ++it) {
|
it != packageLocations.end(); ++it) {
|
||||||
@@ -319,5 +331,4 @@ MainWindow::_InitModel()
|
|||||||
// by querying the package roster
|
// by querying the package roster
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user