From 292ad2ee4a1eacc19fe2e89e3d24c91961c010b5 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 7 Jan 2010 12:45:34 +0000 Subject: [PATCH 01/60] backport size hints fix svn path=/branches/KDE/4.4/kdelibs/; revision=1071053 --- widgets/toolbutton.cpp | 24 ++++++++++++++++++++---- widgets/toolbutton.h | 1 + 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/widgets/toolbutton.cpp b/widgets/toolbutton.cpp index 86e2ec3d8..1e3ba12fa 100644 --- a/widgets/toolbutton.cpp +++ b/widgets/toolbutton.cpp @@ -170,6 +170,11 @@ ToolButton::ToolButton(QGraphicsWidget *parent) : QGraphicsProxyWidget(parent), d(new ToolButtonPrivate(this)) { + d->background = new FrameSvg(this); + d->background->setImagePath("widgets/button"); + d->background->setCacheAllRenderedFrames(true); + d->background->setElementPrefix("normal"); + QToolButton *native = new QToolButton; connect(native, SIGNAL(clicked()), this, SIGNAL(clicked())); connect(native, SIGNAL(pressed()), this, SIGNAL(pressed())); @@ -178,10 +183,6 @@ ToolButton::ToolButton(QGraphicsWidget *parent) native->setAttribute(Qt::WA_NoSystemBackground); native->setAutoRaise(true); - d->background = new FrameSvg(this); - d->background->setImagePath("widgets/button"); - d->background->setCacheAllRenderedFrames(true); - d->background->setElementPrefix("normal"); d->syncBorders(); setAcceptHoverEvents(true); connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), SLOT(syncBorders())); @@ -215,6 +216,7 @@ bool ToolButton::autoRaise() const void ToolButton::setText(const QString &text) { static_cast(widget())->setText(text); + updateGeometry(); } QString ToolButton::text() const @@ -430,6 +432,20 @@ void ToolButton::changeEvent(QEvent *event) QGraphicsProxyWidget::changeEvent(event); } +QSizeF ToolButton::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const +{ + QSizeF hint = QGraphicsProxyWidget::sizeHint(which, constraint); + + //replace the native margin with the Svg one + QStyleOption option; + option.initFrom(nativeWidget()); + int nativeMargin = nativeWidget()->style()->pixelMetric(QStyle::PM_ButtonMargin, &option, nativeWidget()); + qreal left, top, right, bottom; + d->background->getMargins(left, top, right, bottom); + hint = hint - QSize(nativeMargin, nativeMargin) + QSize(left+right, top+bottom); + return hint; +} + } // namespace Plasma #include diff --git a/widgets/toolbutton.h b/widgets/toolbutton.h index 9a6a5d81d..0e1222589 100644 --- a/widgets/toolbutton.h +++ b/widgets/toolbutton.h @@ -172,6 +172,7 @@ protected: void hoverEnterEvent(QGraphicsSceneHoverEvent *event); void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); void changeEvent(QEvent *event); + QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint) const; private: Q_PRIVATE_SLOT(d, void syncBorders()) From 66e7fa884bd38eeb5ab642226c74421fe01a765c Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 7 Jan 2010 12:52:35 +0000 Subject: [PATCH 02/60] backport size hints fix svn path=/branches/KDE/4.4/kdelibs/; revision=1071056 --- widgets/pushbutton.cpp | 19 +++++++++++++++++++ widgets/pushbutton.h | 1 + 2 files changed, 20 insertions(+) diff --git a/widgets/pushbutton.cpp b/widgets/pushbutton.cpp index 3b9bfac5c..cd97e1d47 100644 --- a/widgets/pushbutton.cpp +++ b/widgets/pushbutton.cpp @@ -196,6 +196,7 @@ PushButton::~PushButton() void PushButton::setText(const QString &text) { static_cast(widget())->setText(text); + updateGeometry(); } QString PushButton::text() const @@ -509,6 +510,24 @@ void PushButton::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) QGraphicsProxyWidget::hoverLeaveEvent(event); } +QSizeF PushButton::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const +{ + QSizeF hint = QGraphicsProxyWidget::sizeHint(which, constraint); + + if (hint.isEmpty()) { + return hint; + } + + //replace the native margin with the Svg one + QStyleOption option; + option.initFrom(nativeWidget()); + int nativeMargin = nativeWidget()->style()->pixelMetric(QStyle::PM_ButtonMargin, &option, nativeWidget()); + qreal left, top, right, bottom; + d->background->getMargins(left, top, right, bottom); + hint = hint - QSize(nativeMargin, nativeMargin) + QSize(left+right, top+bottom); + return hint; +} + } // namespace Plasma #include diff --git a/widgets/pushbutton.h b/widgets/pushbutton.h index 214edb6d1..093e89849 100644 --- a/widgets/pushbutton.h +++ b/widgets/pushbutton.h @@ -217,6 +217,7 @@ protected: void hoverEnterEvent(QGraphicsSceneHoverEvent *event); void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); void changeEvent(QEvent *event); + QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint) const; private: Q_PRIVATE_SLOT(d, void syncBorders()) From e77ea715c6234da7e78f86444c03961672f2f5f6 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 7 Jan 2010 12:56:59 +0000 Subject: [PATCH 03/60] backport layout fixes here too svn path=/branches/KDE/4.4/kdelibs/; revision=1071062 --- widgets/toolbutton.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/widgets/toolbutton.cpp b/widgets/toolbutton.cpp index 1e3ba12fa..b522eb937 100644 --- a/widgets/toolbutton.cpp +++ b/widgets/toolbutton.cpp @@ -436,6 +436,10 @@ QSizeF ToolButton::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const { QSizeF hint = QGraphicsProxyWidget::sizeHint(which, constraint); + if (hint.isEmpty()) { + return hint; + } + //replace the native margin with the Svg one QStyleOption option; option.initFrom(nativeWidget()); From 164187c4e25fd924b1b9996520fdb62b26216db2 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 7 Jan 2010 19:22:46 +0000 Subject: [PATCH 04/60] backport the reverting of the size hint svn path=/branches/KDE/4.4/kdelibs/; revision=1071249 --- widgets/toolbutton.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/widgets/toolbutton.cpp b/widgets/toolbutton.cpp index b522eb937..e72884542 100644 --- a/widgets/toolbutton.cpp +++ b/widgets/toolbutton.cpp @@ -436,17 +436,6 @@ QSizeF ToolButton::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const { QSizeF hint = QGraphicsProxyWidget::sizeHint(which, constraint); - if (hint.isEmpty()) { - return hint; - } - - //replace the native margin with the Svg one - QStyleOption option; - option.initFrom(nativeWidget()); - int nativeMargin = nativeWidget()->style()->pixelMetric(QStyle::PM_ButtonMargin, &option, nativeWidget()); - qreal left, top, right, bottom; - d->background->getMargins(left, top, right, bottom); - hint = hint - QSize(nativeMargin, nativeMargin) + QSize(left+right, top+bottom); return hint; } From f3a2a662ca43c19864690fc0671a508858bfc6a8 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 7 Jan 2010 21:59:28 +0000 Subject: [PATCH 05/60] backport icon sizing fix svn path=/branches/KDE/4.4/kdelibs/; revision=1071367 --- widgets/iconwidget.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/widgets/iconwidget.cpp b/widgets/iconwidget.cpp index 98f8aba75..5abc579fd 100644 --- a/widgets/iconwidget.cpp +++ b/widgets/iconwidget.cpp @@ -546,9 +546,12 @@ void IconWidgetPrivate::layoutIcons(const QStyleOptionGraphicsItem *option) //if there is text resize the icon in order to make room for the text if (text.isEmpty() && infoText.isEmpty()) { // with no text, we just take up the whole geometry - iconWidth = currentSize.height() - - horizontalMargin[IconWidgetPrivate::IconMargin].left - - horizontalMargin[IconWidgetPrivate::IconMargin].right; + iconWidth = qMin(currentSize.height() - + horizontalMargin[IconWidgetPrivate::IconMargin].left - + horizontalMargin[IconWidgetPrivate::IconMargin].right, + currentSize.width() - + horizontalMargin[IconWidgetPrivate::IconMargin].left - + horizontalMargin[IconWidgetPrivate::IconMargin].right); } else { iconWidth = currentSize.height() - verticalMargin[IconWidgetPrivate::IconMargin].top - From 5c1a69f05f1dc565593b6362482adf61be0b27aa Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Thu, 7 Jan 2010 22:15:18 +0000 Subject: [PATCH 06/60] fix positioning svn path=/branches/KDE/4.4/kdelibs/; revision=1071386 --- private/desktoptoolbox.cpp | 44 +++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/private/desktoptoolbox.cpp b/private/desktoptoolbox.cpp index 1c2745e9a..1ff60130d 100644 --- a/private/desktoptoolbox.cpp +++ b/private/desktoptoolbox.cpp @@ -558,37 +558,37 @@ void DesktopToolBox::showToolBox() const int iconWidth = KIconLoader::SizeMedium; switch (corner()) { case TopRight: - x = (int)boundingRect().right() - iconWidth - 5 - d->toolBacker->size().width(); - y = (int)boundingRect().top() + 10; + x = (int)boundingRect().left() - d->toolBacker->size().width(); + y = (int)boundingRect().top(); break; case Top: - x = (int)boundingRect().center().x() - iconWidth - (d->toolBacker->size().width() / 2); - y = (int)boundingRect().top() + iconWidth + 10; + x = (int)boundingRect().center().x() - (d->toolBacker->size().width() / 2); + y = (int)boundingRect().bottom(); break; case TopLeft: - x = (int)boundingRect().left() + iconWidth + 5; - y = (int)boundingRect().top() + 10; + x = (int)boundingRect().right(); + y = (int)boundingRect().top(); break; case Left: - x = (int)boundingRect().left() + iconWidth + 5; - y = (int)boundingRect().center().y() - iconWidth; + x = (int)boundingRect().left() + iconWidth; + y = (int)boundingRect().y(); break; case Right: - x = (int)boundingRect().right() - iconWidth - 5 - d->toolBacker->size().width(); - y = (int)boundingRect().center().y() - iconWidth; + x = (int)boundingRect().right() - iconWidth - d->toolBacker->size().width(); + y = (int)boundingRect().y(); break; case BottomLeft: - x = (int)boundingRect().left() + iconWidth + 5; - y = (int)boundingRect().bottom() - 5; + x = (int)boundingRect().left() + iconWidth; + y = (int)boundingRect().bottom(); break; case Bottom: - x = (int)boundingRect().center().x() - iconWidth - (d->toolBacker->size().width() / 2); - y = (int)boundingRect().bottom() - iconWidth - 5; + x = (int)boundingRect().center().x() - (d->toolBacker->size().width() / 2); + y = (int)boundingRect().top(); break; case BottomRight: default: - x = (int)boundingRect().right() - iconWidth - 5 - d->toolBacker->size().width(); - y = (int)boundingRect().bottom() - iconWidth - 5; + x = (int)boundingRect().right() - iconWidth - d->toolBacker->size().width(); + y = (int)boundingRect().top(); break; } @@ -611,19 +611,16 @@ void DesktopToolBox::showToolBox() QRectF backerRect = mapToParent(d->toolBacker->geometry()).boundingRect(); QSizeF parentSize = parentWidget()->size(); if (backerRect.x() < 5) { - d->toolBacker->setPos(5, y); + d->toolBacker->setPos(mapFromParent(QPointF(5, 0)).x(), y); } else if (backerRect.right() > parentSize.width() - 5) { - d->toolBacker->setPos(parentSize.width() - 5 - backerRect.width(), y); + d->toolBacker->setPos(mapFromParent(QPointF(parentSize.width() - 5 - backerRect.width(), 0)).x(), y); } if (backerRect.y() < 5) { - d->toolBacker->setPos(x, 5); + d->toolBacker->setPos(x, mapFromParent(QPointF(0, 5)).y()); } else if (backerRect.bottom() > parentSize.height() - 5) { - d->toolBacker->setPos(x, parentSize.height() - 5 - backerRect.height()); + d->toolBacker->setPos(x, mapFromParent(QPointF(0, parentSize.height() - 5 - backerRect.height())).y()); } - - // re-map our starting points back to our coordinate system - backerRect = mapFromParent(backerRect).boundingRect(); } d->toolBacker->setOpacity(0); @@ -658,7 +655,6 @@ void DesktopToolBox::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) void DesktopToolBox::hideToolBox() { - Plasma::Animator *animdriver = Plasma::Animator::self(); foreach (QGraphicsItem *tool, tools()) { const int height = static_cast(tool->boundingRect().height()); if (isToolbar()) { From fb8898f32814ea6863cdabdb9c26d62fcb93cdf7 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 8 Jan 2010 02:03:55 +0000 Subject: [PATCH 07/60] if the Applet requests config() before being added to a containment, but is nested in another Applet, it should still use the nest-Applet's config. svn path=/branches/KDE/4.4/kdelibs/; revision=1071438 --- applet.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/applet.cpp b/applet.cpp index 10af395fc..46bdd4c5c 100644 --- a/applet.cpp +++ b/applet.cpp @@ -2749,17 +2749,16 @@ KConfigGroup *AppletPrivate::mainConfigGroup() } else { KConfigGroup appletConfig; - if (Containment *c = q->containment()) { - Plasma::Applet *parentApplet = qobject_cast(q->parent()); - if (parentApplet && parentApplet != static_cast(c)) { - // this applet is nested inside another applet! use it's config - // as the parent group in the config - appletConfig = parentApplet->config(); - } else { - // applet directly in a Containment, as usual - appletConfig = c->config(); - } - + Containment *c = q->containment(); + Applet *parentApplet = qobject_cast(q->parent()); + if (parentApplet && parentApplet != static_cast(c)) { + // this applet is nested inside another applet! use it's config + // as the parent group in the config + appletConfig = parentApplet->config(); + appletConfig = KConfigGroup(&appletConfig, "Applets"); + } else if (c) { + // applet directly in a Containment, as usual + appletConfig = c->config(); appletConfig = KConfigGroup(&appletConfig, "Applets"); } else { kWarning() << "requesting config for" << q->name() << "without a containment!"; From b35c1c7523e2a211cd4d12e9038f73a944c062a0 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Fri, 8 Jan 2010 10:29:48 +0000 Subject: [PATCH 08/60] SVN_SILENT made messages (.desktop file) svn path=/branches/KDE/4.4/kdelibs/; revision=1071564 --- kcm_remotewidgets.actions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kcm_remotewidgets.actions b/kcm_remotewidgets.actions index f643b44dd..8abd13f45 100644 --- a/kcm_remotewidgets.actions +++ b/kcm_remotewidgets.actions @@ -61,8 +61,8 @@ Description[pt]=Impede que o sistema grave as políticas dos elementos remotos d Description[pt_BR]=Previne o sistema de salvar as políticas de widgets Plasma remotos Description[ro]=Previne salvarea politicilor de controale distante de către sistem Description[sr]=Спречава систем да сачува смерница удаљених плазма виџета -Description[sr@ijekavian]=Спрјечава систем да сачува смијерница удаљених плазма виџета -Description[sr@ijekavianlatin]=Sprječava sistem da sačuva smijernica udaljenih plasma vidžeta +Description[sr@ijekavian]=Спрјечава систем да сачува смјерница удаљених плазма виџета +Description[sr@ijekavianlatin]=Sprječava sistem da sačuva smjernica udaljenih plasma vidžeta Description[sr@latin]=Sprečava sistem da sačuva smernica udaljenih plasma vidžeta Description[sv]=Förhindrar systemet från att spara policy för Plasma grafiska fjärrkomponenter Description[tg]=Системаро аз захиракунии сиёсати ваҷетҳои дурдаст қатъ мекунад From 2ec16f9d265514261d36334e87a1b0725abbeb2f Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 8 Jan 2010 22:07:30 +0000 Subject: [PATCH 09/60] it is possible to not be on the scene yet svn path=/branches/KDE/4.4/kdelibs/; revision=1071844 --- popupapplet.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/popupapplet.cpp b/popupapplet.cpp index 5d9322c03..7af4ed52a 100644 --- a/popupapplet.cpp +++ b/popupapplet.cpp @@ -690,10 +690,13 @@ void PopupAppletPrivate::updateDialogPosition() return; } - KConfigGroup sizeGroup = popupConfigGroup(); Corona *corona = qobject_cast(q->scene()); - Q_ASSERT(corona); + if (!corona) { + return; + } + + KConfigGroup sizeGroup = popupConfigGroup(); int preferredWidth = 0; int preferredHeight = 0; From 55838e20ec1e704f839fc339810abe4096aa5d39 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 8 Jan 2010 23:37:54 +0000 Subject: [PATCH 10/60] don't update the position over and over again svn path=/branches/KDE/4.4/kdelibs/; revision=1071894 --- private/internaltoolbox.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/private/internaltoolbox.cpp b/private/internaltoolbox.cpp index bbf750903..ad65a46f1 100644 --- a/private/internaltoolbox.cpp +++ b/private/internaltoolbox.cpp @@ -411,6 +411,12 @@ InternalToolBox::Corner InternalToolBox::corner() const void InternalToolBox::setViewTransform(const QTransform &transform) { + if (d->viewTransform == transform) { + return; + } + + d->viewTransform = transform; + if (transform.isScaling()) { d->toolbar = true; showToolBox(); @@ -420,7 +426,6 @@ void InternalToolBox::setViewTransform(const QTransform &transform) hideToolBox(); } } - d->viewTransform = transform; } void InternalToolBox::save(KConfigGroup &cg) const From b24cb0ce38935411cc4c22c07e43618f77cdebef Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sat, 9 Jan 2010 13:45:28 +0000 Subject: [PATCH 11/60] fix positioning svn path=/branches/KDE/4.4/kdelibs/; revision=1072154 --- private/desktoptoolbox.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/private/desktoptoolbox.cpp b/private/desktoptoolbox.cpp index 1ff60130d..02315dd0f 100644 --- a/private/desktoptoolbox.cpp +++ b/private/desktoptoolbox.cpp @@ -597,13 +597,12 @@ void DesktopToolBox::showToolBox() //could that cast ever fail? if (d->containment) { - topRight = viewTransform().map(mapFromParent(d->containment->boundingRect().bottomRight())); + topRight = d->containment->geometry().bottomRight(); } else { topRight = boundingRect().topRight(); } - - d->toolBacker->setPos(topRight.x() - d->toolBacker->size().width(), topRight.y()); + d->toolBacker->setPos(viewTransform().map(mapFromScene(topRight))-QPoint(d->toolBacker->size().width(), 0)); } else { //kDebug() << "starting at" << x << startY; d->toolBacker->setPos(x, y); From 7dce4cbec82e6fee208e57bc5577029033882324 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sat, 9 Jan 2010 17:31:21 +0000 Subject: [PATCH 12/60] backport 3d vector fix svn path=/branches/KDE/4.4/kdelibs/; revision=1072234 --- animations/rotation.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/animations/rotation.cpp b/animations/rotation.cpp index 797e6ae86..99430e47a 100644 --- a/animations/rotation.cpp +++ b/animations/rotation.cpp @@ -89,12 +89,15 @@ void RotationAnimation::updateState(QAbstractAnimation::State newState, QAbstrac if (axis() == Qt::XAxis) { switch (reference()) { case Center: + vector.setX(widgetWidth/2); vector.setY(widgetHeight/2); break; case Up: + vector.setX(widgetWidth/2); vector.setY(0); break; case Down: + vector.setX(widgetWidth/2); vector.setY(widgetHeight); break; } @@ -103,12 +106,15 @@ void RotationAnimation::updateState(QAbstractAnimation::State newState, QAbstrac switch (reference()) { case Center: vector.setX(widgetWidth/2); + vector.setY(widgetHeight/2); break; case Left: vector.setX(0); + vector.setY(widgetHeight/2); break; case Right: vector.setX(widgetWidth); + vector.setY(widgetHeight/2); break; } From a06f77b764e2ad1ed08e615164eddcacfe7ca23c Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Sun, 10 Jan 2010 10:44:47 +0000 Subject: [PATCH 13/60] SVN_SILENT made messages (.desktop file) svn path=/branches/KDE/4.4/kdelibs/; revision=1072526 --- data/servicetypes/plasma-applet-extenderapplet.desktop | 1 + data/servicetypes/plasma-applet-popupapplet.desktop | 1 + data/servicetypes/plasma-containmentactions.desktop | 1 + kcm_remotewidgets.actions | 2 ++ 4 files changed, 5 insertions(+) diff --git a/data/servicetypes/plasma-applet-extenderapplet.desktop b/data/servicetypes/plasma-applet-extenderapplet.desktop index 047835560..609491dcf 100644 --- a/data/servicetypes/plasma-applet-extenderapplet.desktop +++ b/data/servicetypes/plasma-applet-extenderapplet.desktop @@ -5,6 +5,7 @@ Name[ast]=Coleición Name[be@latin]=Zbor Name[bg]=Колекция Name[ca]=Col·lecció +Name[ca@valencia]=Col·lecció Name[cs]=Kolekce Name[csb]=Kòlekcëjô Name[da]=Samling diff --git a/data/servicetypes/plasma-applet-popupapplet.desktop b/data/servicetypes/plasma-applet-popupapplet.desktop index 8d9b29837..fadc1724d 100644 --- a/data/servicetypes/plasma-applet-popupapplet.desktop +++ b/data/servicetypes/plasma-applet-popupapplet.desktop @@ -8,6 +8,7 @@ Comment[ast]=Miniaplicación emerxente de script pa Plasma Comment[be@latin]=Skryptavy vypłyŭny aplet „Plasma” Comment[bg]=Аплет за Plasma за скриптове за изскачащи прозорци Comment[ca]=Miniaplicació emergent d'scripting del Plasma +Comment[ca@valencia]=Miniaplicació emergent d'scripting del Plasma Comment[cs]=Skriptovací vyskakující Plasma applet Comment[da]=Popop-applet til Plasma-scripting Comment[de]=Plasma-Skript-Miniprogramm diff --git a/data/servicetypes/plasma-containmentactions.desktop b/data/servicetypes/plasma-containmentactions.desktop index 89e828a98..ad4026425 100644 --- a/data/servicetypes/plasma-containmentactions.desktop +++ b/data/servicetypes/plasma-containmentactions.desktop @@ -6,6 +6,7 @@ Comment=Plasma ContainmentActions Comment[ar]=Plasma ContainmentActions Comment[bg]=Действия за контейнера на Plasma Comment[ca]=ContainmentActions del Plasma +Comment[ca@valencia]=ContainmentActions del Plasma Comment[da]=Plasma ContainmentActions Comment[de]=Plasma-Container-Aktionen Comment[el]=Ενέργειες Υποδοχέα Plasma diff --git a/kcm_remotewidgets.actions b/kcm_remotewidgets.actions index 8abd13f45..bea92abf8 100644 --- a/kcm_remotewidgets.actions +++ b/kcm_remotewidgets.actions @@ -3,6 +3,7 @@ Name=Save remote widgets policies Name[ar]=احفظ سياسات الودجات البعيدة Name[bg]=Запазване политиките на отдалечени джаджи Name[ca]=Desa polítiques d'estris remots +Name[ca@valencia]=Alça polítiques d'estris remots Name[da]=Gem politikker for eksterne widgets Name[de]=Regelungen für entfernte Miniprogramme speichern Name[el]=Αποθήκευση των πολιτικών απομακρυσμένων μικροεφαρμογών @@ -40,6 +41,7 @@ Description=Prevents the system from saving plasma remote widgets policies Description[ar]=تمنع النظام من حفظ سياسات الودجات بلازما البعيدة Description[bg]=Посигурява системата да не запазва политиките на отдалечените джаджи па plasma Description[ca]=Evita al sistema de desar polítiques d'estris remots del plasma +Description[ca@valencia]=Evita al sistema d'alçar polítiques d'estris remots del plasma Description[da]=Forhindrer systemet i et gemme politikker for eksterne plasma widgets Description[de]=Verhindert, dass das System Regeln für entfernte Miniprogramme speichert Description[el]=Αποτρέπει το σύστημα από το να σώσει τις πολιτικές απομακρυσμένων μικροεφαρμογών plasma From c337423b66395014dee0d1a099b8d4042fe44bf0 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sun, 10 Jan 2010 19:35:58 +0000 Subject: [PATCH 14/60] backport IconAction visibility fix svn path=/branches/KDE/4.4/kdelibs/; revision=1072709 --- widgets/iconwidget.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/widgets/iconwidget.cpp b/widgets/iconwidget.cpp index 5abc579fd..5098f1432 100644 --- a/widgets/iconwidget.cpp +++ b/widgets/iconwidget.cpp @@ -225,6 +225,10 @@ void IconAction::rebuildPixmap() bool IconAction::event(QEvent::Type type, const QPointF &pos) { + if (!m_action->isVisible() || !m_action->isEnabled()) { + return false; + } + if (m_icon->size().width() < m_rect.width() * 2.0 || m_icon->size().height() < m_rect.height() * 2.0) { return false; @@ -289,6 +293,10 @@ QAction *IconAction::action() const void IconAction::paint(QPainter *painter) const { + if (!m_action->isVisible() || !m_action->isEnabled()) { + return; + } + if (m_icon->size().width() < m_rect.width() * 2.0 || m_icon->size().height() < m_rect.height() * 2.0) { return; From a9b0c896f1ec3ffe8ed86c24785d51cd41e8af56 Mon Sep 17 00:00:00 2001 From: Davide Bettio Date: Tue, 12 Jan 2010 00:33:50 +0000 Subject: [PATCH 15/60] Replaced Quadros with Ethais. svn path=/branches/KDE/4.4/kdelibs/; revision=1073333 --- theme.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/theme.cpp b/theme.cpp index 44adfee8c..cb8620088 100644 --- a/theme.cpp +++ b/theme.cpp @@ -47,8 +47,8 @@ namespace Plasma { -#define DEFAULT_WALLPAPER_THEME "Quadros" -#define DEFAULT_WALLPAPER_SUFFIX ".jpg" +#define DEFAULT_WALLPAPER_THEME "Ethais" +#define DEFAULT_WALLPAPER_SUFFIX ".png" static const int DEFAULT_WALLPAPER_WIDTH = 1920; static const int DEFAULT_WALLPAPER_HEIGHT = 1200; From 9c042dff8f68c12498560921ce84564a1487acea Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Tue, 12 Jan 2010 04:19:02 +0000 Subject: [PATCH 16/60] Backport fix for bug 221371 (man: and info:foo doesn't work in KRunner, 4.3 regression) to KDE SC 4.4. BUG:221371 svn path=/branches/KDE/4.4/kdelibs/; revision=1073382 --- runnercontext.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/runnercontext.cpp b/runnercontext.cpp index 0daad5027..2bf9bad0b 100644 --- a/runnercontext.cpp +++ b/runnercontext.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include "abstractrunner.h" #include "querymatch.h" @@ -188,16 +189,16 @@ class RunnerContextPrivate : public QSharedData // that it has arguments! type = (space > 0) ? RunnerContext::ShellCommand : RunnerContext::Executable; - } else if (path.indexOf('/') == -1 && path.indexOf('\\') == -1 ) { - //if a path doesn't have any slashes is a single word or - //sentence: is too ambiguous to be sure we're in a filesystem context - return; } else { KUrl url(term); QString correctCasePath; - if (!url.protocol().isEmpty() && !url.isLocalFile()) { + // check if we have a local network location first, otherwise assume a path, + // but if a path doesn't have any slashes is a single word or + // sentence: it's too ambiguous to be sure we're in a filesystem context + if (KProtocolInfo::protocolClass(url.protocol()) == ":local" && !url.isLocalFile()) { type = RunnerContext::NetworkLocation; - } else if (correctPathCase(path, correctCasePath)) { + } else if ((path.indexOf('/') != -1 || path.indexOf('\\') != -1) && + correctPathCase(path, correctCasePath)) { path = correctCasePath; QFileInfo info(path); From 4014e41a7f3738384842dff042c25257de0ab6cb Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 12 Jan 2010 08:20:14 +0000 Subject: [PATCH 17/60] since the QGrahicsWidget we're given originates from the outside, don't assume it'll stay around nicely; use a QWeakPointer to track it svn path=/branches/KDE/4.4/kdelibs/; revision=1073415 --- dialog.cpp | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/dialog.cpp b/dialog.cpp index c7f0ef191..7f849ccac 100644 --- a/dialog.cpp +++ b/dialog.cpp @@ -65,7 +65,6 @@ public: : q(dialog), background(0), view(0), - graphicsWidget(0), resizeCorners(Dialog::NoCorner), resizeStartCorner(Dialog::NoCorner), moveTimer(0), @@ -90,7 +89,7 @@ public: */ Plasma::FrameSvg *background; QGraphicsView *view; - QGraphicsWidget *graphicsWidget; + QWeakPointer graphicsWidgetPtr; Dialog::ResizeCorners resizeCorners; QMap resizeAreas; int resizeStartCorner; @@ -101,6 +100,8 @@ public: void DialogPrivate::themeChanged() { + QGraphicsWidget *graphicsWidget = graphicsWidgetPtr.data(); + qreal topHeight; qreal leftWidth; qreal rightWidth; @@ -197,6 +198,7 @@ void DialogPrivate::themeChanged() void DialogPrivate::adjustView() { + QGraphicsWidget *graphicsWidget = graphicsWidgetPtr.data(); if (view && graphicsWidget) { const int prevStartCorner = resizeStartCorner; resizeStartCorner = -1; @@ -444,14 +446,15 @@ void Dialog::resizeEvent(QResizeEvent *e) setMask(QRect(QPoint(0, 0), size())); } - if (d->resizeStartCorner != -1 && d->view && d->graphicsWidget) { - d->graphicsWidget->resize(d->view->size()); + if (d->resizeStartCorner != -1 && d->view && d->graphicsWidgetPtr) { + QGraphicsWidget *graphicsWidget = d->graphicsWidgetPtr.data(); + graphicsWidget->resize(d->view->size()); - QRectF sceneRect(d->graphicsWidget->sceneBoundingRect()); + QRectF sceneRect(graphicsWidget->sceneBoundingRect()); sceneRect.setWidth(qMax(qreal(1), sceneRect.width())); sceneRect.setHeight(qMax(qreal(1), sceneRect.height())); d->view->setSceneRect(sceneRect); - d->view->centerOn(d->graphicsWidget); + d->view->centerOn(graphicsWidget); } d->updateResizeCorners(); @@ -500,11 +503,11 @@ void DialogPrivate::updateResizeCorners() void Dialog::setGraphicsWidget(QGraphicsWidget *widget) { - if (d->graphicsWidget) { - d->graphicsWidget->removeEventFilter(this); + if (d->graphicsWidgetPtr) { + d->graphicsWidgetPtr.data()->removeEventFilter(this); } - d->graphicsWidget = widget; + d->graphicsWidgetPtr = widget; if (widget) { if (!layout()) { @@ -539,12 +542,12 @@ void Dialog::setGraphicsWidget(QGraphicsWidget *widget) //BIC FIXME: should be const QGraphicsWidget *Dialog::graphicsWidget() { - return d->graphicsWidget; + return d->graphicsWidgetPtr.data(); } bool Dialog::eventFilter(QObject *watched, QEvent *event) { - if (d->resizeStartCorner == Dialog::NoCorner && watched == d->graphicsWidget && + if (d->resizeStartCorner == Dialog::NoCorner && watched == d->graphicsWidgetPtr.data() && (event->type() == QEvent::GraphicsSceneResize || event->type() == QEvent::GraphicsSceneMove)) { d->adjustViewTimer->start(150); } @@ -566,7 +569,8 @@ void Dialog::showEvent(QShowEvent * event) d->themeChanged(); d->updateResizeCorners(); - if (d->graphicsWidget && d->view && d->graphicsWidget->size().toSize() != d->view->size()) { + QGraphicsWidget *graphicsWidget = d->graphicsWidgetPtr.data(); + if (graphicsWidget && d->view && graphicsWidget->size().toSize() != d->view->size()) { d->adjustView(); } @@ -574,8 +578,8 @@ void Dialog::showEvent(QShowEvent * event) d->view->setFocus(); } - if (d->graphicsWidget) { - d->graphicsWidget->setFocus(); + if (graphicsWidget) { + graphicsWidget->setFocus(); } emit dialogVisible(true); @@ -589,8 +593,9 @@ void Dialog::focusInEvent(QFocusEvent *event) d->view->setFocus(); } - if (d->graphicsWidget) { - d->graphicsWidget->setFocus(); + QGraphicsWidget *graphicsWidget = d->graphicsWidgetPtr.data(); + if (graphicsWidget) { + graphicsWidget->setFocus(); } } From 7d4c3e651d16bbc76a3be90a385ff27dc4e76114 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 12 Jan 2010 09:41:45 +0000 Subject: [PATCH 18/60] export the enum so scripts can get at it svn path=/branches/KDE/4.4/kdelibs/; revision=1073433 --- animations/animation.h | 1 + 1 file changed, 1 insertion(+) diff --git a/animations/animation.h b/animations/animation.h index 764646281..56354ec9a 100644 --- a/animations/animation.h +++ b/animations/animation.h @@ -47,6 +47,7 @@ class PLASMA_EXPORT Animation : public QAbstractAnimation { Q_OBJECT + Q_ENUMS(Reference) Q_PROPERTY(int duration READ duration WRITE setDuration) Q_PROPERTY(QEasingCurve::Type easingCurveType READ easingCurveType WRITE setEasingCurveType) Q_PROPERTY(QGraphicsWidget *targetWidget READ targetWidget WRITE setTargetWidget) From 86d729b2499ff13ffe067bf7be41e3dfb6494cec Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 12 Jan 2010 09:43:40 +0000 Subject: [PATCH 19/60] center is a more sensible default svn path=/branches/KDE/4.4/kdelibs/; revision=1073435 --- animations/rotation_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/animations/rotation_p.h b/animations/rotation_p.h index 3a0b0d8df..e4123e949 100644 --- a/animations/rotation_p.h +++ b/animations/rotation_p.h @@ -57,7 +57,7 @@ public: * */ RotationAnimation(QObject *parent = 0, - const qint8 &reference = Up, + const qint8 &reference = Center, const Qt::Axis &axis = Qt::ZAxis, const qreal &angle = 180); From 05adc8378082fb50db8c07b1e917de64db25fc92 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 12 Jan 2010 09:55:42 +0000 Subject: [PATCH 20/60] backport AnimationDirection -> Animation::Direction svn path=/branches/KDE/4.4/kdelibs/; revision=1073438 --- animations/animation.h | 16 ++++++++++++++++ animations/rotationstacked.cpp | 2 +- animations/rotationstacked_p.h | 2 +- animations/slide.cpp | 4 ++-- animations/slide_p.h | 4 ++-- plasma.h | 14 -------------- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/animations/animation.h b/animations/animation.h index 56354ec9a..4819a22a7 100644 --- a/animations/animation.h +++ b/animations/animation.h @@ -48,6 +48,7 @@ class PLASMA_EXPORT Animation : public QAbstractAnimation Q_OBJECT Q_ENUMS(Reference) + Q_ENUMS(Direction) Q_PROPERTY(int duration READ duration WRITE setDuration) Q_PROPERTY(QEasingCurve::Type easingCurveType READ easingCurveType WRITE setEasingCurveType) Q_PROPERTY(QGraphicsWidget *targetWidget READ targetWidget WRITE setTargetWidget) @@ -70,6 +71,21 @@ public: Right }; + /** + * The movement direction of an animation. + */ + enum Direction { + MoveUp = 0, /**< Move up */ + MoveUpRight, /**< Move up and right */ + MoveRight, /**< Move right */ + MoveDownRight, /**< Move down and right */ + MoveDown, /**< Move down */ + MoveDownLeft, /**< Move down and left */ + MoveLeft, /**< Move left */ + MoveUpLeft /**< Move up and left */ + }; + + /** * Default constructor. * diff --git a/animations/rotationstacked.cpp b/animations/rotationstacked.cpp index 7093494fa..e021c8fa3 100644 --- a/animations/rotationstacked.cpp +++ b/animations/rotationstacked.cpp @@ -42,7 +42,7 @@ RotationStackedAnimation::~RotationStackedAnimation() void RotationStackedAnimation::setMovementDirection(const qint8 &direction) { - animDirection = static_cast(direction); + animDirection = static_cast(direction); } qint8 RotationStackedAnimation::movementDirection() const diff --git a/animations/rotationstacked_p.h b/animations/rotationstacked_p.h index 7f5181956..265074aa4 100644 --- a/animations/rotationstacked_p.h +++ b/animations/rotationstacked_p.h @@ -104,7 +104,7 @@ private: /** * Animation direction: where the animation will move. */ - Plasma::AnimationDirection animDirection; + Direction animDirection; /** Initial rotation angle from front widget */ int frontStartAngle; /** End value of the rotation angle of the front widget */ diff --git a/animations/slide.cpp b/animations/slide.cpp index 33fe5ff3e..7b5764848 100644 --- a/animations/slide.cpp +++ b/animations/slide.cpp @@ -40,7 +40,7 @@ SlideAnimation::~SlideAnimation() } SlideAnimation::SlideAnimation(QObject *parent, - AnimationDirection direction, + Direction direction, qreal distance) : Animation(parent) { setMovementDirection(direction); @@ -50,7 +50,7 @@ SlideAnimation::SlideAnimation(QObject *parent, void SlideAnimation::setMovementDirection(const qint8 &direction) { - m_animDirection = static_cast(direction); + m_animDirection = static_cast(direction); } qint8 SlideAnimation::movementDirection() const diff --git a/animations/slide_p.h b/animations/slide_p.h index d57b42952..84a298159 100644 --- a/animations/slide_p.h +++ b/animations/slide_p.h @@ -47,7 +47,7 @@ class SlideAnimation : public Animation public: SlideAnimation(QObject *parent = 0, - AnimationDirection direction = MoveUp, qreal distance = 0); + Direction direction = MoveUp, qreal distance = 0); ~SlideAnimation(); /** @@ -80,7 +80,7 @@ private: /** * Animation direction: where the animation will move. */ - Plasma::AnimationDirection m_animDirection; + Direction m_animDirection; /** * Animation distance: displacement factor for animations where diff --git a/plasma.h b/plasma.h index ca6d8b44e..b7f51e8a4 100644 --- a/plasma.h +++ b/plasma.h @@ -107,20 +107,6 @@ enum ZoomDirection { ZoomOut = 1 /**< Zoom out one step */ }; -/** - * The movement direction of an animation. - */ -enum AnimationDirection { - MoveUp = 0, /**< Move up */ - MoveUpRight, /**< Move up and right */ - MoveRight, /**< Move right */ - MoveDownRight, /**< Move down and right */ - MoveDown, /**< Move down */ - MoveDownLeft, /**< Move down and left */ - MoveLeft, /**< Move left */ - MoveUpLeft /**< Move up and left */ -}; - /** * The Location enumeration describes where on screen an element, such as an * Applet or its managing container, is positioned on the screen. From 5f6fd5e387045bd5cf68606683bd2dade69de577 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 12 Jan 2010 18:36:10 +0000 Subject: [PATCH 21/60] toggle the popup when activated CCBUG:222418 svn path=/branches/KDE/4.4/kdelibs/; revision=1073722 --- popupapplet.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/popupapplet.cpp b/popupapplet.cpp index 7af4ed52a..59d61e10c 100644 --- a/popupapplet.cpp +++ b/popupapplet.cpp @@ -59,7 +59,7 @@ PopupApplet::PopupApplet(QObject *parent, const QVariantList &args) int iconSize = IconSize(KIconLoader::Desktop); resize(iconSize, iconSize); disconnect(this, SIGNAL(activate()), (Applet*)this, SLOT(setFocus())); - connect(this, SIGNAL(activate()), this, SLOT(showPopup())); + connect(this, SIGNAL(activate()), this, SLOT(togglePopup())); setAcceptDrops(true); } @@ -70,7 +70,7 @@ PopupApplet::PopupApplet(const QString &packagePath, uint appletId, const QVaria int iconSize = IconSize(KIconLoader::Desktop); resize(iconSize, iconSize); disconnect(this, SIGNAL(activate()), (Applet*)this, SLOT(setFocus())); - connect(this, SIGNAL(activate()), this, SLOT(showPopup())); + connect(this, SIGNAL(activate()), this, SLOT(togglePopup())); setAcceptDrops(true); } @@ -512,10 +512,6 @@ void PopupApplet::showPopup(uint popupDuration) d->internalTogglePopup(); } - if (d->timer) { - d->timer->stop(); - } - if (popupDuration > 0) { if (!d->timer) { d->timer = new QTimer(this); @@ -593,8 +589,12 @@ PopupAppletPrivate::~PopupAppletPrivate() void PopupAppletPrivate::internalTogglePopup() { - Plasma::Dialog *d = dialogPtr.data(); - if (!d) { + if (timer) { + timer->stop(); + } + + Plasma::Dialog *dialog = dialogPtr.data(); + if (!dialog) { q->setFocus(Qt::ShortcutFocusReason); return; } @@ -607,14 +607,14 @@ void PopupAppletPrivate::internalTogglePopup() timer->stop(); } - if (d->isVisible()) { + if (dialog->isVisible()) { if (q->location() != Floating) { - d->animatedHide(locationToInverseDirection(q->location())); + dialog->animatedHide(locationToInverseDirection(q->location())); } else { - d->hide(); + dialog->hide(); } - d->clearFocus(); + dialog->clearFocus(); } else { if (q->graphicsWidget() && q->graphicsWidget() == static_cast(q)->d->extender.data() && @@ -626,19 +626,19 @@ void PopupAppletPrivate::internalTogglePopup() ToolTipManager::self()->hide(q); updateDialogPosition(); - KWindowSystem::setOnAllDesktops(d->winId(), true); - KWindowSystem::setState(d->winId(), NET::SkipTaskbar | NET::SkipPager); + KWindowSystem::setOnAllDesktops(dialog->winId(), true); + KWindowSystem::setState(dialog->winId(), NET::SkipTaskbar | NET::SkipPager); - d->setAspectRatioMode(savedAspectRatio); + dialog->setAspectRatioMode(savedAspectRatio); if (q->location() != Floating) { - d->animatedShow(locationToDirection(q->location())); + dialog->animatedShow(locationToDirection(q->location())); } else { - d->show(); + dialog->show(); } - if (!(d->windowFlags() & Qt::X11BypassWindowManagerHint)) { - KWindowSystem::activateWindow(d->winId()); + if (!(dialog->windowFlags() & Qt::X11BypassWindowManagerHint)) { + KWindowSystem::activateWindow(dialog->winId()); } } } From 341cfb63628dda607ee6be607eaa9ee439ef4c5c Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 12 Jan 2010 22:27:23 +0000 Subject: [PATCH 22/60] * kill some memory leaks * mark appropriate ctors with explicit * Direction -> MovementDirection so it doesn't conflict with QAbstractAnimation::Direction svn path=/branches/KDE/4.4/kdelibs/; revision=1073810 --- animations/animation.cpp | 9 ++-- animations/animation.h | 10 ++--- animations/fade_p.h | 3 +- animations/geometry_p.h | 3 +- animations/grow_p.h | 3 +- animations/pulser_p.h | 3 +- animations/pulsershadow_p.h | 2 +- animations/rotation.cpp | 5 +-- animations/rotation_p.h | 8 ++-- animations/rotationstacked.cpp | 77 +++++++++++++++++----------------- animations/rotationstacked_p.h | 18 ++++---- animations/slide.cpp | 6 +-- animations/slide_p.h | 5 +-- animations/stackedlayout.h | 2 +- animations/zoom_p.h | 2 +- 15 files changed, 78 insertions(+), 78 deletions(-) diff --git a/animations/animation.cpp b/animations/animation.cpp index 3cdaa586a..2a0ac8d9e 100644 --- a/animations/animation.cpp +++ b/animations/animation.cpp @@ -72,14 +72,15 @@ QGraphicsWidget* Animation::targetWidget() const return d->animObject.data(); } -void Animation::setEasingCurveType(QEasingCurve::Type type) +void Animation::setEasingCurve(const QEasingCurve &curve) { - d->easingCurve.setType(type); + kDebug() << "setting easing curve to type" << curve.type(); + d->easingCurve = curve; } -QEasingCurve::Type Animation::easingCurveType() const +QEasingCurve Animation::easingCurve() const { - return d->easingCurve.type(); + return d->easingCurve; } QEasingCurve& Animation::easingCurve() diff --git a/animations/animation.h b/animations/animation.h index 4819a22a7..bec96ece8 100644 --- a/animations/animation.h +++ b/animations/animation.h @@ -48,9 +48,9 @@ class PLASMA_EXPORT Animation : public QAbstractAnimation Q_OBJECT Q_ENUMS(Reference) - Q_ENUMS(Direction) + Q_ENUMS(MovementDirection) Q_PROPERTY(int duration READ duration WRITE setDuration) - Q_PROPERTY(QEasingCurve::Type easingCurveType READ easingCurveType WRITE setEasingCurveType) + Q_PROPERTY(QEasingCurve easingCurve READ easingCurve WRITE setEasingCurve) Q_PROPERTY(QGraphicsWidget *targetWidget READ targetWidget WRITE setTargetWidget) public: @@ -74,7 +74,7 @@ public: /** * The movement direction of an animation. */ - enum Direction { + enum MovementDirection { MoveUp = 0, /**< Move up */ MoveUpRight, /**< Move up and right */ MoveRight, /**< Move right */ @@ -114,12 +114,12 @@ public: /** * Set the animation easing curve type */ - void setEasingCurveType(QEasingCurve::Type type); + void setEasingCurve(const QEasingCurve &curve); /** * Get the animation easing curve type */ - QEasingCurve::Type easingCurveType() const; + QEasingCurve easingCurve() const; protected: /** diff --git a/animations/fade_p.h b/animations/fade_p.h index 92d52c2f1..fd67c2622 100644 --- a/animations/fade_p.h +++ b/animations/fade_p.h @@ -46,7 +46,8 @@ class FadeAnimation : public Animation public: /** Default constructor */ - FadeAnimation(QObject *parent = 0); + explicit FadeAnimation(QObject *parent = 0); + /** Destructor */ virtual ~FadeAnimation(); diff --git a/animations/geometry_p.h b/animations/geometry_p.h index 897c27155..aa698eefa 100644 --- a/animations/geometry_p.h +++ b/animations/geometry_p.h @@ -44,7 +44,8 @@ class GeometryAnimation : public Animation public: /** Default constructor */ - GeometryAnimation(QObject *parent = 0); + explicit GeometryAnimation(QObject *parent = 0); + /** Destructor */ virtual ~GeometryAnimation(); diff --git a/animations/grow_p.h b/animations/grow_p.h index 21dd2b04b..ce663dcff 100644 --- a/animations/grow_p.h +++ b/animations/grow_p.h @@ -50,7 +50,8 @@ public: * @param factor Expand factor (default is twice the size of * animated widget). */ - GrowAnimation(QObject *parent = 0, qreal factor = 2); + explicit GrowAnimation(QObject *parent = 0, qreal factor = 2); + /** Destructor */ virtual ~GrowAnimation(){}; diff --git a/animations/pulser_p.h b/animations/pulser_p.h index 89e5c65f4..af30be7d9 100644 --- a/animations/pulser_p.h +++ b/animations/pulser_p.h @@ -45,7 +45,8 @@ class PulseAnimation : public Animation public: /** Default Constructor */ - PulseAnimation(QObject *parent = 0); + explicit PulseAnimation(QObject *parent = 0); + /** Destructor */ ~PulseAnimation(); diff --git a/animations/pulsershadow_p.h b/animations/pulsershadow_p.h index 7cfb05a73..81d032734 100644 --- a/animations/pulsershadow_p.h +++ b/animations/pulsershadow_p.h @@ -29,7 +29,7 @@ class ShadowFake: public QGraphicsWidget Q_PROPERTY(QGraphicsWidget *target READ target WRITE setTarget) public: - ShadowFake(QGraphicsItem *parent = 0); + explicit ShadowFake(QGraphicsItem *parent = 0); ~ShadowFake(); void setTarget(QGraphicsWidget *target); diff --git a/animations/rotation.cpp b/animations/rotation.cpp index 99430e47a..a4fd4e943 100644 --- a/animations/rotation.cpp +++ b/animations/rotation.cpp @@ -26,10 +26,7 @@ namespace Plasma { -RotationAnimation::RotationAnimation(QObject *parent, - const qint8 &reference, - const Qt::Axis &axis, - const qreal &angle) +RotationAnimation::RotationAnimation(QObject *parent, qint8 reference, Qt::Axis axis, qreal angle) : Animation(parent) { setAngle(angle); diff --git a/animations/rotation_p.h b/animations/rotation_p.h index e4123e949..d10d16471 100644 --- a/animations/rotation_p.h +++ b/animations/rotation_p.h @@ -56,10 +56,10 @@ public: * @param angle Rotation angle (0 to 360) * */ - RotationAnimation(QObject *parent = 0, - const qint8 &reference = Center, - const Qt::Axis &axis = Qt::ZAxis, - const qreal &angle = 180); + explicit RotationAnimation(QObject *parent = 0, + qint8 reference = Center, + Qt::Axis axis = Qt::ZAxis, + qreal angle = 180); /** Destructor */ ~RotationAnimation(); diff --git a/animations/rotationstacked.cpp b/animations/rotationstacked.cpp index e021c8fa3..1c2acc168 100644 --- a/animations/rotationstacked.cpp +++ b/animations/rotationstacked.cpp @@ -30,27 +30,26 @@ namespace Plasma RotationStackedAnimation::RotationStackedAnimation(QObject *parent) : Animation(parent) { - backRotation = new QGraphicsRotation(this); - frontRotation = new QGraphicsRotation(this); - sLayout = new StackedLayout; + m_backRotation = new QGraphicsRotation(this); + m_frontRotation = new QGraphicsRotation(this); + m_sLayout = new StackedLayout; } RotationStackedAnimation::~RotationStackedAnimation() { - /* TODO: test what is lacking a parent and delete it */ + delete m_sLayout; } void RotationStackedAnimation::setMovementDirection(const qint8 &direction) { - animDirection = static_cast(direction); + m_animDirection = static_cast(direction); } qint8 RotationStackedAnimation::movementDirection() const { - return static_cast(animDirection); + return static_cast(m_animDirection); } - void RotationStackedAnimation::setReference(const qint8 &reference) { m_reference = reference; @@ -71,14 +70,14 @@ void RotationStackedAnimation::setBackWidget(QGraphicsWidget *backWidget) m_backWidget = backWidget; if(targetWidget()) { - sLayout->addWidget(targetWidget()); - sLayout->addWidget(m_backWidget.data()); + m_sLayout->addWidget(targetWidget()); + m_sLayout->addWidget(m_backWidget.data()); } } QGraphicsLayoutItem *RotationStackedAnimation::layout() { - return sLayout; + return m_sLayout; } void RotationStackedAnimation::updateState( @@ -103,60 +102,60 @@ void RotationStackedAnimation::updateState( vector.first = QVector3D(widgetFrontWidth/2, widgetFrontHeight/2, 0); vector.second = QVector3D(widgetBackWidth/2, widgetBackHeight/2, 0); - if (animDirection == MoveLeft || animDirection == MoveRight) { - frontRotation->setAxis(Qt::YAxis); - backRotation->setAxis(Qt::YAxis); + if (m_animDirection == MoveLeft || m_animDirection == MoveRight) { + m_frontRotation->setAxis(Qt::YAxis); + m_backRotation->setAxis(Qt::YAxis); - if (animDirection == MoveLeft) { + if (m_animDirection == MoveLeft) { /* TODO: the order way */ } else { - frontStartAngle = 0; - frontEndAngle = 90; - backStartAngle = 265; //hack - backEndAngle = 360; + m_frontStartAngle = 0; + m_frontEndAngle = 90; + m_backStartAngle = 265; //hack + m_backEndAngle = 360; } } } - frontRotation->setOrigin(vector.first); - backRotation->setOrigin(vector.second); + m_frontRotation->setOrigin(vector.first); + m_backRotation->setOrigin(vector.second); QList backTransformation; QList frontTransformation; - frontTransformation.append(frontRotation); - backTransformation.append(backRotation); + frontTransformation.append(m_frontRotation); + backTransformation.append(m_backRotation); widgets.first->setTransformations(frontTransformation); widgets.second->setTransformations(backTransformation); if (oldState == Stopped && newState == Running) { - frontRotation->setAngle(direction() == Forward ? frontStartAngle : frontEndAngle); - backRotation->setAngle(direction() == Forward ? backStartAngle : backEndAngle); + m_frontRotation->setAngle(direction() == Forward ? m_frontStartAngle : m_frontEndAngle); + m_backRotation->setAngle(direction() == Forward ? m_backStartAngle : m_backEndAngle); } else if(newState == Stopped) { - frontRotation->setAngle(direction() == Forward ? frontEndAngle : frontStartAngle); - backRotation->setAngle(direction() == Forward ? backEndAngle : backStartAngle); - } + m_frontRotation->setAngle(direction() == Forward ? m_frontEndAngle : m_frontStartAngle); + m_backRotation->setAngle(direction() == Forward ? m_backEndAngle : m_backStartAngle); +} } void RotationStackedAnimation::updateCurrentTime(int currentTime) { - QGraphicsWidget *w = targetWidget(); - if(w) { - qreal delta; - if (currentTime <= duration()/2) { - delta = Animation::easingCurve().valueForProgress( - (currentTime * 2) / qreal(duration())); - sLayout->setCurrentWidgetIndex(0); - delta = frontEndAngle * delta; - frontRotation->setAngle(delta); +QGraphicsWidget *w = targetWidget(); +if(w) { + qreal delta; + if (currentTime <= duration()/2) { + delta = Animation::easingCurve().valueForProgress( + (currentTime * 2) / qreal(duration())); + m_sLayout->setCurrentWidgetIndex(0); + delta = m_frontEndAngle * delta; + m_frontRotation->setAngle(delta); } else { delta = Animation::easingCurve().valueForProgress( (currentTime/2) / qreal(duration())); - sLayout->setCurrentWidgetIndex(1); - delta = backEndAngle * delta; - backRotation->setAngle(delta); + m_sLayout->setCurrentWidgetIndex(1); + delta = m_backEndAngle * delta; + m_backRotation->setAngle(delta); } } } diff --git a/animations/rotationstacked_p.h b/animations/rotationstacked_p.h index 265074aa4..61466597d 100644 --- a/animations/rotationstacked_p.h +++ b/animations/rotationstacked_p.h @@ -49,7 +49,7 @@ class RotationStackedAnimation : public Animation Q_PROPERTY(QGraphicsWidget* backWidget READ backWidget WRITE setBackWidget) public: - RotationStackedAnimation(QObject *parent = 0); + explicit RotationStackedAnimation(QObject *parent = 0); ~RotationStackedAnimation(); @@ -104,23 +104,23 @@ private: /** * Animation direction: where the animation will move. */ - Direction animDirection; + MovementDirection m_animDirection; /** Initial rotation angle from front widget */ - int frontStartAngle; + int m_frontStartAngle; /** End value of the rotation angle of the front widget */ - int frontEndAngle; + int m_frontEndAngle; /** Initial rotation angle from back widget */ - int backStartAngle; + int m_backStartAngle; /** End value of the rotation angle of the back widget */ - int backEndAngle; + int m_backEndAngle; /** Object the animation(s) should act upon. */ QWeakPointer m_backWidget; /** Back Widget Rotation transform object */ - QGraphicsRotation *backRotation; + QGraphicsRotation *m_backRotation; /** Front Widget Rotation transform object */ - QGraphicsRotation *frontRotation; + QGraphicsRotation *m_frontRotation; /** rotation stacked layout where the widget would be added */ - StackedLayout *sLayout; + StackedLayout *m_sLayout; }; } // Plasma diff --git a/animations/slide.cpp b/animations/slide.cpp index 7b5764848..000565f74 100644 --- a/animations/slide.cpp +++ b/animations/slide.cpp @@ -40,17 +40,17 @@ SlideAnimation::~SlideAnimation() } SlideAnimation::SlideAnimation(QObject *parent, - Direction direction, + MovementDirection direction, qreal distance) : Animation(parent) { setMovementDirection(direction); setDistance(distance); - Animation::setEasingCurveType(QEasingCurve::OutCirc); + setEasingCurve(QEasingCurve::OutCirc); } void SlideAnimation::setMovementDirection(const qint8 &direction) { - m_animDirection = static_cast(direction); + m_animDirection = static_cast(direction); } qint8 SlideAnimation::movementDirection() const diff --git a/animations/slide_p.h b/animations/slide_p.h index 84a298159..2ad31463b 100644 --- a/animations/slide_p.h +++ b/animations/slide_p.h @@ -46,8 +46,7 @@ class SlideAnimation : public Animation Q_PROPERTY(qreal distance READ distance WRITE setDistance) public: - SlideAnimation(QObject *parent = 0, - Direction direction = MoveUp, qreal distance = 0); + explicit SlideAnimation(QObject *parent = 0, MovementDirection direction = MoveUp, qreal distance = 0); ~SlideAnimation(); /** @@ -80,7 +79,7 @@ private: /** * Animation direction: where the animation will move. */ - Direction m_animDirection; + MovementDirection m_animDirection; /** * Animation distance: displacement factor for animations where diff --git a/animations/stackedlayout.h b/animations/stackedlayout.h index 274ac3023..01f156cf9 100644 --- a/animations/stackedlayout.h +++ b/animations/stackedlayout.h @@ -23,7 +23,7 @@ class StackedLayout : public QGraphicsLayout { public: - StackedLayout(QGraphicsLayoutItem *parent = 0); + explicit StackedLayout(QGraphicsLayoutItem *parent = 0); ~StackedLayout(); void setGeometry(const QRectF &rect); diff --git a/animations/zoom_p.h b/animations/zoom_p.h index ae91760af..c51b0a7ee 100644 --- a/animations/zoom_p.h +++ b/animations/zoom_p.h @@ -41,7 +41,7 @@ class ZoomAnimation : public Animation Q_PROPERTY(qreal zoom READ zoom WRITE setZoom) public: - ZoomAnimation(QObject *parent = 0); + explicit ZoomAnimation(QObject *parent = 0); virtual ~ZoomAnimation(); qreal zoom() const; From 0a7a7f543018d0e16f5d449cc38ab7ebaf4a2ea6 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 12 Jan 2010 22:31:40 +0000 Subject: [PATCH 23/60] completely unecessary now svn path=/branches/KDE/4.4/kdelibs/; revision=1073815 --- animations/animation.cpp | 5 ----- animations/animation.h | 9 --------- 2 files changed, 14 deletions(-) diff --git a/animations/animation.cpp b/animations/animation.cpp index 2a0ac8d9e..39bba15f3 100644 --- a/animations/animation.cpp +++ b/animations/animation.cpp @@ -83,11 +83,6 @@ QEasingCurve Animation::easingCurve() const return d->easingCurve; } -QEasingCurve& Animation::easingCurve() -{ - return d->easingCurve; -} - void Animation::updateCurrentTime(int currentTime) { Q_UNUSED(currentTime) diff --git a/animations/animation.h b/animations/animation.h index bec96ece8..74f14468f 100644 --- a/animations/animation.h +++ b/animations/animation.h @@ -138,15 +138,6 @@ protected: */ virtual void updateCurrentTime(int currentTime); - /** - * Internal use only, access the easing curve object (see - * \ref AnimationPrivate). Commonly used if a non-linear - * animation is desired while setting the delta in \ref updateCurrentTime. - * - * @return An internal easing curve (default is Type::Linear). - */ - QEasingCurve &easingCurve(); - private: /** From 08d517c788e80a086f7e37dfd68904be236ac2bc Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 13 Jan 2010 03:15:25 +0000 Subject: [PATCH 24/60] fixes for scripting svn path=/branches/KDE/4.4/kdelibs/; revision=1073882 --- framesvg.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/framesvg.h b/framesvg.h index 6155e68f9..9acacbaa8 100644 --- a/framesvg.h +++ b/framesvg.h @@ -77,7 +77,8 @@ class PLASMA_EXPORT FrameSvg : public Svg { Q_OBJECT - friend class Applet; + Q_FLAGS(EnabledBorders) + Q_PROPERTY(EnabledBorders enabledBorders READ enabledBorders WRITE setEnabledBorders) public: /** @@ -115,13 +116,13 @@ class PLASMA_EXPORT FrameSvg : public Svg * Sets what borders should be painted * @arg flags borders we want to paint */ - Q_INVOKABLE void setEnabledBorders(const EnabledBorders borders); + void setEnabledBorders(const EnabledBorders borders); /** * Convenience method to get the enabled borders * @return what borders are painted */ - Q_INVOKABLE EnabledBorders enabledBorders() const; + EnabledBorders enabledBorders() const; /** * Resize the frame maintaining the same border size @@ -259,6 +260,7 @@ class PLASMA_EXPORT FrameSvg : public Svg private: FrameSvgPrivate *const d; + friend class Applet; Q_PRIVATE_SLOT(d, void updateSizes()) Q_PRIVATE_SLOT(d, void updateNeeded()) From c0a7a4fd577922f6c00087120a76e185c7067fc5 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 13 Jan 2010 13:44:00 +0000 Subject: [PATCH 25/60] backport mask fix svn path=/branches/KDE/4.4/kdelibs/; revision=1074123 --- dialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialog.cpp b/dialog.cpp index 7f849ccac..42681e97e 100644 --- a/dialog.cpp +++ b/dialog.cpp @@ -443,7 +443,7 @@ void Dialog::resizeEvent(QResizeEvent *e) if (Plasma::Theme::defaultTheme()->windowTranslucencyEnabled()) { clearMask(); } else { - setMask(QRect(QPoint(0, 0), size())); + setMask(d->background->mask()); } if (d->resizeStartCorner != -1 && d->view && d->graphicsWidgetPtr) { From c174905f7640d054d967ca8cb366df1fdfb90eb9 Mon Sep 17 00:00:00 2001 From: Davide Bettio Date: Mon, 18 Jan 2010 23:16:48 +0000 Subject: [PATCH 26/60] Backport: Added missing condition: isDown() == true. now toolbuttons look pressed when isDown() == true. svn path=/branches/KDE/4.4/kdelibs/; revision=1076851 --- widgets/toolbutton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/toolbutton.cpp b/widgets/toolbutton.cpp index e72884542..9f9666dea 100644 --- a/widgets/toolbutton.cpp +++ b/widgets/toolbutton.cpp @@ -335,7 +335,7 @@ void ToolButton::paint(QPainter *painter, buttonOpt.toolButtonStyle = button->toolButtonStyle(); - if (button->isEnabled() && (d->animId || !button->autoRaise() || d->underMouse || (buttonOpt.state & QStyle::State_On) || button->isChecked())) { + if (button->isEnabled() && (d->animId || !button->autoRaise() || d->underMouse || (buttonOpt.state & QStyle::State_On) || button->isChecked() || button->isDown())) { if (button->isDown() || (buttonOpt.state & QStyle::State_On) || button->isChecked()) { d->background->setElementPrefix("pressed"); } else { From b0145f01f335404e9223ad593f82d6091acec3a8 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 19 Jan 2010 07:00:56 +0000 Subject: [PATCH 27/60] don't double-connect the signals svn path=/branches/KDE/4.4/kdelibs/; revision=1076950 --- applet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applet.cpp b/applet.cpp index 46bdd4c5c..ea86874a1 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1832,8 +1832,8 @@ void AppletPrivate::addGlobalShortcutsPage(KConfigDialog *dialog) //TODO: Apply button does not correctly work for now, so do not show it dialog->showButton(KDialog::Apply, false); - QObject::connect(dialog, SIGNAL(applyClicked()), q, SLOT(configDialogFinished())); - QObject::connect(dialog, SIGNAL(okClicked()), q, SLOT(configDialogFinished())); + QObject::connect(dialog, SIGNAL(applyClicked()), q, SLOT(configDialogFinished()), Qt::UniqueConnection); + QObject::connect(dialog, SIGNAL(okClicked()), q, SLOT(configDialogFinished()), Qt::UniqueConnection); } void AppletPrivate::addPublishPage(KConfigDialog *dialog) From 608c04a25ad6d927d8098f05b33dd395385d3750 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 19 Jan 2010 20:57:47 +0000 Subject: [PATCH 28/60] style*S*heet svn path=/branches/KDE/4.4/kdelibs/; revision=1077259 --- widgets/pushbutton.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/pushbutton.h b/widgets/pushbutton.h index 093e89849..1565a0e16 100644 --- a/widgets/pushbutton.h +++ b/widgets/pushbutton.h @@ -45,7 +45,7 @@ class PLASMA_EXPORT PushButton : public QGraphicsProxyWidget Q_PROPERTY(QGraphicsWidget *parentWidget READ parentWidget) Q_PROPERTY(QString text READ text WRITE setText) Q_PROPERTY(QString image READ image WRITE setImage) - Q_PROPERTY(QString stylesheet READ styleSheet WRITE setStyleSheet) + Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet) Q_PROPERTY(KPushButton *nativeWidget READ nativeWidget) Q_PROPERTY(QAction *action READ action WRITE setAction) Q_PROPERTY(QIcon icon READ icon WRITE setIcon) From 82510f36c1fe9fb2099b54eeac2f0ca8cb644276 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 19 Jan 2010 21:29:03 +0000 Subject: [PATCH 29/60] style*S*heet svn path=/branches/KDE/4.4/kdelibs/; revision=1077280 --- widgets/scrollbar.h | 2 +- widgets/textbrowser.h | 2 +- widgets/textedit.h | 2 +- widgets/toolbutton.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/widgets/scrollbar.h b/widgets/scrollbar.h index bf7b2c679..07e271cd6 100644 --- a/widgets/scrollbar.h +++ b/widgets/scrollbar.h @@ -45,7 +45,7 @@ class PLASMA_EXPORT ScrollBar : public QGraphicsProxyWidget Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged) Q_PROPERTY(int minimum READ minimum) Q_PROPERTY(int maximum READ maximum) - Q_PROPERTY(QString stylesheet READ styleSheet WRITE setStyleSheet) + Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet) Q_PROPERTY(QScrollBar *nativeWidget READ nativeWidget) public: diff --git a/widgets/textbrowser.h b/widgets/textbrowser.h index 7211c41af..ca5ab4794 100644 --- a/widgets/textbrowser.h +++ b/widgets/textbrowser.h @@ -45,7 +45,7 @@ class PLASMA_EXPORT TextBrowser : public QGraphicsProxyWidget Q_PROPERTY(QGraphicsWidget *parentWidget READ parentWidget) Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) - Q_PROPERTY(QString stylesheet READ styleSheet WRITE setStyleSheet) + Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet) Q_PROPERTY(KTextBrowser *nativeWidget READ nativeWidget) public: diff --git a/widgets/textedit.h b/widgets/textedit.h index 25cd40fa6..335a265b7 100644 --- a/widgets/textedit.h +++ b/widgets/textedit.h @@ -43,7 +43,7 @@ class PLASMA_EXPORT TextEdit : public QGraphicsProxyWidget Q_PROPERTY(QGraphicsWidget *parentWidget READ parentWidget) Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) - Q_PROPERTY(QString stylesheet READ styleSheet WRITE setStyleSheet) + Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet) Q_PROPERTY(KTextEdit *nativeWidget READ nativeWidget WRITE setNativeWidget) Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly) diff --git a/widgets/toolbutton.h b/widgets/toolbutton.h index 0e1222589..3c1dbdb4a 100644 --- a/widgets/toolbutton.h +++ b/widgets/toolbutton.h @@ -44,7 +44,7 @@ class PLASMA_EXPORT ToolButton : public QGraphicsProxyWidget Q_PROPERTY(QString text READ text WRITE setText) Q_PROPERTY(bool autoRaise READ autoRaise WRITE setAutoRaise) Q_PROPERTY(QString image READ image WRITE setImage) - Q_PROPERTY(QString stylesheet READ styleSheet WRITE setStyleSheet) + Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet) Q_PROPERTY(QToolButton *nativeWidget READ nativeWidget) Q_PROPERTY(QAction *action READ action WRITE setAction) From 1c7b6598bc6ccb0eaa032f2d207c91315cd5d280 Mon Sep 17 00:00:00 2001 From: Anne-Marie Mahfouf Date: Wed, 20 Jan 2010 08:40:05 +0000 Subject: [PATCH 30/60] support .tar.bzip2 packages Zachary, that should fix most problems with non installed packages. Some themes however have other problems such as Plix which has an invalid .desktop file. I'll try to make the author fix it. Thanks for the report, this fix will make it to RC2 I think. BUG=223428 svn path=/branches/KDE/4.4/kdelibs/; revision=1077441 --- package.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.cpp b/package.cpp index 0ad250a29..2b668c719 100644 --- a/package.cpp +++ b/package.cpp @@ -347,7 +347,7 @@ bool Package::installPackage(const QString &package, if (mimetype->is("application/zip")) { archive = new KZip(package); } else if (mimetype->is("application/x-compressed-tar") || - mimetype->is("application/x-tar")) { + mimetype->is("application/x-tar") || mimetype->is("application/x-bzip-compressed-tar")) { archive = new KTar(package); } else { kWarning() << "Could not open package file, unsupported archive format:" << package << mimetype->name(); From aba1ec223155d214941dd1e1a5160a83c2c10327 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 20 Jan 2010 21:33:06 +0000 Subject: [PATCH 31/60] missing Q_PROPERTY and Q_INVOKABLE entries svn path=/branches/KDE/4.4/kdelibs/; revision=1077773 --- extenders/extender.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/extenders/extender.h b/extenders/extender.h index bd4b21119..45026aafc 100644 --- a/extenders/extender.h +++ b/extenders/extender.h @@ -66,6 +66,11 @@ class PLASMA_EXPORT Extender : public QGraphicsWidget { Q_OBJECT Q_PROPERTY(QString emptyExtenderMessage READ emptyExtenderMessage WRITE setEmptyExtenderMessage) + Q_PROPERTY(QList items READ items()) + Q_PROPERTY(QList attachedItems READ attachedItems()) + Q_PROPERTY(QList detachedItems READ detachedItems()) + Q_PROPERTY(QList groups READ groups()) + Q_PROPERTY(bool empty READ isEmpty()) public: /** @@ -136,7 +141,7 @@ class PLASMA_EXPORT Extender : public QGraphicsWidget * even if the requested item isn't instantiated yet. * @returns the requested item */ - ExtenderItem *item(const QString &name) const; + Q_INVOKABLE ExtenderItem *item(const QString &name) const; /** * Extra convenience function for obtaining groups specified by name. This will avoid needed @@ -144,7 +149,7 @@ class PLASMA_EXPORT Extender : public QGraphicsWidget * @returns the requested group * @since 4.3 */ - ExtenderGroup *group(const QString &name) const; + Q_INVOKABLE ExtenderGroup *group(const QString &name) const; /** * This function can be used for easily determining if a certain item is already displayed @@ -154,7 +159,7 @@ class PLASMA_EXPORT Extender : public QGraphicsWidget * @returns whether or not this item already exists. * @since 4.3 */ - bool hasItem(const QString &name) const; + Q_INVOKABLE bool hasItem(const QString &name) const; /** * @return true if the Extender is visually empty (though it may have items such as From 368ba84f1049c6c10bf73ee1adeac1c245eea3c4 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 20 Jan 2010 23:47:47 +0000 Subject: [PATCH 32/60] property name corrections svn path=/branches/KDE/4.4/kdelibs/; revision=1077842 --- widgets/checkbox.h | 2 +- widgets/lineedit.h | 2 +- widgets/radiobutton.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/widgets/checkbox.h b/widgets/checkbox.h index 8e99dac57..6e8d77f30 100644 --- a/widgets/checkbox.h +++ b/widgets/checkbox.h @@ -45,7 +45,7 @@ class PLASMA_EXPORT CheckBox : public QGraphicsProxyWidget Q_PROPERTY(QString image READ image WRITE setImage) Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet) Q_PROPERTY(QCheckBox *nativeWidget READ nativeWidget) - Q_PROPERTY(bool isChecked READ isChecked WRITE setChecked NOTIFY toggled) + Q_PROPERTY(bool checked READ isChecked WRITE setChecked NOTIFY toggled) public: explicit CheckBox(QGraphicsWidget *parent = 0); diff --git a/widgets/lineedit.h b/widgets/lineedit.h index e6e1c11a1..b6cd06806 100644 --- a/widgets/lineedit.h +++ b/widgets/lineedit.h @@ -42,7 +42,7 @@ class PLASMA_EXPORT LineEdit : public QGraphicsProxyWidget Q_PROPERTY(QGraphicsWidget *parentWidget READ parentWidget) Q_PROPERTY(QString text READ text WRITE setText NOTIFY textEdited) - Q_PROPERTY(bool isClearButtonShown READ isClearButtonShown WRITE setClearButtonShown) + Q_PROPERTY(bool clearButtonShown READ isClearButtonShown WRITE setClearButtonShown) Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet) Q_PROPERTY(KLineEdit *nativeWidget READ nativeWidget WRITE setNativeWidget) diff --git a/widgets/radiobutton.h b/widgets/radiobutton.h index a31a05fc5..6cec3170b 100644 --- a/widgets/radiobutton.h +++ b/widgets/radiobutton.h @@ -45,7 +45,7 @@ class PLASMA_EXPORT RadioButton : public QGraphicsProxyWidget Q_PROPERTY(QString image READ image WRITE setImage) Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet) Q_PROPERTY(QRadioButton *nativeWidget READ nativeWidget) - Q_PROPERTY(bool isChecked READ isChecked WRITE setChecked NOTIFY toggled) + Q_PROPERTY(bool checked READ isChecked WRITE setChecked NOTIFY toggled) public: explicit RadioButton(QGraphicsWidget *parent = 0); From cc5eaae1c21cf748ceb10dffb9c196e637cb4ce1 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Thu, 21 Jan 2010 00:14:04 +0000 Subject: [PATCH 33/60] missing API for scripting svn path=/branches/KDE/4.4/kdelibs/; revision=1077851 --- widgets/scrollbar.cpp | 5 +++++ widgets/scrollbar.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/widgets/scrollbar.cpp b/widgets/scrollbar.cpp index 87cf6bbad..44fb824c1 100644 --- a/widgets/scrollbar.cpp +++ b/widgets/scrollbar.cpp @@ -116,6 +116,11 @@ QScrollBar *ScrollBar::nativeWidget() const return static_cast(widget()); } +Qt::Orientation ScrollBar::orientation() const +{ + return nativeWidget()->orientation(); +} + void ScrollBar::setOrientation(Qt::Orientation orientation) { QScrollBar *native = static_cast(widget()); diff --git a/widgets/scrollbar.h b/widgets/scrollbar.h index 07e271cd6..50dfeba7c 100644 --- a/widgets/scrollbar.h +++ b/widgets/scrollbar.h @@ -47,6 +47,7 @@ class PLASMA_EXPORT ScrollBar : public QGraphicsProxyWidget Q_PROPERTY(int maximum READ maximum) Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet) Q_PROPERTY(QScrollBar *nativeWidget READ nativeWidget) + Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) public: /** @@ -118,6 +119,12 @@ public: */ QScrollBar *nativeWidget() const; + /** + * @return the orientation of the scrollbar + * @since 4.4 + */ + Qt::Orientation orientation() const; + protected: void contextMenuEvent(QGraphicsSceneContextMenuEvent *event); From b35d6fcada13b903c067f17192ba76553c5ce591 Mon Sep 17 00:00:00 2001 From: Chani Armitage Date: Thu, 21 Jan 2010 06:09:48 +0000 Subject: [PATCH 34/60] backport of r1077904: changing names works better when you change all instances ;) svn path=/branches/KDE/4.4/kdelibs/; revision=1077905 --- applet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applet.cpp b/applet.cpp index ea86874a1..f7acd0349 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1196,7 +1196,7 @@ void Applet::flushPendingConstraintsEvents() action = d->actions->action("configure"); if (action) { - bool canConfig = unlocked || KAuthorized::authorize("PlasmaAllowConfigureWhenLocked"); + bool canConfig = unlocked || KAuthorized::authorize("plasma/allow_configure_when_locked"); action->setVisible(canConfig); action->setEnabled(canConfig); } @@ -1698,7 +1698,7 @@ void Applet::showConfigurationInterface() return; } - if (immutability() != Mutable && !KAuthorized::authorize("PlasmaAllowConfigureWhenLocked")) { + if (immutability() != Mutable && !KAuthorized::authorize("plasma/allow_configure_when_locked")) { //FIXME: in 4.3 add an explanatory dialog return; } From a1413731fc7e777615211e7c92c5a77a5aafe34a Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Thu, 21 Jan 2010 10:17:20 +0000 Subject: [PATCH 35/60] SVN_SILENT made messages (.desktop file) svn path=/branches/KDE/4.4/kdelibs/; revision=1078033 --- data/servicetypes/plasma-containmentactions.desktop | 2 ++ kcm_remotewidgets.actions | 2 ++ 2 files changed, 4 insertions(+) diff --git a/data/servicetypes/plasma-containmentactions.desktop b/data/servicetypes/plasma-containmentactions.desktop index ad4026425..bfea98a78 100644 --- a/data/servicetypes/plasma-containmentactions.desktop +++ b/data/servicetypes/plasma-containmentactions.desktop @@ -14,6 +14,7 @@ Comment[en_GB]=Plasma ContainmentActions Comment[es]=ContainmentActions de Plasma Comment[et]=Plasma konteineritoimingud Comment[eu]=Plasma ContainmentActions +Comment[fr]=Plasma d'actions contenantes Comment[gl]=ContainmentActions de Plasma Comment[hr]=Plasma ContainmentActions Comment[hu]=Plasma tartóműveletek @@ -27,6 +28,7 @@ Comment[nl]=Plasma Containeracties Comment[pt]=Acções do Contentor do Plasma Comment[pt_BR]=Ações do contentor do Plasma Comment[ro]=AcțiuniContainer Plasma +Comment[ru]=Действия для контейнеров Plasma Comment[sr]=Плазма радње садржалаца Comment[sr@ijekavian]=Плазма радње садржалаца Comment[sr@ijekavianlatin]=Plasma radnje sadržalaca diff --git a/kcm_remotewidgets.actions b/kcm_remotewidgets.actions index bea92abf8..8d18349e0 100644 --- a/kcm_remotewidgets.actions +++ b/kcm_remotewidgets.actions @@ -11,6 +11,7 @@ Name[en_GB]=Save remote widgets policies Name[es]=Guardar las políticas de elementos gráficos remotos Name[et]=Välisvidinate reeglite salvestamine Name[eu]=Gorde urruneko widget politikak +Name[fr]=Enregistrer la politique des éléments distants Name[gl]=Gardar as políticas dos widgets remotos Name[hr]=Snimi pravila za udaljene widgete Name[hu]=A távoli Plasma-elemek használati módjának mentése @@ -48,6 +49,7 @@ Description[el]=Αποτρέπει το σύστημα από το να σώσε Description[en_GB]=Prevents the system from saving plasma remote widgets policies Description[es]=Impide que el sistema guarde políticas de elementos gráficos remotos Description[et]=Takistab süsteemil salvestamast Plasma välisvidinate reegleid +Description[fr]=Empêche le système d'enregistrer la politique des éléments distants Description[gl]=Evita que o sistema garde as políticas de plasma dos widgets remotos Description[hr]=Brani sustavu da snima pravila za plasama udaljene widgete Description[hu]=Meggátolja, hogy a gép elmentse a távoli Plasma-elemek házirendjét From 1fda1d9cbe031a171546ebc7912a936010f210fe Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sat, 23 Jan 2010 17:36:05 +0000 Subject: [PATCH 36/60] backport opacity fix svn path=/branches/KDE/4.4/kdelibs/; revision=1079120 --- private/focusindicator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/private/focusindicator.cpp b/private/focusindicator.cpp index 4905f9ff9..f88ef42db 100644 --- a/private/focusindicator.cpp +++ b/private/focusindicator.cpp @@ -47,6 +47,7 @@ FocusIndicator::FocusIndicator(QGraphicsWidget *parent, QString widget) m_fade->setTargetWidget(this); m_fade->setProperty("startOpacity", 0.0); m_fade->setProperty("targetOpacity", 1.0); + setOpacity(0); parent->installEventFilter(this); connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), SLOT(syncGeometry())); From 8e4cef7e957f780ca91fd949fe13764c26c257b5 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Sun, 24 Jan 2010 10:44:13 +0000 Subject: [PATCH 37/60] SVN_SILENT made messages (.desktop file) svn path=/branches/KDE/4.4/kdelibs/; revision=1079465 --- data/servicetypes/plasma-containmentactions.desktop | 1 + kcm_remotewidgets.actions | 2 ++ 2 files changed, 3 insertions(+) diff --git a/data/servicetypes/plasma-containmentactions.desktop b/data/servicetypes/plasma-containmentactions.desktop index bfea98a78..428bd16d1 100644 --- a/data/servicetypes/plasma-containmentactions.desktop +++ b/data/servicetypes/plasma-containmentactions.desktop @@ -25,6 +25,7 @@ Comment[ko]=Plasma ContainmentActions Comment[nb]=Plasma ContainmentActions Comment[nds]=Plasma-Gelaatsakschonen Comment[nl]=Plasma Containeracties +Comment[nn]=Plasma behaldarhandlingar Comment[pt]=Acções do Contentor do Plasma Comment[pt_BR]=Ações do contentor do Plasma Comment[ro]=AcțiuniContainer Plasma diff --git a/kcm_remotewidgets.actions b/kcm_remotewidgets.actions index 8d18349e0..fcc4285ea 100644 --- a/kcm_remotewidgets.actions +++ b/kcm_remotewidgets.actions @@ -23,6 +23,7 @@ Name[lv]=Saglabāt attālināto sīkrīku politikas Name[nb]=Lagre praksis for nettverkselementer Name[nds]=Regeln för feern Lüttprogrammen sekern Name[nl]=Beleidsregels voor widgets op afstand opslaan +Name[nn]=Lagra reglar for fjernelement Name[pa]=ਰਿਮੋਟ ਵਿਦਜੈੱਟ ਪਾਲਸੀਆਂ ਸੰਭਾਲੋ Name[pt]=Gravar as políticas dos elementos remotos Name[pt_BR]=Salvar políticas de widgets remotos @@ -61,6 +62,7 @@ Description[lv]=Liedz sistēmai saglabāt plasma attālināto sīkrīku politika Description[nb]=Hindrer at systemet lagrer praksiser for plasmaelementer på nettverket Description[nds]=Höllt dat Systeem vun't Sekern vun de Regeln för feern Plasma-Lüttprogrammen af Description[nl]=Voorkomt het opslaan door het systeem van beleidsregels voor widgets op afstand +Description[nn]=Hindrar systemet å lagra reglar for fjernelement Description[pt]=Impede que o sistema grave as políticas dos elementos remotos do Plasma Description[pt_BR]=Previne o sistema de salvar as políticas de widgets Plasma remotos Description[ro]=Previne salvarea politicilor de controale distante de către sistem From 88216206bb0f535aed8ccff111841b97ce94dad8 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Mon, 25 Jan 2010 10:37:42 +0000 Subject: [PATCH 38/60] SVN_SILENT made messages (.desktop file) svn path=/branches/KDE/4.4/kdelibs/; revision=1079966 --- kcm_remotewidgets.actions | 1 + 1 file changed, 1 insertion(+) diff --git a/kcm_remotewidgets.actions b/kcm_remotewidgets.actions index fcc4285ea..d28b7d263 100644 --- a/kcm_remotewidgets.actions +++ b/kcm_remotewidgets.actions @@ -50,6 +50,7 @@ Description[el]=Αποτρέπει το σύστημα από το να σώσε Description[en_GB]=Prevents the system from saving plasma remote widgets policies Description[es]=Impide que el sistema guarde políticas de elementos gráficos remotos Description[et]=Takistab süsteemil salvestamast Plasma välisvidinate reegleid +Description[eu]=Sistemak urruneko tramankuluen politikak gorde ditzan ekiditen du Description[fr]=Empêche le système d'enregistrer la politique des éléments distants Description[gl]=Evita que o sistema garde as políticas de plasma dos widgets remotos Description[hr]=Brani sustavu da snima pravila za plasama udaljene widgete From 635aba8ddf76ef338b993366d5b36a2cc31afc2d Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 26 Jan 2010 06:09:01 +0000 Subject: [PATCH 39/60] alter the toolbox backer layout when the items change CCBUG:224278 svn path=/branches/KDE/4.4/kdelibs/; revision=1080325 --- private/desktoptoolbox.cpp | 32 +++++++++++++++++++++++--------- private/desktoptoolbox_p.h | 2 ++ private/internaltoolbox_p.h | 2 +- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/private/desktoptoolbox.cpp b/private/desktoptoolbox.cpp index 02315dd0f..e96106177 100644 --- a/private/desktoptoolbox.cpp +++ b/private/desktoptoolbox.cpp @@ -523,9 +523,31 @@ void DesktopToolBox::showToolBox() } d->toolBacker->setZValue(zValue() + 1); - d->toolBacker->clearLayout(); d->toolBacker->setIsToolbar(isToolbar()); + adjustToolBackerGeometry(); + + d->toolBacker->setOpacity(0); + d->toolBacker->show(); + Plasma::Animation *fadeAnim = Animator::create(Animator::FadeAnimation, d->toolBacker); + fadeAnim->setTargetWidget(d->toolBacker); + fadeAnim->setProperty("startOpacity", 0); + fadeAnim->setProperty("targetOpacity", 1); + fadeAnim->start(QAbstractAnimation::DeleteWhenStopped); +} + +void DesktopToolBox::updateToolBox() +{ + adjustToolBackerGeometry(); +} + +void DesktopToolBox::adjustToolBackerGeometry() +{ + if (!d->toolBacker) { + return; + } + + d->toolBacker->clearLayout(); QMap t = tools(); QMapIterator it(t); while (it.hasNext()) { @@ -621,14 +643,6 @@ void DesktopToolBox::showToolBox() d->toolBacker->setPos(x, mapFromParent(QPointF(0, parentSize.height() - 5 - backerRect.height())).y()); } } - - d->toolBacker->setOpacity(0); - d->toolBacker->show(); - Plasma::Animation *fadeAnim = Animator::create(Animator::FadeAnimation, d->toolBacker); - fadeAnim->setTargetWidget(d->toolBacker); - fadeAnim->setProperty("startOpacity", 0); - fadeAnim->setProperty("targetOpacity", 1); - fadeAnim->start(QAbstractAnimation::DeleteWhenStopped); } void DesktopToolBox::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) diff --git a/private/desktoptoolbox_p.h b/private/desktoptoolbox_p.h index 8f0d83c3c..5b2b46a4a 100644 --- a/private/desktoptoolbox_p.h +++ b/private/desktoptoolbox_p.h @@ -60,6 +60,7 @@ public: public Q_SLOTS: void toolTipAboutToShow(); void toolTipHidden(); + void updateToolBox(); protected: void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); @@ -76,6 +77,7 @@ protected Q_SLOTS: */ void toggle(); private: + void adjustToolBackerGeometry(); DesktopToolBoxPrivate *d; }; diff --git a/private/internaltoolbox_p.h b/private/internaltoolbox_p.h index 5cde6882c..e5d47e9db 100644 --- a/private/internaltoolbox_p.h +++ b/private/internaltoolbox_p.h @@ -99,7 +99,7 @@ public Q_SLOTS: /** * re-show the toolbox, in case any tools have changed */ - void updateToolBox(); + virtual void updateToolBox(); protected: Containment *containment(); From a9c0b30a27df863c1ac35e401e653786c97c0fc8 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Tue, 26 Jan 2010 11:07:16 +0000 Subject: [PATCH 40/60] SVN_SILENT made messages (.desktop file) svn path=/branches/KDE/4.4/kdelibs/; revision=1080494 --- data/servicetypes/plasma-containmentactions.desktop | 1 + kcm_remotewidgets.actions | 1 + 2 files changed, 2 insertions(+) diff --git a/data/servicetypes/plasma-containmentactions.desktop b/data/servicetypes/plasma-containmentactions.desktop index 428bd16d1..e02752912 100644 --- a/data/servicetypes/plasma-containmentactions.desktop +++ b/data/servicetypes/plasma-containmentactions.desktop @@ -26,6 +26,7 @@ Comment[nb]=Plasma ContainmentActions Comment[nds]=Plasma-Gelaatsakschonen Comment[nl]=Plasma Containeracties Comment[nn]=Plasma behaldarhandlingar +Comment[pa]=ਪਲਾਜ਼ਮਾ ਕਨਟੇਨਮੈਂਟਐਕਸ਼ਨ Comment[pt]=Acções do Contentor do Plasma Comment[pt_BR]=Ações do contentor do Plasma Comment[ro]=AcțiuniContainer Plasma diff --git a/kcm_remotewidgets.actions b/kcm_remotewidgets.actions index d28b7d263..6b0910bab 100644 --- a/kcm_remotewidgets.actions +++ b/kcm_remotewidgets.actions @@ -64,6 +64,7 @@ Description[nb]=Hindrer at systemet lagrer praksiser for plasmaelementer på net Description[nds]=Höllt dat Systeem vun't Sekern vun de Regeln för feern Plasma-Lüttprogrammen af Description[nl]=Voorkomt het opslaan door het systeem van beleidsregels voor widgets op afstand Description[nn]=Hindrar systemet å lagra reglar for fjernelement +Description[pa]=ਸਿਸਟਮ ਨੂੰ ਪਲਾਜ਼ਮਾ ਰਿਮੋਟ ਵਿਦਜੈੱਟ ਪਾਲਸੀ ਸੰਭਾਲਣ ਤੋਂ ਰੋਕਦਾ ਹੈ Description[pt]=Impede que o sistema grave as políticas dos elementos remotos do Plasma Description[pt_BR]=Previne o sistema de salvar as políticas de widgets Plasma remotos Description[ro]=Previne salvarea politicilor de controale distante de către sistem From 91794a6bf72846210bc3f7486bd42122ec1ffd96 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 26 Jan 2010 21:21:31 +0000 Subject: [PATCH 41/60] need to call the parent method as well svn path=/branches/KDE/4.4/kdelibs/; revision=1080745 --- private/desktoptoolbox.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/private/desktoptoolbox.cpp b/private/desktoptoolbox.cpp index e96106177..2bad27322 100644 --- a/private/desktoptoolbox.cpp +++ b/private/desktoptoolbox.cpp @@ -538,6 +538,7 @@ void DesktopToolBox::showToolBox() void DesktopToolBox::updateToolBox() { + InternalToolBox::updateToolBox(); adjustToolBackerGeometry(); } From 0fa82befaf49b69512a1511228324cff677820f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Wed, 27 Jan 2010 16:32:47 +0000 Subject: [PATCH 42/60] Backport r1081054: Don't crash in PaintUtils::transition() if the pixmap doesn't have a paint engine. This is sometimes the case when called from AbstractTaskItem::drawTask(). svn path=/branches/KDE/4.4/kdelibs/; revision=1081056 --- paintutils.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/paintutils.cpp b/paintutils.cpp index 089418a4b..dd47336ea 100644 --- a/paintutils.cpp +++ b/paintutils.cpp @@ -178,8 +178,10 @@ QPixmap transition(const QPixmap &from, const QPixmap &to, qreal amount) // If the native paint engine supports Porter/Duff compositing and CompositionMode_Plus - if (from.paintEngine()->hasFeature(QPaintEngine::PorterDuff) && - from.paintEngine()->hasFeature(QPaintEngine::BlendModes)) { + QPaintEngine *paintEngine = from.paintEngine(); + if (paintEngine && + paintEngine->hasFeature(QPaintEngine::PorterDuff) && + paintEngine->hasFeature(QPaintEngine::BlendModes)) { QPixmap under = from; QPixmap over = to; @@ -200,7 +202,7 @@ QPixmap transition(const QPixmap &from, const QPixmap &to, qreal amount) } #if defined(Q_WS_X11) && defined(HAVE_XRENDER) // We have Xrender support - else if (from.paintEngine()->hasFeature(QPaintEngine::PorterDuff)) { + else if (paintEngine && paintEngine->hasFeature(QPaintEngine::PorterDuff)) { // QX11PaintEngine doesn't implement CompositionMode_Plus in Qt 4.3, // which we need to be able to do a transition from one pixmap to // another. From f77cf8c3e0a6fa774e739cfde7e56eb6d01bcac1 Mon Sep 17 00:00:00 2001 From: Chani Armitage Date: Wed, 27 Jan 2010 20:35:52 +0000 Subject: [PATCH 43/60] backport of r1081144: make "run associated application" obey security svn path=/branches/KDE/4.4/kdelibs/; revision=1081145 --- applet.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/applet.cpp b/applet.cpp index f7acd0349..a663f9166 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1970,6 +1970,7 @@ void Applet::setAssociatedApplication(const QString &string) QAction *runAssociatedApplication = d->actions->action("run associated application"); if (runAssociatedApplication) { bool valid = AssociatedApplicationManager::self()->appletHasValidAssociatedApplication(this); + valid = valid && hasAuthorization("LaunchApp"); //obey security! runAssociatedApplication->setVisible(valid); runAssociatedApplication->setEnabled(valid); } @@ -1982,6 +1983,7 @@ void Applet::setAssociatedApplicationUrls(const KUrl::List &urls) QAction *runAssociatedApplication = d->actions->action("run associated application"); if (runAssociatedApplication) { bool valid = AssociatedApplicationManager::self()->appletHasValidAssociatedApplication(this); + valid = valid && hasAuthorization("LaunchApp"); //obey security! runAssociatedApplication->setVisible(valid); runAssociatedApplication->setEnabled(valid); } @@ -1999,7 +2001,9 @@ KUrl::List Applet::associatedApplicationUrls() const void Applet::runAssociatedApplication() { - AssociatedApplicationManager::self()->run(this); + if (hasAuthorization("LaunchApp")) { + AssociatedApplicationManager::self()->run(this); + } } bool Applet::hasValidAssociatedApplication() const From 9aed7f55a02632c2222a9f9deef11a9459705cdc Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 27 Jan 2010 22:05:46 +0000 Subject: [PATCH 44/60] revert the popup menus detachment out of QGraphicsProxyWidget, but only in 4.4 branch. this is unfortunate but triggers qt bug 7254 http://bugreports.qt.nokia.com/browse/QTBUG-7254 hope will be possible to revert this commit even in 4.4 lifetime svn path=/branches/KDE/4.4/kdelibs/; revision=1081199 --- widgets/label.cpp | 6 +++++- widgets/scrollbar.cpp | 6 +++++- widgets/textbrowser.cpp | 6 +++++- widgets/textedit.cpp | 7 +++++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/widgets/label.cpp b/widgets/label.cpp index c6e280657..10d93fc40 100644 --- a/widgets/label.cpp +++ b/widgets/label.cpp @@ -114,7 +114,8 @@ Label::Label(QGraphicsWidget *parent) d(new LabelPrivate(this)) { QLabel *native = new QLabel; - native->setWindowFlags(native->windowFlags()|Qt::BypassGraphicsProxyWidget); + //disabled for now: triggers Qt bug 7254 + //native->setWindowFlags(native->windowFlags()|Qt::BypassGraphicsProxyWidget); d->textSelectable = false; connect(native, SIGNAL(linkActivated(QString)), this, SIGNAL(linkActivated(QString))); connect(native, SIGNAL(linkHovered(QString)), this, SIGNAL(linkHovered(QString))); @@ -238,9 +239,12 @@ void Label::dataUpdated(const QString &sourceName, const Plasma::DataEngine::Dat void Label::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) { + /*disabled for now: triggers Qt bug 7254 QContextMenuEvent contextMenuEvent(QContextMenuEvent::Reason(event->reason()), event->pos().toPoint(), event->screenPos(), event->modifiers()); QApplication::sendEvent(nativeWidget(), &contextMenuEvent); + */ + QGraphicsProxyWidget::contextMenuEvent(event); } void Label::resizeEvent(QGraphicsSceneResizeEvent *event) diff --git a/widgets/scrollbar.cpp b/widgets/scrollbar.cpp index 44fb824c1..1cfd63129 100644 --- a/widgets/scrollbar.cpp +++ b/widgets/scrollbar.cpp @@ -40,7 +40,8 @@ ScrollBar::ScrollBar(QGraphicsWidget *parent) d(new ScrollBarPrivate) { QScrollBar *scrollbar = new QScrollBar(); - scrollbar->setWindowFlags(scrollbar->windowFlags()|Qt::BypassGraphicsProxyWidget); + //disabled for now: triggers Qt bug 7254 + //scrollbar->setWindowFlags(scrollbar->windowFlags()|Qt::BypassGraphicsProxyWidget); scrollbar->setAttribute(Qt::WA_NoSystemBackground); setWidget(scrollbar); d->style = Plasma::Style::sharedStyle(); @@ -130,9 +131,12 @@ void ScrollBar::setOrientation(Qt::Orientation orientation) void ScrollBar::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) { + /*disabled for now: triggers Qt bug 7254 QContextMenuEvent contextMenuEvent(QContextMenuEvent::Reason(event->reason()), event->pos().toPoint(), event->screenPos(), event->modifiers()); QApplication::sendEvent(nativeWidget(), &contextMenuEvent); + */ + QGraphicsProxyWidget::contextMenuEvent(event); } } diff --git a/widgets/textbrowser.cpp b/widgets/textbrowser.cpp index b49822a02..286bc2a1a 100644 --- a/widgets/textbrowser.cpp +++ b/widgets/textbrowser.cpp @@ -102,7 +102,8 @@ TextBrowser::TextBrowser(QGraphicsWidget *parent) d(new TextBrowserPrivate(this)) { KTextBrowser *native = new KTextBrowser; - native->setWindowFlags(native->windowFlags()|Qt::BypassGraphicsProxyWidget); + //disabled for now: triggers Qt bug 7254 + //native->setWindowFlags(native->windowFlags()|Qt::BypassGraphicsProxyWidget); connect(native, SIGNAL(textChanged()), this, SIGNAL(textChanged())); connect(native, SIGNAL(textChanged()), this, SLOT(setFixedHeight())); setWidget(native); @@ -180,9 +181,12 @@ void TextBrowser::dataUpdated(const QString &sourceName, const Plasma::DataEngin void TextBrowser::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) { + /*disabled for now: triggers Qt bug 7254 QMenu *popup = nativeWidget()->createStandardContextMenu(event->screenPos()); popup->exec(event->screenPos()); delete popup; + */ + QGraphicsProxyWidget::contextMenuEvent(event); } void TextBrowser::resizeEvent(QGraphicsSceneResizeEvent *event) diff --git a/widgets/textedit.cpp b/widgets/textedit.cpp index aefeb46cf..bb132d1b9 100644 --- a/widgets/textedit.cpp +++ b/widgets/textedit.cpp @@ -124,7 +124,8 @@ void TextEdit::setNativeWidget(KTextEdit *nativeWidget) widget()->deleteLater(); } - nativeWidget->setWindowFlags(nativeWidget->windowFlags()|Qt::BypassGraphicsProxyWidget); + //disabled for now: triggers Qt bug 7254 + //nativeWidget->setWindowFlags(nativeWidget->windowFlags()|Qt::BypassGraphicsProxyWidget); connect(nativeWidget, SIGNAL(textChanged()), this, SIGNAL(textChanged())); @@ -164,9 +165,11 @@ void TextEdit::dataUpdated(const QString &sourceName, const Plasma::DataEngine:: void TextEdit::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) { + /*disabled for now: triggers Qt bug 7254 QMenu *popup = nativeWidget()->mousePopupMenu(); popup->exec(event->screenPos()); - delete popup; + delete popup;*/ + QGraphicsProxyWidget::contextMenuEvent(event); } void TextEdit::resizeEvent(QGraphicsSceneResizeEvent *event) From 2986feb95146d9d39c57a159811f72f883b626d5 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Fri, 29 Jan 2010 10:12:11 +0000 Subject: [PATCH 45/60] SVN_SILENT made messages (.desktop file) svn path=/branches/KDE/4.4/kdelibs/; revision=1081854 --- data/servicetypes/plasma-animator.desktop | 2 +- data/servicetypes/plasma-applet-extenderapplet.desktop | 1 + data/servicetypes/plasma-applet-popupapplet.desktop | 1 + data/servicetypes/plasma-applet.desktop | 2 +- data/servicetypes/plasma-containment.desktop | 2 +- data/servicetypes/plasma-containmentactions.desktop | 1 + data/servicetypes/plasma-dataengine.desktop | 2 +- data/servicetypes/plasma-packagestructure.desktop | 2 +- data/servicetypes/plasma-runner.desktop | 2 +- data/servicetypes/plasma-scriptengine.desktop | 2 +- data/servicetypes/plasma-wallpaper.desktop | 2 +- kcm_remotewidgets.actions | 2 ++ tests/packagemetadatatest.desktop | 4 ++-- tests/testengine/plasma-dataengine-testengine.desktop | 2 +- 14 files changed, 16 insertions(+), 11 deletions(-) diff --git a/data/servicetypes/plasma-animator.desktop b/data/servicetypes/plasma-animator.desktop index 417edc838..bd850758e 100644 --- a/data/servicetypes/plasma-animator.desktop +++ b/data/servicetypes/plasma-animator.desktop @@ -57,7 +57,7 @@ Comment[ro]=Motor de animație Plasma Comment[ru]=Движок анимации для Plasma Comment[se]=Plasma-animerenmohtor Comment[si]=Plasma සජිවීකරණ එන්ජිම -Comment[sk]=Engine animácii plasmy +Comment[sk]=Animačný nástroj Plasma Comment[sl]=Animacijski pogon za Plasmo Comment[sr]=Плазма мотор анимација Comment[sr@ijekavian]=Плазма мотор анимација diff --git a/data/servicetypes/plasma-applet-extenderapplet.desktop b/data/servicetypes/plasma-applet-extenderapplet.desktop index 609491dcf..ad2537678 100644 --- a/data/servicetypes/plasma-applet-extenderapplet.desktop +++ b/data/servicetypes/plasma-applet-extenderapplet.desktop @@ -46,6 +46,7 @@ Name[pt_BR]=Coleção Name[ro]=Colecție Name[ru]=Коллекция Name[se]=Čoahkádus +Name[sk]=Kolekcia Name[sl]=Zbirka Name[sr]=збирка Name[sr@ijekavian]=збирка diff --git a/data/servicetypes/plasma-applet-popupapplet.desktop b/data/servicetypes/plasma-applet-popupapplet.desktop index fadc1724d..5d0a52b83 100644 --- a/data/servicetypes/plasma-applet-popupapplet.desktop +++ b/data/servicetypes/plasma-applet-popupapplet.desktop @@ -42,6 +42,7 @@ Comment[pt]='Applet' de programação do Plasma Comment[pt_BR]=Miniaplicativo de script do Plasma Comment[ro]=Miniaplicație Plasma de indicii ale scripturilor Comment[ru]=Аплет программируемого контекстного окна Plasma +Comment[sk]=Skriptovací vyskakujúci Plasma aplet Comment[sl]=Plasma skriptni pojavni programček Comment[sr]=Плазма скриптовани искачући аплет Comment[sr@ijekavian]=Плазма скриптовани искачући аплет diff --git a/data/servicetypes/plasma-applet.desktop b/data/servicetypes/plasma-applet.desktop index ced387042..eca0cb8db 100644 --- a/data/servicetypes/plasma-applet.desktop +++ b/data/servicetypes/plasma-applet.desktop @@ -58,7 +58,7 @@ Comment[ro]=Miniaplicație Plasma Comment[ru]=Виджет Plasma Comment[se]=Plasma-prográmmaš Comment[si]=Plasma යෙදුම්පත -Comment[sk]=Plasma applet +Comment[sk]=Plasma aplet Comment[sl]=Plasma programček Comment[sr]=Плазма аплет Comment[sr@ijekavian]=Плазма аплет diff --git a/data/servicetypes/plasma-containment.desktop b/data/servicetypes/plasma-containment.desktop index f10317a51..98f93eb9e 100644 --- a/data/servicetypes/plasma-containment.desktop +++ b/data/servicetypes/plasma-containment.desktop @@ -55,7 +55,7 @@ Comment[ro]=Container de miniaplicații Plasma și desenator de fundal Comment[ru]=Контейнер и модуль отрисовки виджета Plasma Comment[se]=Plasma-prográmmašlihtti ja -duogášmálejeaddji Comment[si]=Plasma යෙදුම්පත් බහලුම සහ පසුබීම් -Comment[sk]=Plasma applet kontajner a popisovať na pozadí +Comment[sk]=Kontajner apletu a vykresľovanie pozadia Plasma Comment[sl]=Vsebnik programčkov in izrisovalnik ozadja za Plasmo Comment[sr]=Садржалац плазма аплетâ и исцртавач позадине Comment[sr@ijekavian]=Садржалац плазма аплетâ и исцртавач позадине diff --git a/data/servicetypes/plasma-containmentactions.desktop b/data/servicetypes/plasma-containmentactions.desktop index e02752912..b55c87bb4 100644 --- a/data/servicetypes/plasma-containmentactions.desktop +++ b/data/servicetypes/plasma-containmentactions.desktop @@ -31,6 +31,7 @@ Comment[pt]=Acções do Contentor do Plasma Comment[pt_BR]=Ações do contentor do Plasma Comment[ro]=AcțiuniContainer Plasma Comment[ru]=Действия для контейнеров Plasma +Comment[sk]=Akcie Plasma Comment[sr]=Плазма радње садржалаца Comment[sr@ijekavian]=Плазма радње садржалаца Comment[sr@ijekavianlatin]=Plasma radnje sadržalaca diff --git a/data/servicetypes/plasma-dataengine.desktop b/data/servicetypes/plasma-dataengine.desktop index b21f55fbf..a6985d5fb 100644 --- a/data/servicetypes/plasma-dataengine.desktop +++ b/data/servicetypes/plasma-dataengine.desktop @@ -57,7 +57,7 @@ Comment[ro]=Motor de date Plasma Comment[ru]=Источник данных Plasma Comment[se]=Plasma-dáhtamohtor Comment[si]=Plasma දත්ත එංජිම -Comment[sk]=Plasma Data Engine +Comment[sk]=Dátový nástroj Plasma Comment[sl]=Podatkovni pogon za Plasmo Comment[sr]=Плазма датомотор Comment[sr@ijekavian]=Плазма датомотор diff --git a/data/servicetypes/plasma-packagestructure.desktop b/data/servicetypes/plasma-packagestructure.desktop index c48196a35..2ae6eb63b 100644 --- a/data/servicetypes/plasma-packagestructure.desktop +++ b/data/servicetypes/plasma-packagestructure.desktop @@ -52,7 +52,7 @@ Comment[pt_BR]=Definição de estrutura de pacote do Plasma Comment[ro]=Definiție de structură a pachetului Plasma Comment[ru]=Определение структуры пакета Plasma Comment[se]=Plasma-páhkkaráhkadusdefinišuvdna -Comment[sk]=Balík definícii štruktúry plasmy +Comment[sk]=Definícia štruktúry Plasma balíčkov Comment[sl]=Definicija strukture paketa za Plasmo Comment[sr]=Дефиниција структуре плазма пакета Comment[sr@ijekavian]=Дефиниција структуре плазма пакета diff --git a/data/servicetypes/plasma-runner.desktop b/data/servicetypes/plasma-runner.desktop index c87abde14..4977f80a5 100644 --- a/data/servicetypes/plasma-runner.desktop +++ b/data/servicetypes/plasma-runner.desktop @@ -58,7 +58,7 @@ Comment[ro]=Modul KRunner Comment[ru]=Расширение KRunner Comment[se]=KRunner-lassemodula Comment[si]=KRunner ප්ලගීනය -Comment[sk]=KRunner rozšírenie +Comment[sk]=KRunner modul Comment[sl]=Vstavek za KRunner Comment[sr]=Прикључак за К‑извођач Comment[sr@ijekavian]=Прикључак за К‑извођач diff --git a/data/servicetypes/plasma-scriptengine.desktop b/data/servicetypes/plasma-scriptengine.desktop index 3c070b707..bda289051 100644 --- a/data/servicetypes/plasma-scriptengine.desktop +++ b/data/servicetypes/plasma-scriptengine.desktop @@ -55,7 +55,7 @@ Comment[ro]=Extensie de limbaj pentru scripturi Plasma Comment[ru]=Поддержка скриптовых языков для Plasma Comment[se]=Skriptagiellaviiddádus Plasmai Comment[si]=Plasma සඳහා ස්කටිප්ට භාෂා දිගුව -Comment[sk]=Rozšírenie skryptovacieho jazyku pre Plasmu +Comment[sk]=Rozšírenie pre skriptovacie jazyky Plasma Comment[sl]=Razširitev s skriptnim jezikom za Plasmo Comment[sr]=Проширење Плазме за скриптне језике Comment[sr@ijekavian]=Проширење Плазме за скриптне језике diff --git a/data/servicetypes/plasma-wallpaper.desktop b/data/servicetypes/plasma-wallpaper.desktop index 58f88c1c1..5740c3611 100644 --- a/data/servicetypes/plasma-wallpaper.desktop +++ b/data/servicetypes/plasma-wallpaper.desktop @@ -56,7 +56,7 @@ Comment[ro]=Fundal Plasma Comment[ru]=Обои Plasma Comment[se]=Plasma-duogášgovva Comment[si]=Plasma පසුබිම්රූප -Comment[sk]=Plasma Pozadie +Comment[sk]=Tapeta Plasma Comment[sl]=Tapeta za Plasmo Comment[sr]=Плазма тапет Comment[sr@ijekavian]=Плазма тапет diff --git a/kcm_remotewidgets.actions b/kcm_remotewidgets.actions index 6b0910bab..64370926c 100644 --- a/kcm_remotewidgets.actions +++ b/kcm_remotewidgets.actions @@ -28,6 +28,7 @@ Name[pa]=ਰਿਮੋਟ ਵਿਦਜੈੱਟ ਪਾਲਸੀਆਂ ਸੰਭ Name[pt]=Gravar as políticas dos elementos remotos Name[pt_BR]=Salvar políticas de widgets remotos Name[ro]=Salvează politici de controale distante +Name[sk]=Uložiť politiky pre vzdialené widgety Name[sr]=Сачувај смернице удаљених виџета Name[sr@ijekavian]=Сачувај смернице удаљених виџета Name[sr@ijekavianlatin]=Sačuvaj smernice udaljenih vidžeta @@ -68,6 +69,7 @@ Description[pa]=ਸਿਸਟਮ ਨੂੰ ਪਲਾਜ਼ਮਾ ਰਿਮੋਟ Description[pt]=Impede que o sistema grave as políticas dos elementos remotos do Plasma Description[pt_BR]=Previne o sistema de salvar as políticas de widgets Plasma remotos Description[ro]=Previne salvarea politicilor de controale distante de către sistem +Description[sk]=Zabraňuje systému uloženie politík pre vzdialené widgety Description[sr]=Спречава систем да сачува смерница удаљених плазма виџета Description[sr@ijekavian]=Спрјечава систем да сачува смјерница удаљених плазма виџета Description[sr@ijekavianlatin]=Sprječava sistem da sačuva smjernica udaljenih plasma vidžeta diff --git a/tests/packagemetadatatest.desktop b/tests/packagemetadatatest.desktop index 50361ea0e..8f3f6f2bc 100644 --- a/tests/packagemetadatatest.desktop +++ b/tests/packagemetadatatest.desktop @@ -49,7 +49,7 @@ Name[pt_BR]=Arquivo de teste dos metadados do pacote Name[ro]=Fișier de testat metadatele pachetelor Name[ru]=Тестовый файл метаданных пакета Name[se]=Páhkametedáhtaid geahččalanfiila -Name[sk]=Balík metadát testovacieho súboru +Name[sk]=Testovací súbor metadát balíčku Name[sl]=Datoteka za test metapodatkov paketa Name[sr]=Пробни фајл метаподатака пакета Name[sr@ijekavian]=Пробни фајл метаподатака пакета @@ -113,7 +113,7 @@ Comment[pt_BR]=Um arquivo desktop de testes para a classe PackageMetaData. Comment[ro]=Un fișier de probă pentru a verifica clasa PackageMetadata. Comment[ru]=Тестовый файл .desktop для проверки класса PackageMetaData. Comment[se]=Geahččalan desktop-fiilla mainna geahččala PackageMeta-luohká. -Comment[sk]=Testovací súbor na ploche na testovanie PackageMetaData triedy. +Comment[sk]=Testovací súbor plochy na testovanie triedy PackageMetaData. Comment[sl]=Namizna datoteka za test razreda PackageMetaData. Comment[sr]=Пробни .десктоп фајл за класу PackageMetaData. Comment[sr@ijekavian]=Пробни .десктоп фајл за класу PackageMetaData. diff --git a/tests/testengine/plasma-dataengine-testengine.desktop b/tests/testengine/plasma-dataengine-testengine.desktop index bf6cab91d..fc8ee3f84 100644 --- a/tests/testengine/plasma-dataengine-testengine.desktop +++ b/tests/testengine/plasma-dataengine-testengine.desktop @@ -52,7 +52,7 @@ Name[ro]=Motor de date pentru teste Name[ru]=Тестовый источник данных Name[se]=Geahččalandáhtamohtor Name[si]=පරීක්‍ෂණ දත්ත එන්ජිම -Name[sk]=Engine testovacích dát +Name[sk]=Testovací dátový nástroj Name[sl]=Preizkusni pogon s podatki Name[sr]=пробни датомотор података Name[sr@ijekavian]=пробни датомотор података From c85fbed75243ce163a36b13604f18873ec82234a Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Fri, 29 Jan 2010 21:00:57 +0000 Subject: [PATCH 46/60] Fix segfault at plasma_applet_animation_example from kdeexample Patch-by: Andre L. V. Loureiro svn path=/branches/KDE/4.4/kdelibs/; revision=1082153 --- animations/rotationstacked.cpp | 37 ++++++++++++++++++++-------------- animations/rotationstacked_p.h | 5 ++--- animations/stackedlayout.cpp | 2 +- animations/stackedlayout.h | 5 ++++- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/animations/rotationstacked.cpp b/animations/rotationstacked.cpp index 1c2acc168..918c0724e 100644 --- a/animations/rotationstacked.cpp +++ b/animations/rotationstacked.cpp @@ -32,12 +32,12 @@ RotationStackedAnimation::RotationStackedAnimation(QObject *parent) { m_backRotation = new QGraphicsRotation(this); m_frontRotation = new QGraphicsRotation(this); - m_sLayout = new StackedLayout; + m_wLayout = new StackedLayout; } RotationStackedAnimation::~RotationStackedAnimation() { - delete m_sLayout; + delete m_wLayout.data(); } void RotationStackedAnimation::setMovementDirection(const qint8 &direction) @@ -69,15 +69,17 @@ void RotationStackedAnimation::setBackWidget(QGraphicsWidget *backWidget) { m_backWidget = backWidget; - if(targetWidget()) { - m_sLayout->addWidget(targetWidget()); - m_sLayout->addWidget(m_backWidget.data()); + StackedLayout *layout = m_wLayout.data(); + + if(targetWidget() && backWidget && layout) { + layout->addWidget(targetWidget()); + layout->addWidget(backWidget); } } QGraphicsLayoutItem *RotationStackedAnimation::layout() { - return m_sLayout; + return m_wLayout.data(); } void RotationStackedAnimation::updateState( @@ -141,19 +143,24 @@ void RotationStackedAnimation::updateState( void RotationStackedAnimation::updateCurrentTime(int currentTime) { -QGraphicsWidget *w = targetWidget(); -if(w) { - qreal delta; - if (currentTime <= duration()/2) { - delta = Animation::easingCurve().valueForProgress( - (currentTime * 2) / qreal(duration())); - m_sLayout->setCurrentWidgetIndex(0); - delta = m_frontEndAngle * delta; + StackedLayout *layout = m_wLayout.data(); + if (!layout) { + return; + } + + QGraphicsWidget *w = targetWidget(); + if (w) { + qreal delta; + if (currentTime <= duration()/2) { + delta = Animation::easingCurve().valueForProgress( + (currentTime * 2) / qreal(duration())); + layout->setCurrentWidgetIndex(0); + delta = m_frontEndAngle * delta; m_frontRotation->setAngle(delta); } else { delta = Animation::easingCurve().valueForProgress( (currentTime/2) / qreal(duration())); - m_sLayout->setCurrentWidgetIndex(1); + layout->setCurrentWidgetIndex(1); delta = m_backEndAngle * delta; m_backRotation->setAngle(delta); } diff --git a/animations/rotationstacked_p.h b/animations/rotationstacked_p.h index 61466597d..1bc70b076 100644 --- a/animations/rotationstacked_p.h +++ b/animations/rotationstacked_p.h @@ -115,13 +115,12 @@ private: int m_backEndAngle; /** Object the animation(s) should act upon. */ QWeakPointer m_backWidget; + /** Layout where widget would be added */ + QWeakPointer m_wLayout; /** Back Widget Rotation transform object */ QGraphicsRotation *m_backRotation; /** Front Widget Rotation transform object */ QGraphicsRotation *m_frontRotation; - /** rotation stacked layout where the widget would be added */ - StackedLayout *m_sLayout; - }; } // Plasma diff --git a/animations/stackedlayout.cpp b/animations/stackedlayout.cpp index 2f3a0bd0c..faf26f860 100644 --- a/animations/stackedlayout.cpp +++ b/animations/stackedlayout.cpp @@ -21,7 +21,7 @@ #include StackedLayout::StackedLayout(QGraphicsLayoutItem *parent) - : QGraphicsLayout(parent), m_currentWidgetIndex(-1) + : QObject(0), m_currentWidgetIndex(-1), QGraphicsLayout(parent) { } diff --git a/animations/stackedlayout.h b/animations/stackedlayout.h index 01f156cf9..9a0d534f8 100644 --- a/animations/stackedlayout.h +++ b/animations/stackedlayout.h @@ -20,8 +20,11 @@ #include #include +#include -class StackedLayout : public QGraphicsLayout { +class StackedLayout : public QObject, public QGraphicsLayout +{ +Q_OBJECT public: explicit StackedLayout(QGraphicsLayoutItem *parent = 0); ~StackedLayout(); From 502a2ad9d3200d8cadd0aca51c82929f993e25e0 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 29 Jan 2010 21:24:25 +0000 Subject: [PATCH 47/60] isBusy is the wrong name for the property; should be just 'busy', but it's too late at this point to remove isBusy, so just duplicate it. i'd rather have a consistent API and get people using that so that there is less heartache when we get rid of isBusy whenever we break BC svn path=/branches/KDE/4.4/kdelibs/; revision=1082163 --- applet.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applet.h b/applet.h index feaa1f6ca..218282a4b 100644 --- a/applet.h +++ b/applet.h @@ -82,7 +82,8 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget Q_PROPERTY(QString category READ category) Q_PROPERTY(ImmutabilityType immutability READ immutability WRITE setImmutability) Q_PROPERTY(bool hasFailedToLaunch READ hasFailedToLaunch WRITE setFailedToLaunch) - Q_PROPERTY(bool isBusy READ isBusy WRITE setBusy) + Q_PROPERTY(bool isBusy READ isBusy WRITE setBusy) //KDE5: remove + Q_PROPERTY(bool busy READ isBusy WRITE setBusy) Q_PROPERTY(bool configurationRequired READ configurationRequired WRITE setConfigurationRequired) Q_PROPERTY(QRectF geometry READ geometry WRITE setGeometry) Q_PROPERTY(bool shouldConserveResources READ shouldConserveResources) From 55853f7cb35fe6107d48665c332fe9f87ec7bb55 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Sun, 31 Jan 2010 10:55:05 +0000 Subject: [PATCH 48/60] SVN_SILENT made messages (.desktop file) svn path=/branches/KDE/4.4/kdelibs/; revision=1082806 --- data/servicetypes/plasma-containmentactions.desktop | 1 + kcm_remotewidgets.actions | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/data/servicetypes/plasma-containmentactions.desktop b/data/servicetypes/plasma-containmentactions.desktop index b55c87bb4..8f3c9788c 100644 --- a/data/servicetypes/plasma-containmentactions.desktop +++ b/data/servicetypes/plasma-containmentactions.desktop @@ -20,6 +20,7 @@ Comment[hr]=Plasma ContainmentActions Comment[hu]=Plasma tartóműveletek Comment[id]=Plasma Aksi Berisi Comment[is]=Plasma ContainmentActions +Comment[it]=Contenitore azioni di Plasma Comment[km]=ប្លាស្មា ContainmentActions Comment[ko]=Plasma ContainmentActions Comment[nb]=Plasma ContainmentActions diff --git a/kcm_remotewidgets.actions b/kcm_remotewidgets.actions index 64370926c..705e49b7e 100644 --- a/kcm_remotewidgets.actions +++ b/kcm_remotewidgets.actions @@ -17,6 +17,7 @@ Name[hr]=Snimi pravila za udaljene widgete Name[hu]=A távoli Plasma-elemek használati módjának mentése Name[id]=Simpan kebijakan widget jarak jauh Name[is]=Vistar meðhöndlunarstefnu fyrir fjarlægar græjur +Name[it]=Salva regole elementi remoti Name[km]=រក្សា​ទុក​គោលនយោបាយ​ធាតុក្រាហ្វិក​ពី​ចម្ងាយ Name[ko]=원격 위젯 정책 저장 Name[lv]=Saglabāt attālināto sīkrīku politikas @@ -25,6 +26,7 @@ Name[nds]=Regeln för feern Lüttprogrammen sekern Name[nl]=Beleidsregels voor widgets op afstand opslaan Name[nn]=Lagra reglar for fjernelement Name[pa]=ਰਿਮੋਟ ਵਿਦਜੈੱਟ ਪਾਲਸੀਆਂ ਸੰਭਾਲੋ +Name[pl]=Zapisz zdalne polityki elementów interfejsu Name[pt]=Gravar as políticas dos elementos remotos Name[pt_BR]=Salvar políticas de widgets remotos Name[ro]=Salvează politici de controale distante @@ -58,6 +60,7 @@ Description[hr]=Brani sustavu da snima pravila za plasama udaljene widgete Description[hu]=Meggátolja, hogy a gép elmentse a távoli Plasma-elemek házirendjét Description[id]=Cegah sistem dari menyimpan kebijakan widget jarak jauh plasma Description[is]=Kemur í veg fyrir að kerfið visti meðhöndlunarstefnu fyrir fjarlægar græjur +Description[it]=Impedisce al sistema di salvare le regole degli elementi plasma remoti Description[km]=ការ​ពារ​​ប្រព័ន្ធ​​កុំ​ឲ្យ​រក្សាទុក​គោលការណ៍​ធាតុ​ក្រាហ្វិក​ប្លាស្មា​ពីចម្ងាយ Description[ko]=Plasma 원격 위젯 정책을 저장하지 못하도록 합니다 Description[lv]=Liedz sistēmai saglabāt plasma attālināto sīkrīku politikas @@ -66,6 +69,7 @@ Description[nds]=Höllt dat Systeem vun't Sekern vun de Regeln för feern Plasma Description[nl]=Voorkomt het opslaan door het systeem van beleidsregels voor widgets op afstand Description[nn]=Hindrar systemet å lagra reglar for fjernelement Description[pa]=ਸਿਸਟਮ ਨੂੰ ਪਲਾਜ਼ਮਾ ਰਿਮੋਟ ਵਿਦਜੈੱਟ ਪਾਲਸੀ ਸੰਭਾਲਣ ਤੋਂ ਰੋਕਦਾ ਹੈ +Description[pl]=Nie pozwala systemowi na zapisanie zdalnych polityk elementów interfejsu Description[pt]=Impede que o sistema grave as políticas dos elementos remotos do Plasma Description[pt_BR]=Previne o sistema de salvar as políticas de widgets Plasma remotos Description[ro]=Previne salvarea politicilor de controale distante de către sistem From b0737279cdc7e8fa67eeb6e5951bb26f655e350d Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Sun, 31 Jan 2010 21:20:59 +0000 Subject: [PATCH 49/60] Fix a regression introduced in one of the 4.4 RCs in KDE 4.4, bug 224204 (http / ftp URLs do not open web browser in KRunner). Pretty sure I'd tested it, but not thouroughly enough it appears. I will forwardport shortly. Patch reviewed by Marco Martin. CCBUG:224204 svn path=/branches/KDE/4.4/kdelibs/; revision=1083222 --- runnercontext.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runnercontext.cpp b/runnercontext.cpp index 2bf9bad0b..2a04c8f32 100644 --- a/runnercontext.cpp +++ b/runnercontext.cpp @@ -192,10 +192,15 @@ class RunnerContextPrivate : public QSharedData } else { KUrl url(term); QString correctCasePath; + // check for a normal URL first + if (KProtocolInfo::protocolClass(url.protocol()) == ":internet" && + url.hasHost()) { + type = RunnerContext::NetworkLocation; // check if we have a local network location first, otherwise assume a path, // but if a path doesn't have any slashes is a single word or // sentence: it's too ambiguous to be sure we're in a filesystem context - if (KProtocolInfo::protocolClass(url.protocol()) == ":local" && !url.isLocalFile()) { + } else if (KProtocolInfo::protocolClass(url.protocol()) == ":local" && + !url.isLocalFile()) { type = RunnerContext::NetworkLocation; } else if ((path.indexOf('/') != -1 || path.indexOf('\\') != -1) && correctPathCase(path, correctCasePath)) { From 3f57259d7a1c17b9c9673fb7d4e0230e5eb7c071 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Sun, 31 Jan 2010 23:26:45 +0000 Subject: [PATCH 50/60] http://, man:/, file:/// and file:// all work as expected svn path=/branches/KDE/4.4/kdelibs/; revision=1083284 --- runnercontext.cpp | 71 ++++++++++++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 29 deletions(-) diff --git a/runnercontext.cpp b/runnercontext.cpp index 2a04c8f32..bb1d9f682 100644 --- a/runnercontext.cpp +++ b/runnercontext.cpp @@ -116,7 +116,7 @@ bool correctPathCase(const QString& path, QString &corrected) // path components QStringList components = QString(path).split(QDir::separator()); - if (components.size() < 2) { + if (components.size() < 1) { return false; } @@ -124,12 +124,11 @@ bool correctPathCase(const QString& path, QString &corrected) //kDebug() << "Components are" << components; - QString correctPath; - - if (components.back().isEmpty()) { + if (mustBeDir) { components.pop_back(); } + QString correctPath; const unsigned initialComponents = components.size(); for (unsigned i = 0; i < initialComponents - 1; i ++) { const QString tmp = components[0] + QDir::separator() + components[1]; @@ -174,6 +173,7 @@ class RunnerContextPrivate : public QSharedData /** * Determines type of query + && */ void determineType() { @@ -191,38 +191,51 @@ class RunnerContextPrivate : public QSharedData RunnerContext::Executable; } else { KUrl url(term); - QString correctCasePath; // check for a normal URL first - if (KProtocolInfo::protocolClass(url.protocol()) == ":internet" && - url.hasHost()) { + //kDebug() << url << KProtocolInfo::protocolClass(url.protocol()) << url.hasHost() << + // url.host() << url.isLocalFile() << path << path.indexOf('/'); + const bool hasProtocol = !url.protocol().isEmpty(); + const bool isLocalProtocol = KProtocolInfo::protocolClass(url.protocol()) == ":local"; + if (hasProtocol && + ((!isLocalProtocol && url.hasHost()) || + (isLocalProtocol && url.protocol() != "file"))) { + // we either have a network protocol with a host, so we can show matches for it + // or we have a non-file url that may be local so a host isn't required type = RunnerContext::NetworkLocation; - // check if we have a local network location first, otherwise assume a path, - // but if a path doesn't have any slashes is a single word or - // sentence: it's too ambiguous to be sure we're in a filesystem context - } else if (KProtocolInfo::protocolClass(url.protocol()) == ":local" && - !url.isLocalFile()) { - type = RunnerContext::NetworkLocation; - } else if ((path.indexOf('/') != -1 || path.indexOf('\\') != -1) && - correctPathCase(path, correctCasePath)) { - path = correctCasePath; - QFileInfo info(path); + } else if (isLocalProtocol) { + // at this point in the game, we assume we have a path, + // but if a path doesn't have any slashes + // it's too ambiguous to be sure we're in a filesystem context + path = QDir::cleanPath(url.toLocalFile()); + //kDebug( )<< "slash check" << path; + if (hasProtocol || ((path.indexOf('/') != -1 || path.indexOf('\\') != -1))) { + QString correctCasePath; + if (correctPathCase(path, correctCasePath)) { + path = correctCasePath; + QFileInfo info(path); + //kDebug( )<< "correct cas epath is" << correctCasePath << info.isSymLink() << + // info.isDir() << info.isFile(); - if (info.isSymLink()) { - path = info.canonicalFilePath(); - info = QFileInfo(path); - } - if (info.isDir()) { - type = RunnerContext::Directory; - mimeType = "inode/folder"; - } else if (info.isFile()) { - type = RunnerContext::File; - KMimeType::Ptr mimeTypePtr = KMimeType::findByPath(path); - if (mimeTypePtr) { - mimeType = mimeTypePtr->name(); + if (info.isSymLink()) { + path = info.canonicalFilePath(); + info = QFileInfo(path); + } + if (info.isDir()) { + type = RunnerContext::Directory; + mimeType = "inode/folder"; + } else if (info.isFile()) { + type = RunnerContext::File; + KMimeType::Ptr mimeTypePtr = KMimeType::findByPath(path); + if (mimeTypePtr) { + mimeType = mimeTypePtr->name(); + } + } } } } } + + //kDebug() << "term2type" << term << type; } void invalidate() From 27a524216f0ddd0962947305f000c362400fe646 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Tue, 2 Feb 2010 10:37:00 +0000 Subject: [PATCH 51/60] SVN_SILENT made messages (.desktop file) svn path=/branches/KDE/4.4/kdelibs/; revision=1084009 --- data/servicetypes/plasma-containmentactions.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/servicetypes/plasma-containmentactions.desktop b/data/servicetypes/plasma-containmentactions.desktop index 8f3c9788c..6dc79405d 100644 --- a/data/servicetypes/plasma-containmentactions.desktop +++ b/data/servicetypes/plasma-containmentactions.desktop @@ -20,7 +20,7 @@ Comment[hr]=Plasma ContainmentActions Comment[hu]=Plasma tartóműveletek Comment[id]=Plasma Aksi Berisi Comment[is]=Plasma ContainmentActions -Comment[it]=Contenitore azioni di Plasma +Comment[it]=ContainmentActions di Plasma Comment[km]=ប្លាស្មា ContainmentActions Comment[ko]=Plasma ContainmentActions Comment[nb]=Plasma ContainmentActions From 2a7ab289515ee52647020c231a1859774d2e7883 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Tue, 2 Feb 2010 14:24:21 +0000 Subject: [PATCH 52/60] Backport from trunk: Replaced combined movement direction enumerations (i.e. MoveUpRight) with OR-combinations (i.e. MoveUp|MoveLeft) plus MovementDirection and Reference enumerators are now QFlags (using Q_DECLARE_FLAGS) svn path=/branches/KDE/4.4/kdelibs/; revision=1084111 --- animations/animation.h | 32 +++++++++--------- animations/rotationstacked.cpp | 16 ++++----- animations/rotationstacked_p.h | 16 ++++----- animations/slide.cpp | 59 ++++++++++++---------------------- animations/slide_p.h | 8 ++--- 5 files changed, 56 insertions(+), 75 deletions(-) diff --git a/animations/animation.h b/animations/animation.h index 74f14468f..dae4a0d9d 100644 --- a/animations/animation.h +++ b/animations/animation.h @@ -63,28 +63,28 @@ public: /** * Animation movement reference (used by \ref RotationAnimation). */ - enum Reference{ - Center, - Up, - Down, - Left, - Right + enum ReferenceFlag { + Center = 0, + Up = 0x1, + Down = 0x2, + Left = 0x4, + Right = 0x8 }; + Q_DECLARE_FLAGS(Reference, ReferenceFlag) + /** - * The movement direction of an animation. + * Animation movement direction. */ - enum MovementDirection { - MoveUp = 0, /**< Move up */ - MoveUpRight, /**< Move up and right */ - MoveRight, /**< Move right */ - MoveDownRight, /**< Move down and right */ - MoveDown, /**< Move down */ - MoveDownLeft, /**< Move down and left */ - MoveLeft, /**< Move left */ - MoveUpLeft /**< Move up and left */ + enum MovementDirectionFlag { + MoveAny = 0, + MoveUp = 0x1, + MoveRight = 0x2, + MoveDown = 0x4, + MoveLeft = 0x8 }; + Q_DECLARE_FLAGS(MovementDirection, MovementDirectionFlag) /** * Default constructor. diff --git a/animations/rotationstacked.cpp b/animations/rotationstacked.cpp index 918c0724e..e0637f31a 100644 --- a/animations/rotationstacked.cpp +++ b/animations/rotationstacked.cpp @@ -40,22 +40,22 @@ RotationStackedAnimation::~RotationStackedAnimation() delete m_wLayout.data(); } -void RotationStackedAnimation::setMovementDirection(const qint8 &direction) +void RotationStackedAnimation::setMovementDirection(const Animation::MovementDirection &direction) { - m_animDirection = static_cast(direction); + m_animDirection = direction; } -qint8 RotationStackedAnimation::movementDirection() const +Animation::MovementDirection RotationStackedAnimation::movementDirection() const { - return static_cast(m_animDirection); + return m_animDirection; } -void RotationStackedAnimation::setReference(const qint8 &reference) +void RotationStackedAnimation::setReference(const Animation::Reference &reference) { m_reference = reference; } -qint8 RotationStackedAnimation::reference() const +Animation::Reference RotationStackedAnimation::reference() const { return m_reference; } @@ -104,11 +104,11 @@ void RotationStackedAnimation::updateState( vector.first = QVector3D(widgetFrontWidth/2, widgetFrontHeight/2, 0); vector.second = QVector3D(widgetBackWidth/2, widgetBackHeight/2, 0); - if (m_animDirection == MoveLeft || m_animDirection == MoveRight) { + if (m_animDirection.testFlag(MoveLeft) || m_animDirection.testFlag(MoveRight)) { m_frontRotation->setAxis(Qt::YAxis); m_backRotation->setAxis(Qt::YAxis); - if (m_animDirection == MoveLeft) { + if (m_animDirection.testFlag(MoveLeft)) { /* TODO: the order way */ } else { diff --git a/animations/rotationstacked_p.h b/animations/rotationstacked_p.h index 1bc70b076..962b4c49c 100644 --- a/animations/rotationstacked_p.h +++ b/animations/rotationstacked_p.h @@ -43,9 +43,9 @@ namespace Plasma { class RotationStackedAnimation : public Animation { Q_OBJECT - Q_PROPERTY(qint8 movementDirection READ movementDirection WRITE setMovementDirection) + Q_PROPERTY(MovementDirection movementDirection READ movementDirection WRITE setMovementDirection) + Q_PROPERTY(Reference reference READ reference WRITE setReference) Q_PROPERTY(QGraphicsLayoutItem* layout READ layout) - Q_PROPERTY(qint8 reference READ reference WRITE setReference) Q_PROPERTY(QGraphicsWidget* backWidget READ backWidget WRITE setBackWidget) public: @@ -57,25 +57,25 @@ public: * Set the animation direction * @arg direction animation direction */ - void setMovementDirection(const qint8 &direction); + void setMovementDirection(const Animation::MovementDirection &direction); /** * Get the animation direction */ - qint8 movementDirection() const; + Animation::MovementDirection movementDirection() const; /** * Set rotation reference (e.g. Center, Up, Down, Left, Right) can * be combined (i.e. Center|Up) * @arg reference The reference */ - void setReference(const qint8 &reference); + void setReference(const Animation::Reference &reference); /** * Rotation reference (e.g. Center, Up, Down, Left, Right) can * be combined (i.e. Center|Up) */ - qint8 reference() const; + Animation::Reference reference() const; /** * Get the layout where the widgetToAnimate and backWidget are. @@ -100,11 +100,11 @@ protected: private: /** Reference, the default is Up (see \ref Animation::Reference) */ - qint8 m_reference; + Animation::Reference m_reference; /** * Animation direction: where the animation will move. */ - MovementDirection m_animDirection; + Animation::MovementDirection m_animDirection; /** Initial rotation angle from front widget */ int m_frontStartAngle; /** End value of the rotation angle of the front widget */ diff --git a/animations/slide.cpp b/animations/slide.cpp index 000565f74..83b123678 100644 --- a/animations/slide.cpp +++ b/animations/slide.cpp @@ -48,14 +48,14 @@ SlideAnimation::SlideAnimation(QObject *parent, setEasingCurve(QEasingCurve::OutCirc); } -void SlideAnimation::setMovementDirection(const qint8 &direction) +void SlideAnimation::setMovementDirection(const Animation::MovementDirection &direction) { - m_animDirection = static_cast(direction); + m_animDirection = direction; } -qint8 SlideAnimation::movementDirection() const +Animation::MovementDirection SlideAnimation::movementDirection() const { - return static_cast(m_animDirection); + return m_animDirection; } void SlideAnimation::updateCurrentTime(int currentTime) @@ -80,47 +80,28 @@ void SlideAnimation::updateState(QAbstractAnimation::State newState, QAbstractAn qreal newY = m_startPos.y(); int actualDistance = (direction() == QAbstractAnimation::Forward?distance():-distance()); - switch (movementDirection()) { - case MoveUp: + + bool moveAnyOnly = true; + + if (m_animDirection.testFlag(MoveUp)) { newY -= actualDistance; - break; - - case MoveRight: - newX += actualDistance; - break; - - case MoveDown: + moveAnyOnly = false; + } else if (m_animDirection.testFlag(MoveDown)) { newY += actualDistance; - break; + moveAnyOnly = false; + } - case MoveLeft: - newX -= actualDistance; - break; - - case MoveUpRight: + if (m_animDirection.testFlag(MoveRight)) { newX += actualDistance; - newY -= actualDistance; - break; - - case MoveDownRight: - newX += actualDistance; - newY += actualDistance; - break; - - case MoveDownLeft: + moveAnyOnly = false; + } else if (m_animDirection.testFlag(MoveLeft)) { newX -= actualDistance; - newY += actualDistance; - break; + moveAnyOnly = false; + } - - case MoveUpLeft: - newX -= actualDistance; - newY -= actualDistance; - break; - - default: - kDebug()<<"Compound direction is not supported"; - return; + if (moveAnyOnly && m_animDirection.testFlag(MoveAny)) { + newX = actualDistance; + newY = actualDistance; } if (direction() == QAbstractAnimation::Forward) { diff --git a/animations/slide_p.h b/animations/slide_p.h index 2ad31463b..1165818de 100644 --- a/animations/slide_p.h +++ b/animations/slide_p.h @@ -42,8 +42,8 @@ class SlideAnimationPrivate; class SlideAnimation : public Animation { Q_OBJECT - Q_PROPERTY(qint8 movementDirection READ movementDirection WRITE setMovementDirection) Q_PROPERTY(qreal distance READ distance WRITE setDistance) + Q_PROPERTY(MovementDirection movementDirection READ movementDirection WRITE setMovementDirection) public: explicit SlideAnimation(QObject *parent = 0, MovementDirection direction = MoveUp, qreal distance = 0); @@ -64,12 +64,12 @@ public: * Set the animation direction * @arg direction animation direction */ - void setMovementDirection(const qint8 &direction); + void setMovementDirection(const Animation::MovementDirection &direction); /** * Get the animation direction */ - qint8 movementDirection() const; + Animation::MovementDirection movementDirection() const; protected: void updateCurrentTime(int currentTime); @@ -79,7 +79,7 @@ private: /** * Animation direction: where the animation will move. */ - MovementDirection m_animDirection; + Animation::MovementDirection m_animDirection; /** * Animation distance: displacement factor for animations where From e3cab4cc26e1c794a491d157a35772b68d1e6e10 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 3 Feb 2010 08:27:33 +0000 Subject: [PATCH 53/60] be sure to remove the tool from the tool collection if it gets deleted because the action was removed svn path=/branches/KDE/4.4/kdelibs/; revision=1084456 --- private/internaltoolbox.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/private/internaltoolbox.cpp b/private/internaltoolbox.cpp index ad65a46f1..e78daf690 100644 --- a/private/internaltoolbox.cpp +++ b/private/internaltoolbox.cpp @@ -167,7 +167,16 @@ void InternalToolBox::addTool(QAction *action) void InternalToolBox::updateToolBox() { Plasma::IconWidget *tool = qobject_cast(sender()); - if (tool && tool->action() == 0) { + if (tool && !tool->action()) { + QMutableMapIterator it(d->tools); + while (it.hasNext()) { + it.next(); + if (it.value() == tool) { + it.remove(); + break; + } + } + tool->deleteLater(); tool = 0; } From 978d1270945133798879f858282566fd8808f7a1 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 3 Feb 2010 10:30:30 +0000 Subject: [PATCH 54/60] for consistency use khns3 dialog; look ma, no more memory leaks as a bonus! BUG:225360 svn path=/branches/KDE/4.4/kdelibs/; revision=1084578 --- CMakeLists.txt | 2 +- private/packages.cpp | 36 ++++++++++-------------------------- private/packages_p.h | 10 +++------- 3 files changed, 14 insertions(+), 34 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 722938df8..823439adf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -208,7 +208,7 @@ endif(PHONON_FOUND) kde4_add_library(plasma SHARED ${plasma_LIB_SRCS}) -target_link_libraries(plasma ${KDE4_KIO_LIBS} ${KDE4_KFILE_LIBS} knewstuff2 +target_link_libraries(plasma ${KDE4_KIO_LIBS} ${KDE4_KFILE_LIBS} knewstuff3 ${QT_QTUITOOLS_LIBRARY} ${QT_QTWEBKIT_LIBRARY} kdnssd threadweaver ${KDE4_SOLID_LIBS} ) diff --git a/private/packages.cpp b/private/packages.cpp index defd43c87..142f3ba37 100644 --- a/private/packages.cpp +++ b/private/packages.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include "plasma/private/wallpaper_p.h" @@ -37,8 +37,7 @@ namespace Plasma { PlasmoidPackage::PlasmoidPackage(QObject *parent) - : Plasma::PackageStructure(parent, QString("Plasmoid")), - m_knsEngine(0) + : Plasma::PackageStructure(parent, QString("Plasmoid")) { addDirectoryDefinition("images", "images/", i18n("Images")); QStringList mimetypes; @@ -70,11 +69,7 @@ PlasmoidPackage::PlasmoidPackage(QObject *parent) PlasmoidPackage::~PlasmoidPackage() { - delete m_knsEngine; -} - -void PlasmoidPackage::deleteNewStuffEngine() -{ + delete m_knsDialog.data(); } void PlasmoidPackage::pathChanged() @@ -90,25 +85,14 @@ void PlasmoidPackage::pathChanged() void PlasmoidPackage::createNewWidgetBrowser(QWidget *parent) { -//FIXME: memory leak below: it creates a new KNS::Engine every time it's called -// however, due to issues in the KNS2 library, reusing the same engine causes crashes :( -// if (!m_knsEngine) { - m_knsEngine = new KNS::Engine(parent); - kDebug() << "creating new kns engine" << m_knsEngine; - if (!m_knsEngine->init("plasmoids.knsrc")) { - delete m_knsEngine; - m_knsEngine = 0; - return; - } -// } + KNS3::DownloadDialog *knsDialog = m_knsDialog.data(); + if (!knsDialog) { + m_knsDialog = knsDialog = new KNS3::DownloadDialog("plasmoids.knsrc", parent); + connect(knsDialog, SIGNAL(accepted()), this, SIGNAL(newWidgetBrowserFinished())); + } - kDebug() << "successful kns engine" << m_knsEngine; - m_knsEngine->downloadDialog(this, SLOT(widgetBrowserFinished())); -} - -void PlasmoidPackage::widgetBrowserFinished() -{ - emit newWidgetBrowserFinished(); + knsDialog->show(); + knsDialog->raise(); } ThemePackage::ThemePackage(QObject *parent) diff --git a/private/packages_p.h b/private/packages_p.h index fef9938ba..f24091433 100644 --- a/private/packages_p.h +++ b/private/packages_p.h @@ -24,9 +24,9 @@ #include "plasma/wallpaper.h" #include "plasma/plasma.h" -namespace KNS +namespace KNS3 { - class Engine; + class DownloadDialog; } // namespace KNS namespace Plasma @@ -43,12 +43,8 @@ public: protected: void pathChanged(); -protected Q_SLOTS: - void widgetBrowserFinished(); - void deleteNewStuffEngine(); - private: - KNS::Engine *m_knsEngine; + QWeakPointer m_knsDialog; }; class ThemePackage : public PackageStructure From 3f52ba3c9faafc106992a845de0ab109cce6f335 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 3 Feb 2010 10:50:47 +0000 Subject: [PATCH 55/60] the ui load can return a null pointer, so guard against that svn path=/branches/KDE/4.4/kdelibs/; revision=1084626 --- applet.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/applet.cpp b/applet.cpp index a663f9166..b8043b497 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1734,7 +1734,9 @@ void Applet::showConfigurationInterface() QWidget *w = loader.load(&f); f.close(); - dialog->addPage(w, i18n("Settings"), icon(), i18n("%1 Settings", name())); + if (w) { + dialog->addPage(w, i18n("Settings"), icon(), i18n("%1 Settings", name())); + } } d->addGlobalShortcutsPage(dialog); From e924c9d534ec8681ab9a74770381b31b889a9d71 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Wed, 3 Feb 2010 11:01:14 +0000 Subject: [PATCH 56/60] SVN_SILENT made messages (.desktop file) svn path=/branches/KDE/4.4/kdelibs/; revision=1084631 --- data/servicetypes/plasma-applet-extenderapplet.desktop | 1 + data/servicetypes/plasma-applet-popupapplet.desktop | 1 + data/servicetypes/plasma-containmentactions.desktop | 1 + kcm_remotewidgets.actions | 2 ++ tests/packagemetadatatest.desktop | 2 ++ 5 files changed, 7 insertions(+) diff --git a/data/servicetypes/plasma-applet-extenderapplet.desktop b/data/servicetypes/plasma-applet-extenderapplet.desktop index ad2537678..298f1da8e 100644 --- a/data/servicetypes/plasma-applet-extenderapplet.desktop +++ b/data/servicetypes/plasma-applet-extenderapplet.desktop @@ -16,6 +16,7 @@ Name[eo]=Kolekto Name[es]=Colección Name[et]=Kollektsioon Name[eu]=Bilduma +Name[fi]=Kokoelma Name[fr]=Collection Name[fy]=Kolleksje Name[gl]=Colección diff --git a/data/servicetypes/plasma-applet-popupapplet.desktop b/data/servicetypes/plasma-applet-popupapplet.desktop index 5d0a52b83..3f18c7f59 100644 --- a/data/servicetypes/plasma-applet-popupapplet.desktop +++ b/data/servicetypes/plasma-applet-popupapplet.desktop @@ -17,6 +17,7 @@ Comment[en_GB]=Plasma scripting popup applet Comment[es]=Miniaplicación emergente de script para Plasma Comment[et]=Plasma skriptimise hüpikaplett Comment[eu]=Plasma scripting popup appleta +Comment[fi]=Plasma ponnahdusikkunoiden komentojonosovelma Comment[fr]=Applet de script Plasma Comment[fy]=Plasma scripting popup applet Comment[gl]=Applet contextual de scripting de Plasma diff --git a/data/servicetypes/plasma-containmentactions.desktop b/data/servicetypes/plasma-containmentactions.desktop index 6dc79405d..aee25b4fd 100644 --- a/data/servicetypes/plasma-containmentactions.desktop +++ b/data/servicetypes/plasma-containmentactions.desktop @@ -14,6 +14,7 @@ Comment[en_GB]=Plasma ContainmentActions Comment[es]=ContainmentActions de Plasma Comment[et]=Plasma konteineritoimingud Comment[eu]=Plasma ContainmentActions +Comment[fi]=Plasma ContainmentActions Comment[fr]=Plasma d'actions contenantes Comment[gl]=ContainmentActions de Plasma Comment[hr]=Plasma ContainmentActions diff --git a/kcm_remotewidgets.actions b/kcm_remotewidgets.actions index 705e49b7e..a28f6b088 100644 --- a/kcm_remotewidgets.actions +++ b/kcm_remotewidgets.actions @@ -11,6 +11,7 @@ Name[en_GB]=Save remote widgets policies Name[es]=Guardar las políticas de elementos gráficos remotos Name[et]=Välisvidinate reeglite salvestamine Name[eu]=Gorde urruneko widget politikak +Name[fi]=Tallena etäkäyttöliittymäelementtien toimintatavat Name[fr]=Enregistrer la politique des éléments distants Name[gl]=Gardar as políticas dos widgets remotos Name[hr]=Snimi pravila za udaljene widgete @@ -54,6 +55,7 @@ Description[en_GB]=Prevents the system from saving plasma remote widgets policie Description[es]=Impide que el sistema guarde políticas de elementos gráficos remotos Description[et]=Takistab süsteemil salvestamast Plasma välisvidinate reegleid Description[eu]=Sistemak urruneko tramankuluen politikak gorde ditzan ekiditen du +Description[fi]=Estää järjestelmää tallettamasta plasma etäkäyttöliittymäelementtien toimintatavat Description[fr]=Empêche le système d'enregistrer la politique des éléments distants Description[gl]=Evita que o sistema garde as políticas de plasma dos widgets remotos Description[hr]=Brani sustavu da snima pravila za plasama udaljene widgete diff --git a/tests/packagemetadatatest.desktop b/tests/packagemetadatatest.desktop index 8f3f6f2bc..366d1a172 100644 --- a/tests/packagemetadatatest.desktop +++ b/tests/packagemetadatatest.desktop @@ -16,6 +16,7 @@ Name[eo]=Pakaĵa meta-datuma testdosiero Name[es]=Archivo de pruebas de metadatos de paquete Name[et]=Plasma metaandmete testfail Name[eu]=Paketeen metadatuen proba fitxategia +Name[fi]=Pakettimetatietojen testitiedosto Name[fr]=Fichier de test des métadonnées de paquetage Name[fy]=Package metadata testtriem Name[ga]=Comhad tástála le haghaidh PackageMetaData @@ -81,6 +82,7 @@ Comment[eo]=Testa tabula dosiero por testi la klason PackageMetaData. Comment[es]=Un archivo de escritorio para probar la clase PackageMetaData. Comment[et]=Testtöölauafail klassi PackageMetaData testimiseks. Comment[eu]=PackageMetaData klasea probatzeko probako mahaigain fitxategia. +Comment[fi]=Kokeellinen työpöytätiedosto PackageMetaData-luokan testaamiseen. Comment[fr]=Un fichier de bureau de démonstration pour tester la classe PackageMetaData. Comment[fy]=In test burblêdtriem om de PackageMetaData class te testen. Comment[ga]=Comhad tástála deisce a úsáidtear chun aicme PackageMetaData a thástáil. From ed37e1acc0929c59fd53f13d3646f4e86fd0a0b9 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 3 Feb 2010 16:20:10 +0000 Subject: [PATCH 57/60] if the UI file is bogus for whatever reason (not just "we can't open it") call the script's createConfigurationInterface to see if that works any better svn path=/branches/KDE/4.4/kdelibs/; revision=1084730 --- applet.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/applet.cpp b/applet.cpp index b8043b497..21e051696 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1717,26 +1717,22 @@ void Applet::showConfigurationInterface() QString uiFile = d->package->filePath("mainconfigui"); if (!uiFile.isEmpty()) { - dialog->setWindowTitle(d->configWindowTitle()); - dialog->setAttribute(Qt::WA_DeleteOnClose, true); - - QUiLoader loader; QFile f(uiFile); - if (!f.open(QIODevice::ReadOnly)) { + QUiLoader loader; + QWidget *w = loader.load(&f); + if (!w) { delete dialog; if (d->script) { d->script->showConfigurationInterface(); } + return; } - QWidget *w = loader.load(&f); - f.close(); - - if (w) { - dialog->addPage(w, i18n("Settings"), icon(), i18n("%1 Settings", name())); - } + dialog->setWindowTitle(d->configWindowTitle()); + dialog->setAttribute(Qt::WA_DeleteOnClose, true); + dialog->addPage(w, i18n("Settings"), icon(), i18n("%1 Settings", name())); } d->addGlobalShortcutsPage(dialog); From 0d51b21cabe7245697b9b900569fceb616e50160 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 3 Feb 2010 17:41:18 +0000 Subject: [PATCH 58/60] another use case, another way the code could fail; reorganize this code so that if a dialog isn't auto-generated (no matter why!) we fall back to the ScriptEngine's own implemenation svn path=/branches/KDE/4.4/kdelibs/; revision=1084747 --- applet.cpp | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/applet.cpp b/applet.cpp index 21e051696..8f90cc936 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1713,31 +1713,27 @@ void Applet::showConfigurationInterface() } if (d->package && d->configLoader) { - KConfigDialog *dialog = new KConfigDialog(0, d->configDialogId(), d->configLoader); + KConfigDialog *dialog = 0; QString uiFile = d->package->filePath("mainconfigui"); if (!uiFile.isEmpty()) { QFile f(uiFile); QUiLoader loader; QWidget *w = loader.load(&f); - if (!w) { - delete dialog; - - if (d->script) { - d->script->showConfigurationInterface(); - } - - return; + if (w) { + dialog = new KConfigDialog(0, d->configDialogId(), d->configLoader); + dialog->setWindowTitle(d->configWindowTitle()); + dialog->setAttribute(Qt::WA_DeleteOnClose, true); + dialog->addPage(w, i18n("Settings"), icon(), i18n("%1 Settings", name())); + d->addGlobalShortcutsPage(dialog); + d->addPublishPage(dialog); + dialog->show(); } - - dialog->setWindowTitle(d->configWindowTitle()); - dialog->setAttribute(Qt::WA_DeleteOnClose, true); - dialog->addPage(w, i18n("Settings"), icon(), i18n("%1 Settings", name())); } - d->addGlobalShortcutsPage(dialog); - d->addPublishPage(dialog); - dialog->show(); + if (!dialog && d->script) { + d->script->showConfigurationInterface(); + } } else if (d->script) { d->script->showConfigurationInterface(); } else { From d24d0eaeed9d0679529653ab35494a76ffd251c6 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 3 Feb 2010 20:10:32 +0000 Subject: [PATCH 59/60] backport drag treshold on dragHandles svn path=/branches/KDE/4.4/kdelibs/; revision=1084810 --- widgets/scrollwidget.cpp | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/widgets/scrollwidget.cpp b/widgets/scrollwidget.cpp index 2675e40f2..5e8323b97 100644 --- a/widgets/scrollwidget.cpp +++ b/widgets/scrollwidget.cpp @@ -597,15 +597,31 @@ bool ScrollWidget::eventFilter(QObject *watched, QEvent *event) if (event->type() == QEvent::GraphicsSceneMousePress || event->type() == QEvent::GraphicsSceneMouseMove || event->type() == QEvent::GraphicsSceneMouseRelease) { - if (scene()) { + + QGraphicsSceneMouseEvent *me = static_cast(event); + + if (event->type() == QEvent::GraphicsSceneMousePress) { + d->dragHandleClicked = me->scenePos(); + } + + d->dragging = (d->dragging | (d->dragHandleClicked.toPoint() - me->scenePos().toPoint()).manhattanLength() > (KGlobalSettings::dndEventDelay())); + + if (scene() && event->type() != QEvent::GraphicsSceneMouseMove) { scene()->sendEvent(this, event); } - QGraphicsSceneMouseEvent *me = static_cast(event); - if (event->type() == QEvent::GraphicsSceneMousePress) { - d->dragHandleClicked = me->scenePos(); - } else if (event->type() == QEvent::GraphicsSceneMouseRelease && - (d->dragHandleClicked.toPoint() - me->scenePos().toPoint()).manhattanLength() > KGlobalSettings::dndEventDelay()) { + if (!d->dragging) { + return false; + } + + if (scene() && event->type() == QEvent::GraphicsSceneMouseMove) { + scene()->sendEvent(this, event); + } + + + if (event->type() == QEvent::GraphicsSceneMouseRelease) { + + d->dragging = false; return true; } } From a4f2a6eb7f851ad304c86d1a3b11791eac0241a7 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 3 Feb 2010 20:54:49 +0000 Subject: [PATCH 60/60] backport pressed state reset fix svn path=/branches/KDE/4.4/kdelibs/; revision=1084840 --- widgets/iconwidget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/widgets/iconwidget.cpp b/widgets/iconwidget.cpp index 5098f1432..91d39a8bf 100644 --- a/widgets/iconwidget.cpp +++ b/widgets/iconwidget.cpp @@ -1299,6 +1299,9 @@ void IconWidget::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) action->event(event->type(), event->pos()); } // d->states &= ~IconWidgetPrivate::HoverState; // Will be set once progress is zero again ... + //if an eventfilter stolen the mousereleaseevent remove the pressed state here + d->states &= ~IconWidgetPrivate::PressedState; + d->hoverEffect(false); update();