[Debtags-commits] [svn] r1884 - central-database/trunk/c-tdb
Erich Schubert
erich at costa.debian.org
Wed Aug 30 23:59:48 UTC 2006
Author: erich
Date: Wed Aug 30 23:59:47 2006
New Revision: 1884
Modified:
central-database/trunk/c-tdb/browse.cc
central-database/trunk/c-tdb/tagcloud.cc
Log:
allow to start browsing/clouding with no tags given
Modified: central-database/trunk/c-tdb/browse.cc
==============================================================================
--- central-database/trunk/c-tdb/browse.cc (original)
+++ central-database/trunk/c-tdb/browse.cc Wed Aug 30 23:59:47 2006
@@ -20,6 +20,8 @@
/* find matching packages... */
IdList* result = NULL;
+ if (argc <= 1)
+ result = new IdList(maptp.get(dbid(0)), true);
for (int i=1; i < argc; i++) {
try {
dbid entry = dbvoc.name_to_id.get(argv[i]);
Modified: central-database/trunk/c-tdb/tagcloud.cc
==============================================================================
--- central-database/trunk/c-tdb/tagcloud.cc (original)
+++ central-database/trunk/c-tdb/tagcloud.cc Wed Aug 30 23:59:47 2006
@@ -37,6 +37,8 @@
/* find matching packages... */
IdList* result = NULL;
+ if (argc <= 1)
+ result = new IdList(maptp.get(dbid(0)), true);
for (int i=1; i < argc; i++) {
try {
dbid entry = dbvoc.name_to_id.get(argv[i]);
@@ -49,13 +51,13 @@
//temp.free_data();
}
} catch (etdb<dbstr,dbid>::KeyNotFoundError) {
- cout << "Unknown tag specified: '" << argv[i] << "'" << endl;
+ cerr << "Unknown tag specified: '" << argv[i] << "'" << endl;
exit(1);
}
}
if (!result || (result->size() == 0)) {
/* FIXME: use a list of all packages here */
- cout << "No matching packages found." << endl;
+ cerr << "No matching packages found." << endl;
exit(1);
}
@@ -95,7 +97,8 @@
try {
VocInfo ti = dbvoc.get(e->first);
cout << ti.name() << " " << e->second << " " << ti.desc() << endl;
- //ti.free_data();
+ if (ti.flags() & FLAG_FACET)
+ numresults++;
} catch (etdb<dbid,VocInfo>::KeyNotFoundError er) {
cerr << "Unknown voc id: " << e->first.id << endl;
numresults++;
More information about the Debtags-commits
mailing list