From 024b90c2479a1bf701cdacb9a9c0c05f30b6f982 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 28 Feb 2012 19:39:31 +0100 Subject: [PATCH] layoutcontainments is qgv specific --- coronabase.cpp | 63 -------------------------------------------------- coronabase.h | 8 ------- 2 files changed, 71 deletions(-) diff --git a/coronabase.cpp b/coronabase.cpp index 863e01c74..d50b14217 100644 --- a/coronabase.cpp +++ b/coronabase.cpp @@ -191,69 +191,6 @@ void CoronaBase::initializeLayout(const QString &configName) } } -void CoronaBase::layoutContainments() -{ - if (CoronaBasePrivate::s_positioningContainments) { - return; - } - - CoronaBasePrivate::s_positioningContainments = true; - - //TODO: we should avoid running this too often; consider compressing requests - // with a timer. - QList c = containments(); - QMutableListIterator it(c); - - while (it.hasNext()) { - Containment *containment = it.next(); - if (containment->containmentType() == Containment::PanelContainment || - containment->containmentType() == Containment::CustomPanelContainment) { - // weed out all containments we don't care about at all - // e.g. Panels and ourself - it.remove(); - continue; - } - } - - if (c.isEmpty()) { - CoronaBasePrivate::s_positioningContainments = false; - return; - } - - int column = 0; - int x = 0; - int y = 0; - int rowHeight = 0; - - it.toFront(); - while (it.hasNext()) { - Containment *containment = it.next(); - containment->setPos(x, y); - //kDebug() << ++count << "setting to" << x << y; - - int height = containment->size().height(); - if (height > rowHeight) { - rowHeight = height; - } - - ++column; - - if (column == CONTAINMENT_COLUMNS) { - column = 0; - x = 0; - y += rowHeight + INTER_CONTAINMENT_MARGIN + TOOLBOX_MARGIN; - rowHeight = 0; - } else { - x += containment->size().width() + INTER_CONTAINMENT_MARGIN; - } - //kDebug() << "column: " << column << "; x " << x << "; y" << y << "; width was" - // << containment->size().width(); - } - - CoronaBasePrivate::s_positioningContainments = false; -} - - void CoronaBase::loadLayout(const QString &configName) { if (!configName.isEmpty() && configName != d->configName) { diff --git a/coronabase.h b/coronabase.h index ed5691594..2f2b5ed89 100644 --- a/coronabase.h +++ b/coronabase.h @@ -339,14 +339,6 @@ public Q_SLOTS: */ void requireConfigSync(); - /** - * @since 4.5 - * Layout the containments on this CoronaBase. The default implementation - * organizes them in a grid-like view, but subclasses can reimplement - * this slot to provide their own layout. - */ - virtual void layoutContainments(); - Q_SIGNALS: /** * This signal indicates a new containment has been added to