ref: refs/heads/master
commit b68ec4de3111824dd5d90ab4c6a1c9294a9baab4
Author: Ján Kupec
Date: Tue Dec 8 14:48:21 2009 +0100
Hide patterns flagged user invisible (bnc #538152)
---
src/search.cc | 19 +++++++++++++++++++
src/utils/misc.cc | 3 ++-
2 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/src/search.cc b/src/search.cc
index ec819be..ba1f657 100644
--- a/src/search.cc
+++ b/src/search.cc
@@ -75,6 +75,14 @@ bool FillSearchTableSolvable::operator()(const zypp::ui::Selectable::constPtr &
TableRow row;
zypp::PoolItem pi = *it;
+ // hide patterns with user visible flag not set (bnc #538152)
+ if (pi->kind() == zypp::ResKind::pattern)
+ {
+ Pattern::constPtr ptrn = asKind<Pattern>(pi.resolvable());
+ if (ptrn && !ptrn->userVisible())
+ continue;
+ }
+
// installed status
// patters
@@ -225,6 +233,14 @@ FillSearchTableSelectable::FillSearchTableSelectable(
bool FillSearchTableSelectable::operator()(const zypp::ui::Selectable::constPtr & s) const
{
+ // hide patterns with user visible flag not set (bnc #538152)
+ if (s->kind() == zypp::ResKind::pattern)
+ {
+ Pattern::constPtr ptrn = s->candidateAsKind<Pattern>();
+ if (ptrn && !ptrn->userVisible())
+ return true;
+ }
+
TableRow row;
bool installed;
@@ -406,6 +422,9 @@ static void list_pattern_table(Zypper & zypper)
continue;
Pattern::constPtr pattern = asKind<Pattern>(it->resolvable());
+ // hide patterns with user visible flag not set (bnc #538152)
+ if (!pattern->userVisible())
+ continue;
TableRow tr;
tr << (it->isSatisfied() ? "i" : "");
diff --git a/src/utils/misc.cc b/src/utils/misc.cc
index cd35fb8..42d2e0e 100644
--- a/src/utils/misc.cc
+++ b/src/utils/misc.cc
@@ -401,7 +401,8 @@ string asXML(const Pattern & p, bool is_installed)
" vendor=\"" << xml_encode(p.vendor()) << "\""
" summary=\"" << xml_encode(p.summary()) << "\""
" repo=\"" << xml_encode(p.repoInfo().alias()) << "\""
- " installed=\"" << (is_installed ? 1 : 0) << "\"";
+ " installed=\"" << (is_installed ? 1 : 0) << "\""
+ " uservisible=\"" << (p.userVisible() ? 1 : 0) << "\"";
if (p.description().empty())
str << "/>";
else
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org