[Debtags-commits] [svn] r2046 - in debtags-edit/1.2: . src
Enrico Zini
enrico at alioth.debian.org
Wed Nov 1 14:34:13 CET 2006
Author: enrico
Date: Wed Nov 1 14:34:13 2006
New Revision: 2046
Modified:
debtags-edit/1.2/ (props changed)
debtags-edit/1.2/src/DebtagsDocument.cc
Log:
r3598 at viaza: enrico | 2006-11-01 14:33:24 +0100
Don't show packages that don't have a valid version
Modified: debtags-edit/1.2/src/DebtagsDocument.cc
==============================================================================
--- debtags-edit/1.2/src/DebtagsDocument.cc (original)
+++ debtags-edit/1.2/src/DebtagsDocument.cc Wed Nov 1 14:34:13 2006
@@ -87,15 +87,18 @@
template<typename Package>
TagAdder& operator=(const Package& pkg)
{
- AUTO(tags, pkg.tags());
- if (tags.empty())
+ if (pkg.hasVersion())
{
- int idx = tolower(pkg.name()[0]) - 'a';
- if (doc.nyt.valid()) tags.insert(doc.nyt);
- if (idx >= 0 && idx < 26 && doc.nytx[idx].valid())
- tags.insert(doc.nytx[idx]);
+ AUTO(tags, pkg.tags());
+ if (tags.empty())
+ {
+ int idx = tolower(pkg.name()[0]) - 'a';
+ if (doc.nyt.valid()) tags.insert(doc.nyt);
+ if (idx >= 0 && idx < 26 && doc.nytx[idx].valid())
+ tags.insert(doc.nytx[idx]);
+ }
+ doc.subCollection.insert(wibble::singleton(pkg), tags);
}
- doc.subCollection.insert(wibble::singleton(pkg), tags);
return *this;
}
};
@@ -103,6 +106,7 @@
void DebtagsDocument::resetFilter()
{
_filter = ept::predicate::True<Package>();
+ subCollection.clear();
std::copy(_agg.index().begin(), _agg.index().end(), TagAdder(*this));
}
@@ -110,6 +114,7 @@
{
_filter = p;
+ subCollection.clear();
if (_filter == ept::predicate::True<Package>())
std::copy(_agg.index().begin(), _agg.index().end(), TagAdder(*this));
else
More information about the Debtags-commits
mailing list