This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: [PATCH] setup: initially expand categories starting with "."
- From: Max Bowsher <maxb1 at ukf dot net>
- To: cygwin-apps at cygwin dot com
- Date: Tue, 14 Mar 2006 15:52:26 +0000
- Subject: Re: [PATCH] setup: initially expand categories starting with "."
- Openpgp: id=C0F2C580
- References: <Pine.GSO.4.63.0511171307200.11096@slinky.cs.nyu.edu>
- Reply-to: cygwin-apps at cygwin dot com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Igor Pechtchanski wrote:
> This patch implements one of the setup augmentations useful for the
> "installation profiles idea" (for lack of a better name :-) ).
> Igor
> ==============================================================================
> ChangeLog:
> 2005-11-16 Igor Pechtchanski <pechtcha@cs.nyu.edu>
>
> * PickView.cc (PickView::setViewMode): Auto-expand category if
> its name starts with a dot.
>
> Index: PickView.cc
> ===================================================================
> RCS file: /cvs/cygwin-apps/setup/PickView.cc,v
> retrieving revision 2.26
> diff -u -p -r2.26 PickView.cc
> --- PickView.cc 9 Sep 2005 19:08:01 -0000 2.26
> +++ PickView.cc 16 Nov 2005 19:54:58 -0000
> @@ -160,7 +160,8 @@ PickView::setViewMode (views mode)
> for (packagedb::categoriesType::iterator n =
> packagedb::categories.begin(); n != packagedb::categories.end();
> ++n)
> - insert_category (&*n, CATEGORY_COLLAPSED);
> + insert_category (&*n, *(*n).first.c_str() == '.'
> + ? CATEGORY_EXPANDED : CATEGORY_COLLAPSED);
> }
> else
> {
I'm fine with the concept, BUT: using *string to mean "the first
character of string", whilst valid, doesn't express the intent very
clearly to people reading the code.
So, please use (*n).first.c_str()[0] instead.
With that change, please commit.
Thanks,
Max.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
iD8DBQFEFua6fFNSmcDyxYARAgsPAKDEYL/1wlROl7fdJe6FukBtPvNpwACfZN6T
xIs8GW2Y02h5XHoqyVb1Yq8=
=GjBo
-----END PGP SIGNATURE-----