[Aptitude-devel] r3042 - in branches/aptitude-0.3/aptitude: . src

Daniel Burrows dburrows@costa.debian.org
Fri, 22 Apr 2005 23:13:07 +0000


Author: dburrows
Date: Fri Apr 22 23:13:04 2005
New Revision: 3042

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/broken_indicator.cc
Log:
Use the new signal to update the broken indicator.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Fri Apr 22 23:13:04 2005
@@ -1,5 +1,9 @@
 2005-04-22  Daniel Burrows  <dburrows@debian.org>
 
+	* src/broken_indicator.cc:
+
+	  Use the new signal to update the broken indicator.
+
 	* src/generic/aptcache.cc, src/generic/aptcache.h, src/main.cc:
 
 	  Make "package_state_changed" an argumentless signal, and call it

Modified: branches/aptitude-0.3/aptitude/src/broken_indicator.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/broken_indicator.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/broken_indicator.cc	Fri Apr 22 23:13:04 2005
@@ -49,6 +49,12 @@
 public:
   broken_indicator()
   {
+    if(apt_cache_file)
+      (*apt_cache_file)->package_state_changed.connect(sigc::mem_fun(*this, &broken_indicator::update));
+
+    cache_closed.connect(sigc::mem_fun(*this, &broken_indicator::update));
+    cache_reloaded.connect(sigc::mem_fun(*this, &broken_indicator::update));
+
     update();
   }
 
@@ -178,19 +184,9 @@
 			   "Error"));
       }
   }
-
-  /** \todo horribly inefficient. */
-  int width_request()
-  {
-    update();
-
-    return vs_text_layout::width_request();
-  }
 };
 
 vscreen_widget *make_broken_indicator()
 {
-  // FIXME: this should really work by attaching to the
-  // package_state_changed signal, but that signal doesn't work...
   return new broken_indicator;
 }