[gnome-system-monitor] make_loadavg_string() is private to proctable



commit e4825ec634286da31d247a6b7fcad82182694cfb
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Tue Aug 13 17:20:42 2013 +0200

    make_loadavg_string() is private to proctable

 src/interface.cpp |    4 ----
 src/proctable.cpp |   29 ++++++++++++++---------------
 src/proctable.h   |    2 --
 3 files changed, 14 insertions(+), 21 deletions(-)
---
diff --git a/src/interface.cpp b/src/interface.cpp
index 09f0474..5172b35 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -70,13 +70,9 @@ create_proc_view(GsmApplication *app, GtkBuilder * builder)
 {
     GtkWidget *proctree;
     GtkWidget *scrolled;
-    char* string;
 
     /* create the processes tab */
-    string = make_loadavg_string ();
     app->loadavg = GTK_WIDGET (gtk_builder_get_object (builder, "load_avg_label"));
-    gtk_label_set_text (GTK_LABEL (app->loadavg), string);
-    g_free (string);
 
     proctree = proctable_new (app);
     scrolled = GTK_WIDGET (gtk_builder_get_object (builder, "processes_scrolled"));
diff --git a/src/proctable.cpp b/src/proctable.cpp
index ee63edb..aac39c4 100644
--- a/src/proctable.cpp
+++ b/src/proctable.cpp
@@ -1148,6 +1148,20 @@ proctable_update_list (GsmApplication *app)
     /* proclist.number == g_list_length(procdata->info) == g_hash_table_size(procdata->pids) */
 }
 
+static char *
+make_loadavg_string (void)
+{
+    glibtop_loadavg buf;
+
+    glibtop_get_loadavg (&buf);
+
+    return g_strdup_printf (_("Load averages for the last 1, 5, 15 minutes: "
+                              "%0.2f, %0.2f, %0.2f"),
+                            buf.loadavg[0],
+                            buf.loadavg[1],
+                            buf.loadavg[2]);
+}
+
 void
 proctable_update (GsmApplication * const app)
 {
@@ -1169,21 +1183,6 @@ proctable_free_table (GsmApplication * const app)
     ProcInfo::all.clear();
 }
 
-char*
-make_loadavg_string(void)
-{
-    glibtop_loadavg buf;
-
-    glibtop_get_loadavg(&buf);
-
-    return g_strdup_printf(
-        _("Load averages for the last 1, 5, 15 minutes: "
-          "%0.2f, %0.2f, %0.2f"),
-        buf.loadavg[0],
-        buf.loadavg[1],
-        buf.loadavg[2]);
-}
-
 void
 ProcInfo::set_icon(Glib::RefPtr<Gdk::Pixbuf> icon)
 {
diff --git a/src/proctable.h b/src/proctable.h
index 8d80b1a..40984da 100644
--- a/src/proctable.h
+++ b/src/proctable.h
@@ -64,8 +64,6 @@ void            proctable_freeze (GsmApplication *app);
 void            proctable_thaw (GsmApplication *app);
 void            proctable_reset_timeout (GsmApplication *app);
 
-char*           make_loadavg_string(void);
-
 void            get_process_memory_writable (ProcInfo *info);
 void            get_last_selected (GtkTreeModel *model, GtkTreePath *path,
                                    GtkTreeIter *iter, gpointer data);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]