aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-01-09 18:21:37 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-01-09 18:21:37 +0000
commit0b0c861333c94df393b0b12677867fb850c5ff9d (patch)
tree95fa5a2bb4eeb523ca841fbacbed99431e136b86 /src
parent0083f4e56d78bfff25782cb2af63ece6f47efee6 (diff)
downloadpaludis-0b0c861333c94df393b0b12677867fb850c5ff9d.tar.gz
paludis-0b0c861333c94df393b0b12677867fb850c5ff9d.tar.xz
Make QAMessage::with_associated_key take the PackageID as well as the MetadataKey.
Diffstat (limited to 'src')
-rw-r--r--src/clients/qualudis/qualudis.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/clients/qualudis/qualudis.cc b/src/clients/qualudis/qualudis.cc
index 5f6f34b..039717e 100644
--- a/src/clients/qualudis/qualudis.cc
+++ b/src/clients/qualudis/qualudis.cc
@@ -35,6 +35,7 @@
#include <cstdlib>
#include <iostream>
#include <algorithm>
+#include <map>
#include <set>
#include "qualudis_command_line.hh"
@@ -173,7 +174,7 @@ namespace
std::string previous_name;
bool show_keys, show_keys_once;
- std::set<const MetadataKey *> printed_keys;
+ std::map<tr1::shared_ptr<const PackageID>, std::set<std::string>, PackageIDSetComparator> printed_keys;
QualudisReporter(const std::string & show_associated_keys) :
previous_entry("/NONE"),
@@ -241,17 +242,13 @@ namespace
for (QAMessage::KeysSequence::ConstIterator i(msg.associated_keys->begin()),
i_end(msg.associated_keys->end()) ; i != i_end ; ++i)
{
- if (show_keys_once)
- {
- if (printed_keys.end() != printed_keys.find(&**i))
- continue;
- printed_keys.insert(&**i);
- }
+ if (show_keys_once && ! printed_keys[i->first].insert(i->second->raw_name()).second)
+ continue;
try
{
MetadataKeyPrettyPrinter pp;
- (*i)->accept(pp);
+ i->second->accept(pp);
std::cout << " " << pp.stream.str();
}
catch (const Exception &)