[packages/kp5-libksysguard] - updated to 5.5.4 - added isnan.patch

witekfl witekfl at pld-linux.org
Sun Feb 28 15:46:56 CET 2016


commit 0821518e218795b8ef3260891aa1f2793c1a2a19
Author: Witold Filipczyk <witekfl at poczta.onet.pl>
Date:   Sun Feb 28 15:46:27 2016 +0100

    - updated to 5.5.4
    - added isnan.patch

 isnan.patch           | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++
 kp5-libksysguard.spec |   8 ++-
 2 files changed, 157 insertions(+), 3 deletions(-)
---
diff --git a/kp5-libksysguard.spec b/kp5-libksysguard.spec
index 9ea9031..1b990ea 100644
--- a/kp5-libksysguard.spec
+++ b/kp5-libksysguard.spec
@@ -1,15 +1,16 @@
-%define		kdeplasmaver	5.4.0
+%define		kdeplasmaver	5.5.4
 %define		qtver		5.3.2
 %define		kpname		libksysguard
 
 Summary:	Library for monitoring your system
 Name:		kp5-%{kpname}
-Version:	5.4.0
+Version:	5.5.4
 Release:	1
 License:	LGPL v2.1+
 Group:		X11/Libraries
 Source0:	http://download.kde.org/stable/plasma/%{kdeplasmaver}/%{kpname}-%{version}.tar.xz
-# Source0-md5:	2d5cba7cf9cb9c903d0aca434be00539
+# Source0-md5:	af74ab9d18f156c16c542892c9148731
+Patch0:		isnan.patch
 URL:		http://www.kde.org/
 BuildRequires:	Qt5Core-devel >= %{qtver}
 BuildRequires:	cmake >= 2.8.12
@@ -48,6 +49,7 @@ Pliki nagłówkowe dla programistów używających %{kpname}.
 
 %prep
 %setup -q -n %{kpname}-%{version}
+%patch0 -p1
 
 %build
 install -d build
