本文整理汇总了C++中AptIntf::searchPackageDetails方法的典型用法代码示例。如果您正苦于以下问题:C++ AptIntf::searchPackageDetails方法的具体用法?C++ AptIntf::searchPackageDetails怎么用?C++ AptIntf::searchPackageDetails使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AptIntf
的用法示例。
在下文中一共展示了AptIntf::searchPackageDetails方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: backend_search_package_thread
static void backend_search_package_thread(PkBackendJob *job, GVariant *params, gpointer user_data)
{
gchar **values;
gchar *search;
PkBitfield filters;
PkRoleEnum role;
g_variant_get(params, "(t^a&s)",
&filters,
&values);
search = g_strjoinv("|", values);
AptIntf *apt = static_cast<AptIntf*>(pk_backend_job_get_user_data(job));
if (!apt->init()) {
g_debug("Failed to create apt cache");
g_free(search);
apt->emitFinished();
return;
}
if (_error->PendingError() == true) {
g_free(search);
apt->emitFinished();
return;
}
pk_backend_job_set_status(job, PK_STATUS_ENUM_QUERY);
pk_backend_job_set_percentage(job, PK_BACKEND_PERCENTAGE_INVALID);
pk_backend_job_set_allow_cancel(job, true);
PkgList output;
role = pk_backend_job_get_role(job);
if (role == PK_ROLE_ENUM_SEARCH_DETAILS) {
output = apt->searchPackageDetails(search);
} else {
output = apt->searchPackageName(search);
}
g_free(search);
// It's faster to emmit the packages here than in the matching part
apt->emitPackages(output, filters);
pk_backend_job_set_percentage(job, 100);
apt->emitFinished();
}