[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/plasma/applets/system-monitor
From: Petri Damstén <petri.damsten () kdemail ! net>
Date: 2009-03-08 13:57:40
Message-ID: 1236520660.816467.2465.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 936801 by pdamsten:
system -> total.
BUG:186500
M +11 -3 cpu.cpp
M +3 -0 cpu.h
--- trunk/KDE/kdebase/workspace/plasma/applets/system-monitor/cpu.cpp #936800:936801
@@ -79,13 +79,21 @@
}
}
+QString SM::Cpu::cpuTitle(const QString &name)
+{
+ if (name == "system") {
+ return i18n("total");
+ }
+ return name;
+}
+
bool SM::Cpu::addMeter(const QString& source)
{
QStringList l = source.split('/');
if (l.count() < 3) {
return false;
}
- QString cpu = l[2];
+ QString cpu = l[1];
Plasma::Theme* theme = Plasma::Theme::defaultTheme();
Plasma::SignalPlotter *plotter = new Plasma::SignalPlotter(this);
plotter->addPlot(m_graphColor);
@@ -109,7 +117,7 @@
plotter->setSvgBackground(QString());
plotter->setBackgroundColor(Qt::transparent);
}
- plotter->setTitle(cpu);
+ plotter->setTitle(cpuTitle(cpu));
plotter->setUnit("%");
appendPlotter(source, plotter);
mainLayout()->addItem(plotter);
@@ -158,7 +166,7 @@
foreach (const QString& cpu, m_cpus) {
if (rx.indexIn(cpu) != -1) {
- QStandardItem *item1 = new QStandardItem(rx.cap(1));
+ QStandardItem *item1 = new QStandardItem(cpuTitle(rx.cap(1)));
item1->setEditable(false);
item1->setCheckable(true);
item1->setData(cpu);
--- trunk/KDE/kdebase/workspace/plasma/applets/system-monitor/cpu.h #936800:936801
@@ -47,6 +47,9 @@
void initLater(const QString &name);
void configAccepted();
+ protected:
+ QString cpuTitle(const QString &name);
+
private:
Ui::config ui;
Ui::configAdv uiAdv;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic