On Sat, Jun 20, 2009 at 05:31:52PM +0200, Miroslav Kure wrote:
>
> I would suggest to introduce new entity_state_info called
> no_action_columns and use some other description than empty string
> (ehm, space is enough). Proof of code attached.
Further playing with this revealed I was not thorough in replacing
calls to entity_state_info() with no_action_columns, so unlike the
list of packages the package details view was still wrong - attaching
updated diff.
--
Miroslav Kure
diff -r 86de8639a734 src/gtk/gui.cc
--- a/src/gtk/gui.cc Thu Jun 18 20:03:40 2009 -0700
+++ b/src/gtk/gui.cc Sat Jun 20 18:54:06 2009 +0200
@@ -95,6 +95,7 @@
const entity_state_info hold_columns("h", N_("Hold (don't upgrade)"), Gtk::Stock::MEDIA_PAUSE);
const entity_state_info forbid_columns("F", N_("Forbidden version"), Gtk::Stock::STOP);
const entity_state_info broken_columns("B", N_("Unsatisfied dependencies"), Gtk::Stock::DIALOG_ERROR);
+ const entity_state_info no_action_columns("", N_(" "), Gtk::StockID());
const char *lightred_background_color = "#FFCCCC";
diff -r 86de8639a734 src/gtk/gui.h
--- a/src/gtk/gui.h Thu Jun 18 20:03:40 2009 -0700
+++ b/src/gtk/gui.h Sat Jun 20 18:54:06 2009 +0200
@@ -360,6 +360,7 @@
extern const entity_state_info hold_columns;
extern const entity_state_info forbid_columns;
extern const entity_state_info broken_columns;
+ extern const entity_state_info no_action_columns;
extern const char *lightred_background_color;
extern const char *lightgreen_background_color;
diff -r 86de8639a734 src/gtk/info.cc
--- a/src/gtk/info.cc Thu Jun 18 20:03:40 2009 -0700
+++ b/src/gtk/info.cc Sat Jun 20 18:54:06 2009 +0200
@@ -91,7 +91,7 @@
std::pair<const entity_state_info, std::string> action_row_info()
{
if(ver.end())
- return std::make_pair(entity_state_info(), "white");
+ return std::make_pair(no_action_columns, "white");
pkgCache::PkgIterator pkg = ver.ParentPkg();
aptitudeDepCache::StateCache &state = (*apt_cache_file)[pkg];
@@ -113,14 +113,14 @@
if(candver==ver)
return std::make_pair(install_columns, "green");
else
- return std::make_pair(entity_state_info(), "white");
+ return std::make_pair(no_action_columns, "white");
}
else if(state.iFlags & pkgDepCache::ReInstall)
{
if(ver.ParentPkg().CurrentVer() == ver)
return std::make_pair(install_columns, "yellow green");
else
- return std::make_pair(entity_state_info(),"white");
+ return std::make_pair(no_action_columns,"white");
}
else if(state.Upgrade())
{
@@ -129,10 +129,10 @@
else if(candver == ver)
return std::make_pair(install_columns, "green yellow");
else
- return std::make_pair(entity_state_info(), "white");
+ return std::make_pair(no_action_columns, "white");
}
else
- return std::make_pair(entity_state_info(), "white");
+ return std::make_pair(no_action_columns, "white");
}
public:
diff -r 86de8639a734 src/gtk/pkgview.cc
--- a/src/gtk/pkgview.cc Thu Jun 18 20:03:40 2009 -0700
+++ b/src/gtk/pkgview.cc Sat Jun 20 18:54:06 2009 +0200
@@ -115,7 +115,7 @@
return upgrade_columns;
}
else
- return entity_state_info();
+ return no_action_columns;
}
string PkgEntity::selected_package_state_color()
_______________________________________________
Aptitude-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/aptitude-devel