This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[setup PATCH] Fix DEBUG mode in IniDBBuilderPackage, and improve Category column contents.


Here is a patch for setup.

IniDBBuilderPackage.cc: Fix DEBUG mode
Hunk 1: Remove a DEBUG message box which otherwise pops up once per package
during ini parsing, thus rendering DEBUG unusable.
Hunk 2 & 3: Update DEBUG code to match current layout of data structures.

PickPackageLine.cc: Show all Categories in package list, not just the first
alphabetically.
NB1: I'm sure there is a more concise way to say "struct
_Rb_tree_iterator<String,const String &,const String *>", but I'm an STL novice.
NB2: This rebuilds the string of all package names every time this line is
painted. I see no performance impact on my machine when scrolling, but my
machine is fast. Plus, when we get a resizable setup, then we could have many
more lines on display. Am I worrying about nothing, or should I refactor the
patch to calculate the string only once?
NB3: Should we change the column header from Category to Catergories now?

Max.

BEGIN_PATCH
Index: IniDBBuilderPackage.cc
===================================================================
RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/IniDBBuilderPackage.cc,v
retrieving revision 2.12
diff -u -p -r2.12 IniDBBuilderPackage.cc
--- IniDBBuilderPackage.cc 2002/07/15 11:27:03 2.12
+++ IniDBBuilderPackage.cc 2002/09/19 09:56:28
@@ -102,9 +102,6 @@ void
 IniDBBuilderPackage::buildPackageLDesc (String const &theDesc)
 {
   cbpv.set_ldesc(theDesc);
-#if DEBUG
-  _feedback.warning(theDesc.cstr_oneuse());
-#endif
 }

 void
@@ -232,7 +229,7 @@ IniDBBuilderPackage::buildInstalledSize
 {
   cbpv.source()->setInstalledSize (atoi(size.cstr_oneuse()));
 #if DEBUG
-  log (LOG_BABBLE) << "Installed size for " << cp->name << " is " <<
cpv->bin.installedSize() << endLog;
+  log (LOG_BABBLE) << "Installed size for " << cp->name << " is " <<
cbpv.source()->installedSize() << endLog;
 #endif
 }

@@ -382,7 +379,7 @@ IniDBBuilderPackage::buildSourceName (St
     {
       cbpv.setSourcePackageSpecification (PackageSpecification (name));
 #if DEBUG
-      log (LOG_BABBLE) << "\"" << cpv->sourcePackageSpecification() <<
+      log (LOG_BABBLE) << "\"" << cbpv.sourcePackageSpecification() <<
  "\" is the source package for " << cp->name << "." << endLog;
 #endif
     }
Index: PickPackageLine.cc
===================================================================
RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/PickPackageLine.cc,v
retrieving revision 2.9
diff -u -p -r2.9 PickPackageLine.cc
--- PickPackageLine.cc 2002/07/13 14:00:37 2.9
+++ PickPackageLine.cc 2002/09/19 09:06:34
@@ -137,10 +137,19 @@ PickPackageLine::paint (HDC hdc, int x,
   if (pkg.categories.size () && show_cat)
     {
       String catName;
-      if (pkg.categories.find ("All") == pkg.categories.begin () &&
-   pkg.categories.size () > 1)
- catName = *(++pkg.categories.begin());
-      else catName = * pkg.categories.begin ();
+      bool first = true;
+      struct _Rb_tree_iterator<String,const String &,const String *> it =
pkg.categories.begin();
+      struct _Rb_tree_iterator<String,const String &,const String *> end =
pkg.categories.end();
+      struct _Rb_tree_iterator<String,const String &,const String *> all =
pkg.categories.find("All");
+      for(; it != end; it++) {
+   if (all == it)
+     continue;
+   if (first)
+       first = false;
+   else
+       catName += ", ";
+   catName += *(it);
+      }
       IntersectClipRect (hdc, x + theView.headers[theView.cat_col].x, r,
     x + theView.headers[theView.cat_col].x +
     theView.headers[theView.cat_col].x, rb);
END_PATCH


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]