connect(&m_timer, SIGNAL(timeout()), this, SLOT(minimizeAll()));
}
-ShowDesktop::~ShowDesktop()
-{
-}
-
void ShowDesktop::init()
{
connect(this, SIGNAL(activate()), this, SLOT(minimizeAll()));
#ifndef MINIMIZE_ONLY
if (m_wm2ShowingDesktop) {
- connect(KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)), this, SLOT(reset()));
+ connect(
+ KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)),
+ this, SLOT(reset())
+ );
}
#endif
- connect(KGlobalSettings::self(), SIGNAL(iconChanged(int)),
- this, SLOT(iconSizeChanged(int)));
+ connect(
+ KGlobalSettings::self(), SIGNAL(iconChanged(int)),
+ this, SLOT(iconSizeChanged(int))
+ );
}
void ShowDesktop::minimizeAll()
{
m_timer.stop();
}
-#ifndef MINIMIZE_ONLY
+#ifndef MINIMIZE_ONLY
void ShowDesktop::delay()
{
m_goingDown = false;
QSizeF ShowDesktop::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const
{
if (which == Qt::PreferredSize) {
- int iconSize;
-
+ int iconSize = 0;
switch (formFactor()) {
case Plasma::Planar:
- case Plasma::MediaCenter:
+ case Plasma::MediaCenter: {
iconSize = IconSize(KIconLoader::Desktop);
break;
-
+ }
case Plasma::Horizontal:
- case Plasma::Vertical:
+ case Plasma::Vertical: {
iconSize = IconSize(KIconLoader::Panel);
break;
+ }
}
-
return QSizeF(iconSize, iconSize);
}
-
return Plasma::Applet::sizeHint(which, constraint);
}
updateGeometry();
}
}
-
-#endif
+#endif // MINIMIZE_ONLY
#include "moc_showdesktop.cpp"
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef SHOWDESKTOP_HEADER
-#define SHOWDESKTOP_HEADER
+#ifndef SHOWDESKTOP_H
+#define SHOWDESKTOP_H
//#define MINIMIZE_ONLY
class ShowDesktop : public Plasma::Applet
{
Q_OBJECT
- public:
- ShowDesktop(QObject *parent, const QVariantList &args);
- ~ShowDesktop();
+public:
+ ShowDesktop(QObject *parent, const QVariantList &args);
- virtual void init();
+ void init() final;
- public slots:
- void minimizeAll();
+public slots:
+ void minimizeAll();
#ifndef MINIMIZE_ONLY
- void reset();
- void delay();
+ void reset();
+ void delay();
#endif
- protected:
- void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
- void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
- QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const;
-
- private slots:
- void iconSizeChanged(int group);
-
- private:
- bool m_wm2ShowingDesktop;
+protected:
+ void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
+ void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
+ QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const;
+
+private slots:
+ void iconSizeChanged(int group);
+private:
+ bool m_wm2ShowingDesktop;
#ifndef MINIMIZE_ONLY
- bool m_down;
- bool m_goingDown;
+ bool m_down;
+ bool m_goingDown;
#endif
- QTimer m_timer;
+ QTimer m_timer;
};
K_EXPORT_PLASMA_APPLET(showdesktop, ShowDesktop)
-#endif
+#endif // SHOWDESKTOP_H