[Aptitude-svn-commit] r4153 - in branches/aptitude-0.3/aptitude: . src

Daniel Burrows dburrows at costa.debian.org
Wed Sep 21 20:44:08 UTC 2005


Author: dburrows
Date: Wed Sep 21 20:44:06 2005
New Revision: 4153

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/solution_screen.cc
Log:
Destroy the whole examiner when there aren't any broken packages.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Wed Sep 21 20:44:06 2005
@@ -1,5 +1,11 @@
 2005-09-21  Daniel Burrows  <dburrows at debian.org>
 
+	* src/solution_screen.cc:
+
+	  Destroy the whole examiner when there aren't any broken
+	  packages, and do it from external code (not update() or a
+	  connection to destroyed) to avoid any possibility of weirdness.
+
 	* src/cmdline/cmdline_do_action.cc, src/generic/aptcache.cc, src/generic/aptcache.h, src/ui.cc:
 
 	  Upgrade packages that were to-be-removed when doing a

Modified: branches/aptitude-0.3/aptitude/src/solution_screen.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/solution_screen.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/solution_screen.cc	Wed Sep 21 20:44:06 2005
@@ -1018,10 +1018,7 @@
 
     if(!resman->resolver_exists())
       {
-	// No packages are broken; remove this screen.
-	destroy();
-
-	// Clear out the other display areas, just in case.
+	set_static_root(transcode(_("No broken packages.")));
 	set_short_description(fragf(""));
 	set_active_dep(aptitude_resolver_dep());
 	return;
@@ -1095,6 +1092,15 @@
     t->set_root(make_dep_solvers_tree(d));
 }
 
+static
+void maybe_remove_examiner(vscreen_widget &wBare)
+{
+  vs_widget_ref w(&wBare);
+
+  if(resman && !resman->resolver_exists())
+    w->destroy();
+}
+
 vs_widget_ref make_solution_screen()
 {
   vs_table_ref rval     = vs_table::create();
@@ -1127,6 +1133,14 @@
 			2, 0, 1, 1, vs_table::EXPAND | vs_table::FILL,
 			vs_table::EXPAND | vs_table::FILL | vs_table::SHRINK);
 
+
+  cache_reloaded.connect(sigc::bind(sigc::ptr_fun(&maybe_remove_examiner),
+				    rval.weak_ref()));
+  if(resman)
+    resman->state_changed.connect(sigc::bind(sigc::ptr_fun(&maybe_remove_examiner),
+					     rval.weak_ref()));
+
+
   l->show();
   examiner->show();
   info_tree->show();



More information about the Aptitude-svn-commit mailing list