diff --git a/plasma/applets/system-monitor/CMakeLists.txt b/plasma/applets/system-monitor/CMakeLists.txt index aa0f7ae4..d1499913 100644 --- a/plasma/applets/system-monitor/CMakeLists.txt +++ b/plasma/applets/system-monitor/CMakeLists.txt @@ -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 diff --git a/plasma/applets/system-monitor/temperature.cpp b/plasma/applets/system-monitor/temperature.cpp index 74a679c6..94aaabaa 100644 --- a/plasma/applets/system-monitor/temperature.cpp +++ b/plasma/applets/system-monitor/temperature.cpp @@ -24,8 +24,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -197,30 +196,24 @@ void Temperature::dataUpdated(const QString& source, return; } SM::Plotter *plotter = qobject_cast(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() << value.number()); } - temp = value.toSymbolString(); - if (mode() == SM::Applet::Panel) { setToolTip(source, - QString("%1%2").arg(temperatureTitle(source)).arg(temp)); + QString("%1%2").arg(temperatureTitle(source)).arg(value.toString())); } }