本文整理汇总了C++中PackageInfoRef::AddListener方法的典型用法代码示例。如果您正苦于以下问题:C++ PackageInfoRef::AddListener方法的具体用法?C++ PackageInfoRef::AddListener怎么用?C++ PackageInfoRef::AddListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PackageInfoRef
的用法示例。
在下文中一共展示了PackageInfoRef::AddListener方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: manager
//.........这里部分代码省略.........
const BPackageInfo& repoPackageInfo = package->Info();
PackageInfoRef modelInfo;
PackageInfoMap::iterator it = foundPackages.find(
repoPackageInfo.Name());
if (it != foundPackages.end())
modelInfo.SetTo(it->second);
else {
// Add new package info
BString publisherURL;
if (repoPackageInfo.URLList().CountStrings() > 0)
publisherURL = repoPackageInfo.URLList().StringAt(0);
BString publisherName = repoPackageInfo.Vendor();
const BStringList& rightsList = repoPackageInfo.CopyrightList();
if (rightsList.CountStrings() > 0)
publisherName = rightsList.StringAt(0);
modelInfo.SetTo(new(std::nothrow) PackageInfo(
repoPackageInfo.Name(),
repoPackageInfo.Version().ToString(),
PublisherInfo(BitmapRef(), publisherName,
"", publisherURL), repoPackageInfo.Summary(),
repoPackageInfo.Description(),
repoPackageInfo.Flags()),
true);
if (modelInfo.Get() == NULL)
return;
foundPackages[repoPackageInfo.Name()] = modelInfo;
}
modelInfo->SetIcon(defaultIcon);
modelInfo->AddListener(this);
BSolverRepository* repository = package->Repository();
if (dynamic_cast<BPackageManager::RemoteRepository*>(repository)
!= NULL) {
depots[repository->Name()].AddPackage(modelInfo);
remotePackages[modelInfo->Title()] = modelInfo;
} else {
if (repository == static_cast<const BSolverRepository*>(
manager.SystemRepository())) {
modelInfo->AddInstallationLocation(
B_PACKAGE_INSTALLATION_LOCATION_SYSTEM);
if (!modelInfo->IsSystemPackage()) {
systemInstalledPackages[repoPackageInfo.FileName()]
= modelInfo;
}
} else if (repository == static_cast<const BSolverRepository*>(
manager.HomeRepository())) {
modelInfo->AddInstallationLocation(
B_PACKAGE_INSTALLATION_LOCATION_HOME);
}
}
if (modelInfo->IsSystemPackage())
systemFlaggedPackages.Add(repoPackageInfo.FileName());
}
BAutolock lock(fModel.Lock());
fModel.Clear();
// filter remote packages from the found list
// any packages remaining will be locally installed packages