[Debtags-commits] [svn] r1072 - debtags-edit/trunk/src

Enrico Zini enrico at costa.debian.org
Wed Aug 3 22:22:12 UTC 2005


Author: enrico
Date: Wed Aug  3 22:22:12 2005
New Revision: 1072

Modified:
   debtags-edit/trunk/src/FilterPanel.cc
Log:
Made it possible to disable the MAX_PACKAGES feature.  Disabling it makes it very likely to crash in libapt, though :(

Modified: debtags-edit/trunk/src/FilterPanel.cc
==============================================================================
--- debtags-edit/trunk/src/FilterPanel.cc	(original)
+++ debtags-edit/trunk/src/FilterPanel.cc	Wed Aug  3 22:22:12 2005
@@ -38,6 +38,8 @@
 using namespace std;
 using namespace Debtags;
 
+#define MAX_VISIBLE_PKG 200
+
 //template class FilterPanel<DebtagsDocument>;
 
 template<class DOC>
@@ -529,7 +531,9 @@
 template<class DOC>
 void FilterPanel<DOC>::updateList() throw ()
 {
-	static const unsigned int max_pkg = 500;
+#ifdef MAX_VISIBLE_PKG
+	static const unsigned int max_pkg = MAX_VISIBLE_PKG;
+#endif
 	printf("UPDATELIST start\n");
 	doc.subCollection.clear();
 
@@ -560,6 +564,7 @@
 	//PackageBuffer::iterator lastIter = pkgs.size() > max_pkg ? pkgs.begin() + max_pkg : pkgs.end();
 	
 	string state;
+#ifdef MAX_VISIBLE_PKG
 	if (doc.subCollection.itemCount() > max_pkg)
 	{
 		state = stringf::fmt(">%d (%d) packages found", max_pkg, doc.subCollection.itemCount());
@@ -567,6 +572,9 @@
 	} else {
 		state = stringf::fmt("%d packages found", doc.subCollection.itemCount());
 	}
+#else
+	state = stringf::fmt("%d packages found", doc.subCollection.itemCount());
+#endif
 	foundStats.set_text(state);
 
 	//pkgs.sort();
@@ -587,9 +595,11 @@
 template<class DOC>
 void FilterPanel<DOC>::consume(const std::string& item) throw ()
 {
-	static const unsigned int max_pkg = 200;
+#ifdef MAX_VISIBLE_PKG
+	static const unsigned int max_pkg = 500;
 	if (itemListModel->children().size() > max_pkg)
 		return;
+#endif
 	Package pkg = doc.packageDB().getPackage(item);
 	if (pkg)
 	{



More information about the Debtags-commits mailing list