summaryrefslogtreecommitdiffstats
path: root/src/modules/SystemBackendProc.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-12-26 01:46:48 +0100
committerMatthias Schiffer <matthias@gamezock.de>2008-12-26 01:46:48 +0100
commit2ab1fbd763ad8692ea3ca29705a4fe821ccb1309 (patch)
treee05b4e7925e610e68230e418c99c7b5f520a2d93 /src/modules/SystemBackendProc.cpp
parent5e8b56644fa132287431cb06717cdfe0ea05dfbc (diff)
downloadmad-2ab1fbd763ad8692ea3ca29705a4fe821ccb1309.tar
mad-2ab1fbd763ad8692ea3ca29705a4fe821ccb1309.zip
ActionManager fuer bessere Behandlung von Signalen (und Threads) hinzugefuegt
Diffstat (limited to 'src/modules/SystemBackendProc.cpp')
-rw-r--r--src/modules/SystemBackendProc.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/modules/SystemBackendProc.cpp b/src/modules/SystemBackendProc.cpp
index 1af2f28..3a0d33d 100644
--- a/src/modules/SystemBackendProc.cpp
+++ b/src/modules/SystemBackendProc.cpp
@@ -19,9 +19,13 @@
#include "SystemBackendProc.h"
+#include <Common/ActionManager.h>
+
#include <cstdio>
#include <cstring>
+#include <sigc++/bind.h>
+
#define init SystemBackendProc_LTX_init
#define deinit SystemBackendProc_LTX_deinit
@@ -49,7 +53,7 @@ bool SystemBackendProc::uptimeInfo(const sigc::slot<void, unsigned long, unsigne
if(uptimeFile.good())
idleTime = (unsigned long)f;
- callback(uptime, idleTime);
+ Common::ActionManager::get()->add(sigc::bind(callback, uptime, idleTime));
return true;
}
@@ -86,7 +90,7 @@ bool SystemBackendProc::memoryInfo(const sigc::slot<void, unsigned long, unsigne
break;
}
- callback(totalMem, freeMem, totalSwap, freeSwap);
+ Common::ActionManager::get()->add(sigc::bind(callback, totalMem, freeMem, totalSwap, freeSwap));
return true;
}
@@ -108,7 +112,7 @@ bool SystemBackendProc::loadInfo(const sigc::slot<void, unsigned long, unsigned
std::sscanf(line.c_str(), "%f %f %f %lu/%lu", &loadAvg1, &loadAvg5, &loadAvg15, &currentLoad, &nProcesses);
- callback(currentLoad, nProcesses, loadAvg1, loadAvg5, loadAvg15);
+ Common::ActionManager::get()->add(sigc::bind(callback, currentLoad, nProcesses, loadAvg1, loadAvg5, loadAvg15));
return true;
}