Hide patterns flagged user invisible (bnc #538152)
authorJán Kupec <jkupec@suse.cz>
Tue, 8 Dec 2009 13:48:21 +0000 (14:48 +0100)
committerJán Kupec <jkupec@suse.cz>
Tue, 8 Dec 2009 13:48:21 +0000 (14:48 +0100)
src/search.cc
src/utils/misc.cc

index ec819be..ba1f657 100644 (file)
@@ -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" : "");
index cd35fb8..42d2e0e 100644 (file)
@@ -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