fix the wreckage caused by last commit

bad Aaron, no cookie :)
can you check if those changes make sense upon what your patch ws supposed to be?
CCMAIL:aseigo@kde.org

svn path=/trunk/KDE/kdelibs/; revision=1188445
This commit is contained in:
Marco Martin 2010-10-22 12:29:35 +00:00
parent f241ee6ac7
commit 4dd1c28b6d
11 changed files with 29 additions and 32 deletions

View File

@ -34,7 +34,7 @@ public:
QAction *action;
ActionWidgetInterface(T *parent)
: ThemedWidgetInterface(parent)
: ThemedWidgetInterface<T>(parent),
action(0)
{
}
@ -57,20 +57,20 @@ public:
void syncToAction()
{
if (!action) {
q->setIcon(QIcon());
q->setText(QString());
q->setEnabled(false);
ThemedWidgetInterface<T>::q->setIcon(QIcon());
ThemedWidgetInterface<T>::q->setText(QString());
ThemedWidgetInterface<T>::q->setEnabled(false);
return;
}
//we don't get told *what* changed, just that something changed
//so we update everything we care about
q->setIcon(action->icon());
q->setText(action->iconText());
q->setEnabled(action->isEnabled());
q->setVisible(action->isVisible());
ThemedWidgetInterface<T>::q->setIcon(action->icon());
ThemedWidgetInterface<T>::q->setText(action->iconText());
ThemedWidgetInterface<T>::q->setEnabled(action->isEnabled());
ThemedWidgetInterface<T>::q->setVisible(action->isVisible());
if (!q->toolTip().isEmpty()) {
q->setToolTip(action->text());
if (!ThemedWidgetInterface<T>::q->toolTip().isEmpty()) {
ThemedWidgetInterface<T>::q->setToolTip(action->text());
}
changed();
@ -79,16 +79,16 @@ public:
void setAction(QAction *a)
{
if (action) {
QObject::disconnect(action, 0, t, 0);
QObject::disconnect(t, 0, action, 0);
QObject::disconnect(action, 0, ThemedWidgetInterface<T>::q, 0);
QObject::disconnect(ThemedWidgetInterface<T>::q, 0, action, 0);
}
action = a;
if (action) {
QObject::connect(action, SIGNAL(changed()), t, SLOT(syncToAction()));
QObject::connect(action, SIGNAL(destroyed(QObject*)), t, SLOT(clearAction()));
QObject::connect(t, SIGNAL(clicked()), action, SLOT(trigger()));
QObject::connect(action, SIGNAL(changed()), ThemedWidgetInterface<T>::q, SLOT(syncToAction()));
QObject::connect(action, SIGNAL(destroyed(QObject*)), ThemedWidgetInterface<T>::q, SLOT(clearAction()));
QObject::connect(ThemedWidgetInterface<T>::q, SIGNAL(clicked()), action, SLOT(trigger()));
syncToAction();
}
}

View File

@ -2,6 +2,7 @@
// storage.cpp //
// //
// Copyright (C) 2010 Brian Pritchett <batenkaitos@gmail.com> //
// Copyright (C) 2010 Marco Martin <mart@kde.org> //
// //
// This library is free software; you can redistribute it and/or //
// modify it under the terms of the GNU Lesser General Public //

View File

@ -2,6 +2,7 @@
// storage.h //
// //
// Copyright (C) 2010 Brian Pritchett <batenkaitos@gmail.com> //
// Copyright (C) 2010 Marco Martin <mart@kde.org> //
// //
// This library is free software; you can redistribute it and/or //
// modify it under the terms of the GNU Lesser General Public //

View File

@ -17,8 +17,8 @@
* Boston, MA 02110-1301, USA. *
*******************************************************************************/
#ifndef ACTIONWIDGETINTERFACE_P_H
#define ACTIONWIDGETINTERFACE_P_H
#ifndef THEMEDWIDGETINTERFACE_P_H
#define THEMEDWIDGETINTERFACE_P_H
#include "kglobalsettings.h"
#include <QApplication>
@ -88,7 +88,7 @@ public:
break;
case QEvent::PaletteChange:
customPalette = true;
// customPalette = true;
break;
default:

View File

@ -36,10 +36,10 @@
namespace Plasma
{
class FramePrivate
class FramePrivate : public ThemedWidgetInterface<Frame>
{
public:
FramePrivate(Frame *parent) : ThemedWidgetInterface<Frame>
FramePrivate(Frame *parent)
: ThemedWidgetInterface(parent),
svg(0),
image(0),

View File

@ -32,7 +32,7 @@
namespace Plasma
{
class GroupBoxPrivate : ThemedWidgetInterface<GroupBox>
class GroupBoxPrivate : public ThemedWidgetInterface<GroupBox>
{
public:
GroupBoxPrivate(GroupBox *groupBox)

View File

@ -116,7 +116,7 @@ IconWidgetPrivate::IconWidgetPrivate(IconWidget *i)
drawBg(false),
textBgCustomized(false)
{
d->initTheming();
initTheming();
}
IconWidgetPrivate::~IconWidgetPrivate()

View File

@ -30,6 +30,7 @@
#include <QtGui/QTextLayout>
#include <QtGui/QTextOption>
#include <plasma/plasma.h>
#include <plasma/plasma_export.h>
#include <plasma/framesvg.h>
#include <plasma/theme.h>
@ -216,13 +217,11 @@ public:
void readColors();
void colorConfigChanged();
void iconConfigChanged();
QFont widgetFont() const;
void hoverAnimationFinished();
void init();
void layoutIcons(const QStyleOptionGraphicsItem *option);
void animateMainIcon(bool, const IconWidgetStates state);
IconWidget *q;
QString text;
QString infoText;
Svg *iconSvg;
@ -280,7 +279,7 @@ void IconWidgetPrivate::setLayoutOptions(QTextLayout &layout,
textoption.setWrapMode(QTextOption::WordWrap); // NOTE: assumption as well
layout.setFont(widgetFont());
layout.setFont(q->font());
layout.setTextOption(textoption);
}

View File

@ -36,10 +36,10 @@
namespace Plasma
{
class LineEditPrivate
class LineEditPrivate : public ThemedWidgetInterface<LineEdit>
{
public:
LineEditPrivate(LineEdit *lineEdit) : ThemedWidgetInterface<Label>
LineEditPrivate(LineEdit *lineEdit)
: ThemedWidgetInterface(lineEdit)
{
}
@ -160,7 +160,7 @@ void LineEdit::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
void LineEdit::changeEvent(QEvent *event)
{
d->changEvent();
d->changeEvent(event);
QGraphicsProxyWidget::changeEvent(event);
}

View File

@ -114,8 +114,6 @@ public:
void syncActiveRect();
void syncBorders();
PushButton *q;
FrameSvg *background;
bool fadeIn;
qreal opacity;

View File

@ -102,8 +102,6 @@ public:
void syncBorders();
void animationUpdate(qreal progress);
ToolButton *q;
FrameSvg *background;
QPropertyAnimation *animation;
qreal opacity;