diff --git a/isnan.patch b/isnan.patch
new file mode 100644
index 0000000..316fab0
--- /dev/null
+++ b/isnan.patch
@@ -0,0 +1,152 @@
+--- libksysguard-5.5.4/signalplotter/ksignalplotter.cpp.orig	2016-01-26 20:36:46.000000000 +0100
++++ libksysguard-5.5.4/signalplotter/ksignalplotter.cpp	2016-02-28 15:37:23.140582766 +0100
+@@ -32,7 +32,7 @@
+ #include "ksignalplotter_p.h"
+ #include "processcore/processcore_debug.h"
+ 
+-#include <math.h>  //For floor, ceil, log10 etc for calculating ranges
++#include <cmath>  //For floor, ceil, log10 etc for calculating ranges
+ 
+ #include <QPainter>
+ #include <QPixmap>
+@@ -49,7 +49,7 @@
+ 
+ #include <klocalizedstring.h>
+ #include <kiconloader.h>
+-#include <math.h>
++#include <cmath>
+ #include <limits>
+ 
+ #ifdef SVG_SUPPORT
+@@ -485,20 +485,20 @@ void KSignalPlotterPrivate::recalculateM
+         qreal value=0;
+         for(int i = sampleBuf.count()-1; i>= 0; i--) {
+             qreal newValue = sampleBuf[i];
+-            if( !isinf(newValue) && !isnan(newValue) )
++            if( !std::isinf(newValue) && !std::isnan(newValue) )
+                 value += newValue;
+         }
+-        if(isnan(mMinValue) || mMinValue > value) mMinValue = value;
+-        if(isnan(mMaxValue) || mMaxValue < value) mMaxValue = value;
++        if(std::isnan(mMinValue) || mMinValue > value) mMinValue = value;
++        if(std::isnan(mMaxValue) || mMaxValue < value) mMaxValue = value;
+         if(value > 0.7*mMaxValue)
+             mRescaleTime = time;
+     } else {
+         qreal value;
+         for(int i = sampleBuf.count()-1; i>= 0; i--) {
+             value = sampleBuf[i];
+-            if( !isinf(value) && !isnan(value) ) {
+-                if(isnan(mMinValue) || mMinValue > value) mMinValue = value;
+-                if(isnan(mMaxValue) || mMaxValue < value) mMaxValue = value;
++            if( !std::isinf(value) && !std::isnan(value) ) {
++                if(std::isnan(mMinValue) || mMinValue > value) mMinValue = value;
++                if(std::isnan(mMaxValue) || mMaxValue < value) mMaxValue = value;
+                 if(value > 0.7*mMaxValue)
+                     mRescaleTime = time;
+             }
+@@ -789,9 +789,9 @@ void KSignalPlotterPrivate::calculateNic
+     qreal max = mUserMaxValue;
+     qreal min = mUserMinValue;
+     if( mUseAutoRange ) {
+-        if(!isnan(mMaxValue) && mMaxValue * 0.99 > max)  //Allow max value to go very slightly over the given max, for rounding reasons
++        if(!std::isnan(mMaxValue) && mMaxValue * 0.99 > max)  //Allow max value to go very slightly over the given max, for rounding reasons
+             max = mMaxValue;
+-        if(!isnan(mMinValue) && mMinValue * 0.99 < min) {
++        if(!std::isnan(mMinValue) && mMinValue * 0.99 < min) {
+             min = mMinValue;
+         }
+     }
+@@ -920,23 +920,23 @@ void KSignalPlotterPrivate::drawBeam(QPa
+     bool firstLine = true;
+     for (int j = 0; j < count; ++j) {
+         qreal point0 = datapoints[j];
+-        if( isnan(point0) )
++        if( std::isnan(point0) )
+             continue; //Just do not draw points with nans. skip them
+ 
+         qreal point1 = prev_datapoints[j];
+         qreal point2 = prev_prev_datapoints[j];
+ 
+-        if(isnan(point1))
++        if(std::isnan(point1))
+             point1 = point0;
+-        else if(mSmoothGraph && !isinf(point1)) {
++        else if(mSmoothGraph && !std::isinf(point1)) {
+             // Apply a weighted average just to smooth the graph out a bit
+             // Do not try to smooth infinities or nans
+             point0 = (2*point0 + point1)/3;
+-            if(!isnan(point2) && !isinf(point2))
++            if(!std::isnan(point2) && !std::isinf(point2))
+                 point1 = (2*point1 + point2)/3;
+             // We don't bother to average out y2.  This will introduce slight inaccuracies in the gradients, but they aren't really noticeable.
+         }
+-        if(isnan(point2))
++        if(std::isnan(point2))
+             point2 = point1;
+ 
+         if (mStackBeams) {
+@@ -1046,12 +1046,12 @@ qreal KSignalPlotter::lastValue( int i)
+ }
+ QString KSignalPlotter::lastValueAsString( int i, int precision) const
+ {
+-    if(d->mBeamData.isEmpty() || d->mBeamData.first().size() <= i || isnan(d->mBeamData.first().at(i))) return QString();
++    if(d->mBeamData.isEmpty() || d->mBeamData.first().size() <= i || std::isnan(d->mBeamData.first().at(i))) return QString();
+     return valueAsString(d->mBeamData.first().at(i), precision); //retrieve the newest value for this beam
+ }
+ QString KSignalPlotter::valueAsString( qreal value, int precision) const
+ {
+-    if(isnan(value))
++    if(std::isnan(value))
+         return QString();
+     value = value / d->mScaleDownBy; // scale the value.  E.g. from Bytes to KiB
+     return d->scaledValueAsString(value, precision);
+--- libksysguard-5.5.4/tests/signalplottertest.cpp.orig	2016-01-26 20:36:46.000000000 +0100
++++ libksysguard-5.5.4/tests/signalplottertest.cpp	2016-02-28 15:41:28.590370803 +0100
+@@ -56,8 +56,8 @@ void TestSignalPlotter::testAddRemoveBea
+     s->addBeam(Qt::blue);
+     s->addBeam(Qt::red);
+ 
+-    QVERIFY( isnan(s->lastValue(0)) ); //unset, so should default to NaN
+-    QVERIFY( isnan(s->lastValue(1)) ); //unset, so should default to NaN
++    QVERIFY( std::isnan(s->lastValue(0)) ); //unset, so should default to NaN
++    QVERIFY( std::isnan(s->lastValue(1)) ); //unset, so should default to NaN
+     QCOMPARE(s->numBeams(), 2);
+     QVERIFY(s->beamColor(0) == Qt::blue);
+     QVERIFY(s->beamColor(1) == Qt::red);
+@@ -92,7 +92,7 @@ void TestSignalPlotter::testAddRemoveBea
+     QVERIFY(s->beamColor(0) == Qt::blue);
+     QVERIFY(s->beamColor(1) == Qt::red);
+     QCOMPARE(s->lastValue(0), 1.0);
+-    QVERIFY( isnan(s->lastValue(1)) ); //unset, so should default to NaN
++    QVERIFY( std::isnan(s->lastValue(1)) ); //unset, so should default to NaN
+ }
+ 
+ void TestSignalPlotter::testReorderBeams()
+@@ -153,8 +153,8 @@ void TestSignalPlotter::testReorderBeams
+     s->addBeam(Qt::blue);
+     s->addBeam(Qt::red);
+     QCOMPARE(s->numBeams(), 2);
+-    QVERIFY(isnan(s->lastValue(0))); //unset, so should default to NaN
+-    QVERIFY(isnan(s->lastValue(1))); //unset, so should default to NaN
++    QVERIFY(std::isnan(s->lastValue(0))); //unset, so should default to NaN
++    QVERIFY(std::isnan(s->lastValue(1))); //unset, so should default to NaN
+     //Add some data
+     QList<qreal> data;
+     data << 1.0 << 2.0;
+@@ -189,13 +189,13 @@ void TestSignalPlotter::testReorderBeams
+     QCOMPARE(s->numBeams(), 3);
+     QCOMPARE(s->lastValue(0), 2.0);
+     QCOMPARE(s->lastValue(1), 1.0);
+-    QVERIFY(isnan(s->lastValue(2))); //unset, so should default to NaN
++    QVERIFY(std::isnan(s->lastValue(2))); //unset, so should default to NaN
+ 
+     newOrder.clear();
+     newOrder << 2 << 0 << 1;
+     s->reorderBeams(newOrder);
+     QCOMPARE(s->numBeams(), 3);
+-    QVERIFY(isnan(s->lastValue(0))); //unset, so should default to NaN
++    QVERIFY(std::isnan(s->lastValue(0))); //unset, so should default to NaN
+     QCOMPARE(s->lastValue(1), 2.0);
+     QCOMPARE(s->lastValue(2), 1.0);
+ }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/kp5-libksysguard.git/commitdiff/0821518e218795b8ef3260891aa1f2793c1a2a19



More information about the pld-cvs-commit mailing list