[nemiver/profiler: 28/48] Display a better precision for the overhead column
- From: Fabien Parent <fparent src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nemiver/profiler: 28/48] Display a better precision for the overhead column
- Date: Wed, 15 Aug 2012 10:01:01 +0000 (UTC)
commit 67de3da638d6868ae5c45b44446305ab193c44ed
Author: Fabien Parent <parent f gmail com>
Date: Sun Jun 24 17:48:13 2012 +0200
Display a better precision for the overhead column
src/persp/profperspective/nmv-call-list.cc | 26 ++++++++++++++++++++++++--
1 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/src/persp/profperspective/nmv-call-list.cc b/src/persp/profperspective/nmv-call-list.cc
index 238ffe6..e92bdf7 100644
--- a/src/persp/profperspective/nmv-call-list.cc
+++ b/src/persp/profperspective/nmv-call-list.cc
@@ -72,22 +72,44 @@ struct CallList::Priv {
Gtk::manage (new Gtk::CellRendererProgress);
THROW_IF_FAIL (renderer);
- treeview.append_column (_("Symbol"), columns.symbol);
+ int usage_col_id = treeview.append_column (_("Overhead"), *renderer);
treeview.append_column (_("Command"), columns.command);
treeview.append_column (_("Shared Object"), columns.dso);
- int usage_col_id = treeview.append_column (_("Overhead"), *renderer);
+ treeview.append_column (_("Symbol"), columns.symbol);
treeview.set_model (store);
treeview.signal_row_activated ().connect
(sigc::mem_fun (*this, &CallList::Priv::on_signal_row_activated));
Gtk::TreeViewColumn *column = treeview.get_column (usage_col_id - 1);
if (column) {
+ column->set_cell_data_func (*renderer, sigc::mem_fun
+ (*this, &CallList::Priv::overhead_cell_data_func));
column->add_attribute
(renderer->property_value(), columns.overhead);
}
}
void
+ overhead_cell_data_func (Gtk::CellRenderer *a_renderer,
+ const Gtk::TreeModel::iterator &a_iter)
+ {
+ NEMIVER_TRY;
+
+ Gtk::CellRendererProgress *renderer =
+ dynamic_cast<Gtk::CellRendererProgress*> (a_renderer);
+ THROW_IF_FAIL (renderer);
+
+ THROW_IF_FAIL (a_iter);
+ CallGraphNodeSafePtr node = a_iter->get_value (columns.call_node);
+ THROW_IF_FAIL (node);
+
+ renderer->property_text () =
+ UString::compose ("%1%%", node->overhead ());
+
+ NEMIVER_CATCH;
+ }
+
+ void
on_signal_row_activated (const Gtk::TreeModel::Path &a_path,
Gtk::TreeViewColumn*)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]