]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
Always give the fake root category the name 'All'
authorJon Turney <jon.turney@dronecode.org.uk>
Tue, 6 Mar 2018 16:17:30 +0000 (16:17 +0000)
committerJon Turney <jon.turney@dronecode.org.uk>
Tue, 6 Mar 2018 20:42:45 +0000 (20:42 +0000)
After we rearranged things in 0c539f7f, it's now too early to tell if we
have any packages or not.

The only thing about this category that is ever used is it's name, so we
don't actually need to use the real 'All' category here.

Saying 'No packages found' was never particularly helpful here, so just use
a fake category with the fixed name 'All'.

choose.cc

index 9cf3a508ed79e3f1ec33dbef452d071956364f35..5a4d3adffa4a05b617cd66dcf555c9f92d58269f 100644 (file)
--- a/choose.cc
+++ b/choose.cc
@@ -137,11 +137,8 @@ ChooserPage::createListview ()
 {
   SetBusy ();
   static std::vector<packagemeta *> empty_cat;
-  static Category dummy_cat (std::string ("No packages found."), empty_cat);
-  packagedb db;
-  packagedb::categoriesType::iterator it = db.categories.find("All");
-  Category &cat = (it == db.categories.end ()) ? dummy_cat : *it;
-  chooser = new PickView (cat);
+  static Category dummy_cat (std::string ("All"), empty_cat);
+  chooser = new PickView (dummy_cat);
   RECT r = getDefaultListViewSize();
   if (!chooser->Create(this, WS_CHILD | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE,&r))
     throw new Exception (TOSTRING(__LINE__) " " __FILE__,
This page took 0.042771 seconds and 5 git commands to generate.