-convert some commented out debug to kDebug()

-const up some variables

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=772887
This commit is contained in:
Bill Egert 2008-02-09 17:10:40 +00:00
parent 4ebb5fcaeb
commit f6be272915

View File

@ -139,7 +139,7 @@ public:
// //
qreal layoutItem(const QRectF& geometry , LayoutItem *item , const qreal pos , qreal size, int row) qreal layoutItem(const QRectF& geometry , LayoutItem *item , const qreal pos , qreal size, int row)
{ {
//qDebug() << "layoutItem: " << direction << "item size" << size; //kDebug() << "layoutItem: " << direction << "item size" << size;
QRectF newGeometry; QRectF newGeometry;
qreal newPos = 0; qreal newPos = 0;
@ -147,8 +147,8 @@ public:
qreal top = 0; qreal top = 0;
qreal height = 0; qreal height = 0;
QSizeF minSize = item->minimumSize(); const QSizeF minSize = item->minimumSize();
QSizeF maxSize = item->maximumSize(); const QSizeF maxSize = item->maximumSize();
switch (direction) { switch (direction) {
case LeftToRight: case LeftToRight:
case RightToLeft: case RightToLeft:
@ -183,7 +183,7 @@ public:
break; break;
} }
// qDebug() << "Item geometry: " << newGeometry; // kDebug() << "Item geometry: " << newGeometry;
if (q->animator()) { if (q->animator()) {
q->animator()->setGeometry(item, newGeometry); q->animator()->setGeometry(item, newGeometry);
@ -398,12 +398,12 @@ LayoutItem *BoxLayout::takeAt(int i)
void BoxLayout::relayout() void BoxLayout::relayout()
{ {
QRectF margined = geometry().adjusted(margin(LeftMargin), margin(TopMargin), -margin(RightMargin), -margin(BottomMargin)); const QRectF margined = geometry().adjusted(margin(LeftMargin), margin(TopMargin), -margin(RightMargin), -margin(BottomMargin));
//qDebug() << "geo before " << geo << "and with margins" << margined << "margins" << margin(LeftMargin) //kDebug() << "geo before " << geo << "and with margins" << margined << "margins" << margin(LeftMargin)
// << margin(TopMargin) << -margin(RightMargin) << -margin(BottomMargin); // << margin(TopMargin) << -margin(RightMargin) << -margin(BottomMargin);
//qDebug() << "Box layout beginning with geo" << geometry; //kDebug() << "Box layout beginning with geo" << geometry;
//qDebug() << "This box max size" << maximumSize(); //kDebug() << "This box max size" << maximumSize();
d->rowCount = 1; d->rowCount = 1;
if (d->multiRow) { if (d->multiRow) {
qreal minRowSize = 1; qreal minRowSize = 1;
@ -430,7 +430,7 @@ void BoxLayout::relayout()
d->rowCount = qMax(1, d->rowCount); d->rowCount = qMax(1, d->rowCount);
} }
int colCount = d->colCount(); const int colCount = d->colCount();
QVector<qreal> sizes(colCount, 0); QVector<qreal> sizes(colCount, 0);
QVector<qreal> expansionSpace(colCount, 0); QVector<qreal> expansionSpace(colCount, 0);
@ -465,12 +465,12 @@ void BoxLayout::relayout()
sizes[i] = hint; sizes[i] = hint;
} }
// qDebug() << "Layout max item " << i << "size: " << maxItemSize; // kDebug() << "Layout max item " << i << "size: " << maxItemSize;
sizes[i] = qMin(sizes[i], maxItemSize); sizes[i] = qMin(sizes[i], maxItemSize);
sizes[i] = qMax(sizes[i], minItemSize); sizes[i] = qMax(sizes[i], minItemSize);
// qDebug() << "Available: " << available << "per item:" << perItemSize << // kDebug() << "Available: " << available << "per item:" << perItemSize <<
// "Initial size: " << sizes[i]; // "Initial size: " << sizes[i];
if (isExpanding) { if (isExpanding) {
@ -494,7 +494,7 @@ void BoxLayout::relayout()
const qreal threshold = 1.0; const qreal threshold = 1.0;
while (available > threshold && expandable > 0) { while (available > threshold && expandable > 0) {
qreal extraSpace = available / expandable; const qreal extraSpace = available / expandable;
for (int i = 0; i < colCount; i++) { for (int i = 0; i < colCount; i++) {
if (expansionSpace[i] > threshold) { if (expansionSpace[i] > threshold) {
qreal oldSize = sizes[i]; qreal oldSize = sizes[i];
@ -521,7 +521,7 @@ void BoxLayout::relayout()
//QObject *obj = dynamic_cast<QObject*>(d->children[i]); //QObject *obj = dynamic_cast<QObject*>(d->children[i]);
//if ( obj ) //if ( obj )
//qDebug() << "Item " << i << obj->metaObject()->className() << "size:" << sizes[i]; //kDebug() << "Item " << i << obj->metaObject()->className() << "size:" << sizes[i];
int p = d->layoutItem(margined, d->children[i], pos, sizes[col], row); int p = d->layoutItem(margined, d->children[i], pos, sizes[col], row);
newPos = (row != 0 && p < pos) ? qMin(p, newPos) : qMax(p, newPos); newPos = (row != 0 && p < pos) ? qMin(p, newPos) : qMax(p, newPos);