mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 10:52:51 +00:00
plasma: deal with FIXME related to system monitor applet
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
00b61c1246
commit
3a2cb33e60
2 changed files with 7 additions and 14 deletions
|
@ -38,7 +38,7 @@ set(temparature_SRCS
|
|||
temperature-config.ui
|
||||
)
|
||||
kde4_add_plugin(plasma_applet_sm_temperature ${temparature_SRCS})
|
||||
target_link_libraries(plasma_applet_sm_temperature ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KUNITCONVERSION_LIBS} plasma_applet-system-monitor)
|
||||
target_link_libraries(plasma_applet_sm_temperature ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} plasma_applet-system-monitor)
|
||||
|
||||
# Network Monitor
|
||||
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
#include <Plasma/Containment>
|
||||
#include <Plasma/Theme>
|
||||
#include <KConfigDialog>
|
||||
#include <KUnitConversion/Converter>
|
||||
#include <KUnitConversion/Value>
|
||||
#include <kunitconversion.h>
|
||||
#include <QGraphicsLinearLayout>
|
||||
#include <QTimer>
|
||||
#include <cmath>
|
||||
|
@ -197,30 +196,24 @@ void Temperature::dataUpdated(const QString& source,
|
|||
return;
|
||||
}
|
||||
SM::Plotter *plotter = qobject_cast<SM::Plotter*>(visualization(source));
|
||||
QString temp;
|
||||
QString unit = data["units"].toString();
|
||||
double doubleValue = data["value"].toDouble() + temperatureOffset(source);
|
||||
KUnitConversion::Value value = KUnitConversion::Value(doubleValue, unit);
|
||||
KTemperature value(doubleValue, unit);
|
||||
|
||||
#warning FIXME: temporary crash fix, KUnitConversion basically has to be rewriten
|
||||
#if 0
|
||||
if (KGlobal::locale()->measureSystem() == KLocale::Metric) {
|
||||
value = value.convertTo(KUnitConversion::Celsius);
|
||||
doubleValue = value.convertTo(KTemperature::Celsius);
|
||||
} else {
|
||||
value = value.convertTo(KUnitConversion::Fahrenheit);
|
||||
doubleValue = value.convertTo(KTemperature::Fahrenheit);
|
||||
}
|
||||
#endif
|
||||
|
||||
value.round(1);
|
||||
doubleValue = KTemperature::round(doubleValue, 1);
|
||||
if (plotter) {
|
||||
plotter->addSample(QList<double>() << value.number());
|
||||
}
|
||||
|
||||
temp = value.toSymbolString();
|
||||
|
||||
if (mode() == SM::Applet::Panel) {
|
||||
setToolTip(source,
|
||||
QString("<tr><td>%1</td><td>%2</td></tr>").arg(temperatureTitle(source)).arg(temp));
|
||||
QString("<tr><td>%1</td><td>%2</td></tr>").arg(temperatureTitle(source)).arg(value.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue