INFINITY is a gcc-ism, use something more C++y (but it's possible to have *no* infinity() for floats; that would require another bit of hackery)
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=746992
This commit is contained in:
parent
4db2399b6e
commit
cb344f2acd
@ -21,6 +21,7 @@
|
||||
#include "layout.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <limits>
|
||||
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QTimeLine>
|
||||
@ -218,7 +219,7 @@ QSizeF Layout::minimumSize() const
|
||||
}
|
||||
QSizeF Layout::maximumSize() const
|
||||
{
|
||||
return QSizeF(INFINITY,INFINITY);
|
||||
return QSizeF(std::numeric_limits<float>::infinity(),std::numeric_limits<float>::infinity());
|
||||
}
|
||||
|
||||
void Layout::startAnimation()
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include <QPair>
|
||||
#include <QMap>
|
||||
|
||||
#include <limits>
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
NodeLayout::NodeCoordinate::NodeCoordinate(qreal xRelative, qreal yRelative, qreal xAbsolute, qreal yAbsolute)
|
||||
@ -42,7 +44,7 @@ NodeLayout::NodeCoordinate NodeLayout::NodeCoordinate::simple(qreal x, qreal y,
|
||||
break;
|
||||
case InnerRelative:
|
||||
coo.xr = x;
|
||||
coo.xa = INFINITY;
|
||||
coo.xa = std::numeric_limits<float>::infinity();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -57,7 +59,7 @@ NodeLayout::NodeCoordinate NodeLayout::NodeCoordinate::simple(qreal x, qreal y,
|
||||
break;
|
||||
case InnerRelative:
|
||||
coo.yr = y;
|
||||
coo.ya = INFINITY;
|
||||
coo.ya = std::numeric_limits<float>::infinity();
|
||||
break;
|
||||
}
|
||||
return coo;
|
||||
@ -104,14 +106,14 @@ public:
|
||||
|
||||
result.setTopLeft(calculatePosition(items[item].first, geometry));
|
||||
|
||||
if (items[item].second.xa != INFINITY) {
|
||||
if (items[item].second.xa != std::numeric_limits<float>::infinity()) {
|
||||
result.setRight(calculateXPosition(items[item].second, geometry));
|
||||
} else {
|
||||
result.setWidth(item->sizeHint().width());
|
||||
result.moveLeft(result.left() - items[item].second.xr * result.width());
|
||||
}
|
||||
|
||||
if (items[item].second.ya != INFINITY) {
|
||||
if (items[item].second.ya != std::numeric_limits<float>::infinity()) {
|
||||
result.setBottom(calculateYPosition(items[item].second, geometry));
|
||||
} else {
|
||||
result.setHeight(item->sizeHint().height());
|
||||
|
Loading…
x
Reference in New Issue
Block a user