From 58b6cc3e435f98c9eeca4e0481db53b75f225446 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 29 Nov 2011 15:53:17 +0100 Subject: [PATCH 01/25] remove the iterator after accessing it --- dataengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataengine.cpp b/dataengine.cpp index 9ad22efed..718dfba2f 100644 --- a/dataengine.cpp +++ b/dataengine.cpp @@ -331,10 +331,10 @@ void DataEngine::removeAllSources() while (it.hasNext()) { it.next(); Plasma::DataContainer *s = it.value(); - it.remove(); s->disconnect(this); s->deleteLater(); emit sourceRemoved(it.key()); + it.remove(); } } From 6cd33ae4a0ea0e3f9c94465b335f10e6a24a9ae6 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 30 Nov 2011 09:17:01 +0100 Subject: [PATCH 02/25] grab the source name before removing the iterator the previous fix, which i accidentally reverted while cleaning up this code, was actually wrong (so in a way i'm glad i caught it): the signal MUST be emitted AFTER the item is removed from the collection otherwise any code that checks to see if that source exists will see that it does still exist even though it was just signaled as being removed. order sometimes really matters :) CCMAIL:kde@rusu.info BUG:287795 --- dataengine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dataengine.cpp b/dataengine.cpp index 718dfba2f..364b15e67 100644 --- a/dataengine.cpp +++ b/dataengine.cpp @@ -331,10 +331,11 @@ void DataEngine::removeAllSources() while (it.hasNext()) { it.next(); Plasma::DataContainer *s = it.value(); + const QString &source = it.key(); + it.remove(); s->disconnect(this); s->deleteLater(); - emit sourceRemoved(it.key()); - it.remove(); + emit sourceRemoved(source); } } From 7498fe207ae3e9a13765e5c238fb9628a47c7c75 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 30 Nov 2011 13:43:52 +0100 Subject: [PATCH 03/25] don't allocate 1k chunks of memory for a few longs here and there --- windoweffects.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/windoweffects.cpp b/windoweffects.cpp index b394cf482..ce411760c 100644 --- a/windoweffects.cpp +++ b/windoweffects.cpp @@ -99,7 +99,7 @@ void slideWindow(WId id, Plasma::Location location, int offset) #ifdef Q_WS_X11 Display *dpy = QX11Info::display(); Atom atom = XInternAtom( dpy, "_KDE_SLIDE", False ); - QVarLengthArray data(2); + QVarLengthArray data(2); data[0] = offset; @@ -133,7 +133,7 @@ void slideWindow(QWidget *widget, Plasma::Location location) #ifdef Q_WS_X11 Display *dpy = QX11Info::display(); Atom atom = XInternAtom( dpy, "_KDE_SLIDE", False ); - QVarLengthArray data(2); + QVarLengthArray data(2); switch (location) { case LeftEdge: @@ -197,7 +197,8 @@ void showWindowThumbnails(WId parent, const QList &windows, const QList data(1 + (6 * numWindows)); + // 64 is enough for 10 windows and is a nice base 2 number + QVarLengthArray data(1 + (6 * numWindows)); data[0] = numWindows; QList::const_iterator windowsIt; @@ -252,7 +253,7 @@ void presentWindows(WId controller, const QList &ids) void presentWindows(WId controller, int desktop) { #ifdef Q_WS_X11 - QVarLengthArray data(1); + QVarLengthArray data(1); data[0] = desktop; Display *dpy = QX11Info::display(); Atom atom = XInternAtom(dpy, "_KDE_PRESENT_WINDOWS_DESKTOP", False); @@ -298,12 +299,11 @@ void overrideShadow(WId window, bool override) #ifdef Q_WS_X11 Display *dpy = QX11Info::display(); Atom atom = XInternAtom( dpy, "_KDE_SHADOW_OVERRIDE", False ); - QVarLengthArray data(1); - data[0] = 1; - if (!override) { XDeleteProperty(dpy, window, atom); } else { + QVarLengthArray data(1); + data[0] = 1; XChangeProperty(dpy, window, atom, atom, 32, PropModeReplace, reinterpret_cast(data.data()), data.size()); } From 3bf1d0d63dcc7dae5131507e3ac8f7b596dea943 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 30 Nov 2011 15:19:29 +0100 Subject: [PATCH 04/25] hide the label completely when no image is set. makes sure there isn't layout().spacing() extra padding --- private/tooltip.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/private/tooltip.cpp b/private/tooltip.cpp index 20c4ee03d..0f4b4d3c2 100644 --- a/private/tooltip.cpp +++ b/private/tooltip.cpp @@ -300,7 +300,12 @@ void ToolTip::setContent(QObject *tipper, const ToolTipContent &data) { //reset our size d->text->setContent(data); - d->imageLabel->setPixmap(data.image()); + if (data.image().isNull()) { + d->imageLabel->hide(); + } else { + d->imageLabel->show(); + d->imageLabel->setPixmap(data.image()); + } if (data.highlightWindows() && !data.windowsToPreview().isEmpty()) { WindowEffects::highlightWindows(winId(), QList() << winId() << data.windowsToPreview()); From 3c401cd360539cac87beb8c1679040bd2afe35f9 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 30 Nov 2011 15:19:58 +0100 Subject: [PATCH 05/25] force of habit :) --- dataengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataengine.cpp b/dataengine.cpp index 364b15e67..259ac2ef9 100644 --- a/dataengine.cpp +++ b/dataengine.cpp @@ -331,7 +331,7 @@ void DataEngine::removeAllSources() while (it.hasNext()) { it.next(); Plasma::DataContainer *s = it.value(); - const QString &source = it.key(); + const QString source = it.key(); it.remove(); s->disconnect(this); s->deleteLater(); From 7e4883f3bbd22aa4cfc5c27c6d901fb6370ee348 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 30 Nov 2011 15:39:29 +0100 Subject: [PATCH 06/25] handle titles a little nicer: centered, no wrap for short titles --- private/tooltip.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/private/tooltip.cpp b/private/tooltip.cpp index 0f4b4d3c2..25c961ba2 100644 --- a/private/tooltip.cpp +++ b/private/tooltip.cpp @@ -56,6 +56,9 @@ public: m_toolTip(parent), m_document(new QTextDocument(this)) { + QTextOption option = m_document->defaultTextOption(); + option.setWrapMode(QTextOption::WordWrap); + m_document->setDefaultTextOption(option); } void setStyleSheet(const QString &css) @@ -66,8 +69,13 @@ public: void setContent(const ToolTipContent &data) { QString html; - if (!data.mainText().isEmpty()) { - html.append("
" + data.mainText() + "
"); + QString mainText = data.mainText(); + if (!mainText.isEmpty()) { + if (mainText.size() < 50) { + // don't let short texts wrap on us! + mainText = mainText.replace(" ", " "); + } + html.append("
" + mainText + "
"); } html.append(data.subText()); @@ -76,6 +84,8 @@ public: data.registerResources(m_document); if (!html.isEmpty()) { m_document->setHtml("

" + html + "

"); + } else { + m_document->clear(); } m_document->adjustSize(); @@ -179,8 +189,8 @@ ToolTip::ToolTip(QWidget *parent) d->preview = new WindowPreview(this); d->text = new TipTextWidget(this); d->imageLabel = new QLabel(this); - d->imageLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft); + d->imageLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft); d->animation = new QPropertyAnimation(this, "pos", this); d->animation->setEasingCurve(QEasingCurve::InOutQuad); d->animation->setDuration(250); @@ -198,7 +208,7 @@ ToolTip::ToolTip(QWidget *parent) QHBoxLayout *iconTextHBoxLayout = new QHBoxLayout; iconTextHBoxLayout->addWidget(d->imageLabel); - iconTextHBoxLayout->setAlignment(d->imageLabel, Qt::AlignCenter); + iconTextHBoxLayout->setAlignment(d->imageLabel, Qt::AlignTop | Qt::AlignHCenter); iconTextHBoxLayout->addWidget(d->text); iconTextHBoxLayout->setAlignment(d->text, Qt::AlignLeft | Qt::AlignVCenter); iconTextHBoxLayout->setStretchFactor(d->text, 1); From 822243288debd26175a723bfecc64f46798df0d3 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 30 Nov 2011 15:44:29 +0100 Subject: [PATCH 07/25] get rid of the text halos they are (relatively) expensive and should be unnecessary now: we have blur, it works well, and when we don't blur we use different backgrounds. one more "take one thing off" while i'm futzing around in tooltips --- private/tooltip.cpp | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/private/tooltip.cpp b/private/tooltip.cpp index 25c961ba2..26e925006 100644 --- a/private/tooltip.cpp +++ b/private/tooltip.cpp @@ -89,25 +89,13 @@ public: } m_document->adjustSize(); - m_haloRects.clear(); - QTextLayout *layout = m_document->begin().layout(); - //layout->setPosition(QPointF(textRect.x(), textBoundingRect->y())); - QTextLine line; - for (int i = 0; i < layout->lineCount(); ++i) { - line = layout->lineAt(i); - - // Add halo rect only when a non empty line is found - if (line.naturalTextWidth()) { - m_haloRects.append(line.naturalTextRect().translated(layout->position().toPoint()).toRect().translated(m_margin, m_margin)); - } - } - update(); } QSize minimumSizeHint() const { - return m_document->size().toSize() + QSize(m_margin, m_margin)*2; + const int margin = 6; + return m_document->size().toSize() + QSize(margin, margin)*2; } QSize maximumSizeHint() const @@ -118,14 +106,6 @@ public: void paintEvent(QPaintEvent *event) { QPainter p(this); - - if (Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor).value() < 128) { - foreach (const QRectF &rect, m_haloRects) { - Plasma::PaintUtils::drawHalo(&p, rect); - } - - p.translate(m_margin, m_margin); - } m_document->drawContents(&p, event->rect()); } @@ -155,8 +135,6 @@ private: ToolTip *m_toolTip; QTextDocument *m_document; QString m_anchor; - QList m_haloRects; - static const int m_margin = 6; }; class ToolTipPrivate From ed31f2aaee61b279d5e87556856f94ffca35842c Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Thu, 1 Dec 2011 17:12:11 +0100 Subject: [PATCH 08/25] set the parent of the config skeleton object to be the dialog BUG:287324 --- applet.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/applet.cpp b/applet.cpp index 99671b62d..991a90eb8 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1900,6 +1900,11 @@ void Applet::showConfigurationInterface() KConfigSkeleton *configLoader = d->configLoader ? d->configLoader : new KConfigSkeleton(0); dialog = new AppletConfigDialog(0, d->configDialogId(), configLoader); + if (!d->configLoader) { + // delete the temporary when this dialog is done + configLoader->setParent(dialog); + } + dialog->setWindowTitle(d->configWindowTitle()); dialog->setAttribute(Qt::WA_DeleteOnClose, true); bool hasPages = false; @@ -2016,6 +2021,7 @@ KConfigDialog *AppletPrivate::generateGenericConfigDialog() { KConfigSkeleton *nullManager = new KConfigSkeleton(0); KConfigDialog *dialog = new AppletConfigDialog(0, configDialogId(), nullManager); + nullManager->setParent(dialog); dialog->setFaceType(KPageDialog::Auto); dialog->setWindowTitle(configWindowTitle()); dialog->setAttribute(Qt::WA_DeleteOnClose, true); @@ -2023,7 +2029,6 @@ KConfigDialog *AppletPrivate::generateGenericConfigDialog() dialog->showButton(KDialog::Default, false); QObject::connect(dialog, SIGNAL(applyClicked()), q, SLOT(configDialogFinished())); QObject::connect(dialog, SIGNAL(okClicked()), q, SLOT(configDialogFinished())); - QObject::connect(dialog, SIGNAL(finished()), nullManager, SLOT(deleteLater())); return dialog; } From 2313cc258bc23dfd8a2de6209ab46b89b670ecda Mon Sep 17 00:00:00 2001 From: Jeremy Whiting Date: Thu, 1 Dec 2011 15:50:44 -0700 Subject: [PATCH 09/25] KTar already supports xz and lzma files, also support them in Plasma::Package. BUG:287193 --- package.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.cpp b/package.cpp index 4c00d368e..9d05a8dd9 100644 --- a/package.cpp +++ b/package.cpp @@ -509,7 +509,8 @@ 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-bzip-compressed-tar")) { + mimetype->is("application/x-tar")|| mimetype->is("application/x-bzip-compressed-tar") || + mimetype->is("application/x-xz") || mimetype->is("application/x-lzma")) { archive = new KTar(package); } else { kWarning() << "Could not open package file, unsupported archive format:" << package << mimetype->name(); From a97d486876020d10129b69bf26243078bddc9bcc Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Fri, 2 Dec 2011 10:39:18 +0100 Subject: [PATCH 10/25] animate transitions when an svg is used as well. --- widgets/iconwidget.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/widgets/iconwidget.cpp b/widgets/iconwidget.cpp index b7c99de2d..00b42cae0 100644 --- a/widgets/iconwidget.cpp +++ b/widgets/iconwidget.cpp @@ -644,15 +644,25 @@ void IconWidget::setSvg(const QString &svgFilePath, const QString &elementId) if (!d->iconSvg) { d->iconSvg = new Plasma::Svg(this); connect(d->iconSvg, SIGNAL(repaintNeeded()), this, SLOT(svgChanged())); + d->oldIcon = d->icon; + } else { + d->oldIcon = d->iconSvg->pixmap(d->iconSvgElement); } d->iconSvg->setImagePath(svgFilePath); d->iconSvg->setContainsMultipleImages(!elementId.isNull()); d->iconSvgElement = elementId; d->iconSvgElementChanged = true; - d->icon = QIcon(); updateGeometry(); - update(); + + if (!(d->states & IconWidgetPrivate::HoverState) && !d->iconChangeTimer->isActive() && !d->oldIcon.isNull()) { + d->animateMainIcon(true, d->states); + } else { + d->oldIcon = QIcon(); + update(); + } + d->iconChangeTimer->start(300); + d->icon = QIcon(); } QString IconWidget::svg() const From dd15c33c2bcc88e3b91dabdd9bac27d2be498804 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Fri, 2 Dec 2011 10:39:48 +0100 Subject: [PATCH 11/25] while properties are cool and all, let's not take the slow path just because we can. --- widgets/iconwidget.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/widgets/iconwidget.cpp b/widgets/iconwidget.cpp index 00b42cae0..1161cc4d2 100644 --- a/widgets/iconwidget.cpp +++ b/widgets/iconwidget.cpp @@ -751,20 +751,19 @@ void IconWidgetPrivate::animateMainIcon(bool show, const IconWidgetStates state) QPropertyAnimation *animation = hoverAnimation->animation(); if (!animation) { animation = new QPropertyAnimation(hoverAnimation, "value"); - animation->setProperty("duration", 150); - animation->setProperty("easingCurve", QEasingCurve::OutQuad); - animation->setProperty("startValue", 0.0); - animation->setProperty("endValue", 1.0); + animation->setDuration(150); + animation->setEasingCurve(QEasingCurve::OutQuad); + animation->setStartValue(0.0); + animation->setEndValue(1.0); hoverAnimation->setAnimation(animation); q->connect(animation, SIGNAL(finished()), q, SLOT(hoverAnimationFinished())); } else if (animation->state() == QAbstractAnimation::Running) { animation->pause(); } - animation->setProperty("direction", show ? - QAbstractAnimation::Forward : QAbstractAnimation::Backward); - animation->start(show ? - QAbstractAnimation::KeepWhenStopped : QAbstractAnimation::DeleteWhenStopped); + animation->setDirection(show ? QAbstractAnimation::Forward : QAbstractAnimation::Backward); + animation->start(show ? QAbstractAnimation::KeepWhenStopped : QAbstractAnimation::DeleteWhenStopped); + q->update(); } void IconWidgetPrivate::hoverAnimationFinished() @@ -1468,7 +1467,6 @@ void IconWidget::hoverEnterEvent(QGraphicsSceneHoverEvent *event) d->oldIcon = QIcon(); d->animateMainIcon(true, d->states|IconWidgetPrivate::HoverState); - update(); QGraphicsWidget::hoverEnterEvent(event); } @@ -1485,7 +1483,6 @@ void IconWidget::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) d->states &= ~IconWidgetPrivate::PressedState; d->animateMainIcon(false, d->states|IconWidgetPrivate::HoverState); - update(); QGraphicsWidget::hoverLeaveEvent(event); } @@ -1496,10 +1493,8 @@ bool IconWidget::sceneEventFilter(QGraphicsItem *watched, QEvent *event) if (event->type() == QEvent::GraphicsSceneDragEnter) { d->animateMainIcon(true, d->states|IconWidgetPrivate::HoverState); - update(); } else if (event->type() == QEvent::GraphicsSceneDragLeave) { d->animateMainIcon(false, d->states|IconWidgetPrivate::HoverState); - update(); } return false; From f0498a9973f6934cde557b24126f4b1498895bee Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Fri, 2 Dec 2011 10:44:54 +0100 Subject: [PATCH 12/25] fix spinboxes BUG:285224 --- private/style.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/private/style.cpp b/private/style.cpp index 9fff60d8a..e3449f532 100644 --- a/private/style.cpp +++ b/private/style.cpp @@ -61,7 +61,7 @@ public: if (!textBox) { textBox = new Plasma::FrameSvg(q); textBox->setImagePath("widgets/lineedit"); - textBox->setElementPrefix("sunken"); + textBox->setElementPrefix("base"); } } @@ -197,7 +197,6 @@ void Style::drawComplexControl(ComplexControl control, case CC_SpinBox: { d->createTextBox(); - d->textBox->setElementPrefix("base"); d->textBox->resizeFrame(option->rect.size()); d->textBox->paintFrame(painter); @@ -252,7 +251,6 @@ void Style::drawComplexControl(ComplexControl control, qApp->style()->drawComplexControl(control, option, painter, widget); } else { d->createTextBox(); - d->textBox->setElementPrefix("base"); d->textBox->resizeFrame(option->rect.size()); d->textBox->paintFrame(painter); @@ -283,7 +281,6 @@ void Style::drawPrimitive(PrimitiveElement element, const QStyleOption *option, } d->createTextBox(); - d->textBox->setElementPrefix("base"); d->textBox->resizeFrame(option->rect.size()); d->textBox->paintFrame(painter); break; @@ -350,7 +347,6 @@ QRect Style::subElementRect(SubElement element, const QStyleOption *option, cons switch (element) { case SE_LineEditContents: { d->createTextBox(); - d->textBox->setElementPrefix("base"); qreal left, top, right, bottom; d->textBox->getMargins(left, top, right, bottom); @@ -365,9 +361,15 @@ QSize Style::sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget) const { switch (type) { + case CT_SpinBox: { + d->createTextBox(); + + qreal left, top, right, bottom; + d->textBox->getMargins(left, top, right, bottom); + return contentsSize + QSize(left + right - 2, top + bottom - 2); + } case CT_LineEdit: { d->createTextBox(); - d->textBox->setElementPrefix("base"); qreal left, top, right, bottom; d->textBox->getMargins(left, top, right, bottom); @@ -376,7 +378,6 @@ QSize Style::sizeFromContents(ContentsType type, const QStyleOption *option, default: return qApp->style()->sizeFromContents(type, option, contentsSize, widget); } - } } From c3cb35739cf6c9ded3966df3e8571ef4d78e9aba Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Fri, 2 Dec 2011 17:00:29 +0100 Subject: [PATCH 13/25] containmentType() .. NOT type()! and now we know the source of the "panel covers the entire screen" bug BUG:259704 --- view.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view.cpp b/view.cpp index 7c6769635..c4aa83560 100644 --- a/view.cpp +++ b/view.cpp @@ -186,8 +186,8 @@ void View::setScreen(int screen, int desktop) // handle views that are working with panel containment types if (d->containment && - (d->containment->type() == Containment::PanelContainment || - d->containment->type() == Containment::CustomPanelContainment)) { + (d->containment->containmentType() == Containment::PanelContainment || + d->containment->containmentType() == Containment::CustomPanelContainment)) { d->containment->setScreen(screen, desktop); return; } From e0cd24f83aa21c6b023ec77cd630d29dca6fdeb5 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Fri, 2 Dec 2011 17:30:59 +0100 Subject: [PATCH 14/25] constrained square makes sense for vertical but not horizontal panels BUG:282706 --- applet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applet.cpp b/applet.cpp index 991a90eb8..578fa5575 100644 --- a/applet.cpp +++ b/applet.cpp @@ -2520,7 +2520,7 @@ QSizeF Applet::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const } } else if (d->aspectRatioMode == Plasma::ConstrainedSquare) { //enforce a size not wider than tall - if (ff == Horizontal && (which == Qt::MaximumSize || size().height() <= KIconLoader::SizeLarge)) { + if (ff == Horizontal) { hint.setWidth(size().height()); //enforce a size not taller than wide } else if (ff == Vertical && (which == Qt::MaximumSize || size().width() <= KIconLoader::SizeLarge)) { From 1ba3ec0d04fbc356dd1c6f762c2c0947bc477da9 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Fri, 2 Dec 2011 19:01:46 +0100 Subject: [PATCH 15/25] use the default corona in case the widget doesn't provide one we need a different solution for libplasma2, however. BUG:281759 --- tooltipmanager.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tooltipmanager.cpp b/tooltipmanager.cpp index a67599373..3d8713b64 100644 --- a/tooltipmanager.cpp +++ b/tooltipmanager.cpp @@ -249,6 +249,11 @@ void ToolTipManager::setContent(QGraphicsWidget *widget, const ToolTipContent &d //look if the data prefers aother graphicswidget, otherwise use the one used as event catcher QGraphicsWidget *referenceWidget = data.graphicsWidget() ? data.graphicsWidget() : widget; Corona *corona = qobject_cast(referenceWidget->scene()); + if (!corona) { + // fallback to the corona we were given + corona = m_corona; + } + if (corona) { d->tipWidget->moveTo(corona->popupPosition(referenceWidget, d->tipWidget->size(), Qt::AlignCenter)); } @@ -404,6 +409,11 @@ void ToolTipManagerPrivate::showToolTip() tipWidget->prepareShowing(); QGraphicsWidget *referenceWidget = tooltip.value().graphicsWidget() ? tooltip.value().graphicsWidget() : currentWidget; Corona *corona = qobject_cast(referenceWidget->scene()); + if (!corona) { + // fallback to the corona we were given + corona = q->m_corona; + } + if (corona) { tipWidget->moveTo(corona->popupPosition(referenceWidget, tipWidget->size(), Qt::AlignCenter)); } From 66f3acefb9c6adae2678b41c43b61025396ba630 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Sat, 3 Dec 2011 14:30:23 +0100 Subject: [PATCH 16/25] SVN_SILENT made messages (.desktop file) --- data/services/plasma.protocol | 1 + data/servicetypes/plasma-service.desktop | 1 + 2 files changed, 2 insertions(+) diff --git a/data/services/plasma.protocol b/data/services/plasma.protocol index 00384ed59..c3ae0d68b 100644 --- a/data/services/plasma.protocol +++ b/data/services/plasma.protocol @@ -38,6 +38,7 @@ Description[pt]=Um protocolo para os serviços do Plasma Description[pt_BR]=Protocolo para os serviços do Plasma Description[ro]=Un protocol pentru servicii Plasma Description[ru]=Протокол для служб Plasma +Description[se]=Protokolla Plasma-bálvalusaid várás Description[sk]=Protokol pre Plasma služby Description[sr]=Протокол за плазма сервисе Description[sr@ijekavian]=Протокол за плазма сервисе diff --git a/data/servicetypes/plasma-service.desktop b/data/servicetypes/plasma-service.desktop index cfb80feb8..db21604e7 100644 --- a/data/servicetypes/plasma-service.desktop +++ b/data/servicetypes/plasma-service.desktop @@ -38,6 +38,7 @@ Comment[pt]=Serviço do Plasma Comment[pt_BR]=Serviço do Plasma Comment[ro]=Servicu Plasma Comment[ru]=Служба Plasma +Comment[se]=Plasma-bálvalus Comment[si]=ප්ලස්මා සේවා Comment[sk]=Služba Plasma Comment[sr]=Плазма сервис From b7e335265f1dfde068965ce47ef9ed80de7ed84a Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Sat, 3 Dec 2011 17:45:56 +0100 Subject: [PATCH 17/25] catch another possible mimetype identification BUG:252612 --- packagestructure.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packagestructure.cpp b/packagestructure.cpp index 5eaab5b64..5b3edb6e1 100644 --- a/packagestructure.cpp +++ b/packagestructure.cpp @@ -614,7 +614,7 @@ PackageMetadata PackageStructure::metadata() if (mimetype->is("application/zip")) { archive = new KZip(d->path); - } else if (mimetype->is("application/x-compressed-tar") || + } else if (mimetype->is("application/x-compressed-tar") || mimetype->is("application/x-gzip") || mimetype->is("application/x-tar")|| mimetype->is("application/x-bzip-compressed-tar")) { archive = new KTar(d->path); } else { From 97e4bd53d316ef6096e0aef4f8a78c8a61cd9ca8 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Sat, 3 Dec 2011 21:22:45 +0100 Subject: [PATCH 18/25] don't delete the kns3 dialog on application shutdown BUG:288153 --- private/packages.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/private/packages.cpp b/private/packages.cpp index 08016db77..f85d5f724 100644 --- a/private/packages.cpp +++ b/private/packages.cpp @@ -22,6 +22,7 @@ #include #include // FLT_MAX +#include #include #include @@ -82,7 +83,10 @@ PlasmoidPackage::PlasmoidPackage(QObject *parent) PlasmoidPackage::~PlasmoidPackage() { #ifndef PLASMA_NO_KNEWSTUFF - delete m_knsDialog.data(); + if (!QCoreApplication::closingDown()) { + // let it "leak" on application close as this causes crashes otherwise, BUG 288153 + delete m_knsDialog.data(); + } #endif } From ab8e956d57343bda532dfa272f01bd7e5dbc5ad5 Mon Sep 17 00:00:00 2001 From: Jaime Torres Date: Sun, 4 Dec 2011 12:24:35 +0100 Subject: [PATCH 19/25] remove a break; after a return there is no need for a break; after a return (dead code) REVIEW: 103323 --- popupapplet.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/popupapplet.cpp b/popupapplet.cpp index c36350323..07ea3f108 100644 --- a/popupapplet.cpp +++ b/popupapplet.cpp @@ -446,7 +446,6 @@ QSizeF PopupApplet::sizeHint(Qt::SizeHint which, const QSizeF & constraint) cons case Horizontal: { const int size = IconSize(KIconLoader::Panel); return QSizeF(size, size); - break; } default: break; From be08974bfe5fbd0048d366f8beadd4d0f8add19a Mon Sep 17 00:00:00 2001 From: Jaime Torres Date: Sun, 4 Dec 2011 12:25:46 +0100 Subject: [PATCH 20/25] remove dead code remove dead code (see review 103323) --- private/associatedapplicationmanager.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/private/associatedapplicationmanager.cpp b/private/associatedapplicationmanager.cpp index cf8bbe5fc..9da0fd2ce 100644 --- a/private/associatedapplicationmanager.cpp +++ b/private/associatedapplicationmanager.cpp @@ -100,9 +100,6 @@ void AssociatedApplicationManager::setApplication(Plasma::Applet *applet, const QString AssociatedApplicationManager::application(const Plasma::Applet *applet) const { return d->applicationNames.value(applet); - if (!d->applicationNames.contains(applet)) { - connect(applet, SIGNAL(destroyed(QObject *)), this, SLOT(cleanupApplet(QObject *))); - } } void AssociatedApplicationManager::setUrls(Plasma::Applet *applet, const KUrl::List &urls) From 2c5ec1a56a8179b94b1d8e2ec1295c0debc79313 Mon Sep 17 00:00:00 2001 From: Jaime Torres Date: Sun, 4 Dec 2011 12:27:01 +0100 Subject: [PATCH 21/25] change return by break and then add a common return removing dead code (part of review 103323) --- private/style.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/private/style.cpp b/private/style.cpp index e3449f532..adfa9bdee 100644 --- a/private/style.cpp +++ b/private/style.cpp @@ -303,12 +303,13 @@ QRect Style::subControlRect(ComplexControl control, const QStyleOptionComplex *o rect.moveCenter(QPoint(option->rect.center().x(), rect.center().y())); } } - return rect; break; } default: - return rect; + break; } + return rect; + } int Style::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const From 4aa690ccc881cb2c197be02cb192ffb4ea5cb6bc Mon Sep 17 00:00:00 2001 From: Jaime Torres Date: Sun, 4 Dec 2011 12:28:04 +0100 Subject: [PATCH 22/25] return a double usind qMin qMin is a template, use the right datatype for it. part of review 103323 --- widgets/signalplotter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/signalplotter.cpp b/widgets/signalplotter.cpp index aa132dd57..a5646062a 100644 --- a/widgets/signalplotter.cpp +++ b/widgets/signalplotter.cpp @@ -933,7 +933,7 @@ void SignalPlotter::drawPlots(QPainter *p, int top, int w, int h, int horizontal qMax(prev_prev_datapoints[j], prev_prev_prev_datapoints[j]))); double current_minvalue = - qMin(datapoints[j], + qMin(datapoints[j], qMin(prev_datapoints[j], qMin(prev_prev_datapoints[j], prev_prev_prev_datapoints[j]))); From 27531a31732b95e6a50be3bbf5222a870d514ec6 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Sun, 4 Dec 2011 13:55:05 +0100 Subject: [PATCH 23/25] the palette gets updated by all sorts of events on the scene now (incl. reparenting!), so make sure the palette is _really_ changing before marking it as custom this fixes widget colours not updating with theme changes -> if, for instance, an offscreen widget is created, this results in a reparenting (to null) and that in turn creates a palette changed event ... which was being intepretted as a custom palette being set and that would disable future updates due to theme changes. this also introduces a small helper which computes the palettes once for use by all widgets as a small performance improvement. BUG:261967 --- CMakeLists.txt | 1 + private/themedwidgetinterface.cpp | 85 +++++++++++++++++++++++++++++++ private/themedwidgetinterface_p.h | 72 +++++++++++++++----------- 3 files changed, 127 insertions(+), 31 deletions(-) create mode 100644 private/themedwidgetinterface.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index fd86df12c..e4cad89e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,6 +140,7 @@ set(plasma_LIB_SRCS private/storage.cpp private/storagethread.cpp private/style.cpp + private/themedwidgetinterface.cpp private/trustedonlyauthorization.cpp private/tooltip.cpp private/wallpaperrenderthread.cpp diff --git a/private/themedwidgetinterface.cpp b/private/themedwidgetinterface.cpp new file mode 100644 index 000000000..399033c55 --- /dev/null +++ b/private/themedwidgetinterface.cpp @@ -0,0 +1,85 @@ +/****************************************************************************** +* Copyright 2011 by Aaron Seigo * +* * +* This library is free software; you can redistribute it and/or * +* modify it under the terms of the GNU Library General Public * +* License as published by the Free Software Foundation; either * +* version 2 of the License, or (at your option) any later version. * +* * +* This library is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +* Library General Public License for more details. * +* * +* You should have received a copy of the GNU Library General Public License * +* along with this library; see the file COPYING.LIB. If not, write to * +* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * +* Boston, MA 02110-1301, USA. * +*******************************************************************************/ + +#include "themedwidgetinterface_p.h" + +#include "theme.h" + +namespace Plasma +{ + +PaletteHelper *PaletteHelper::s_paletteHelper = 0; + +PaletteHelper::PaletteHelper() + : QObject() +{ + generatePalettes(); + connect(Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(generatePalettes())); + connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), this, SLOT(generatePalettes())); +} + +PaletteHelper *PaletteHelper::self() +{ + if (!s_paletteHelper) { + s_paletteHelper = new PaletteHelper; + } + + return s_paletteHelper; +} + +void PaletteHelper::generatePalettes() +{ + Theme *theme = Theme::defaultTheme(); + + QColor color = theme->color(Theme::TextColor); + palette = qApp->palette(); + palette.setColor(QPalette::Normal, QPalette::WindowText, color); + palette.setColor(QPalette::Inactive, QPalette::WindowText, color); + + palette.setColor(QPalette::Normal, QPalette::Link, theme->color(Theme::LinkColor)); + palette.setColor(QPalette::Normal, QPalette::LinkVisited, theme->color(Theme::VisitedLinkColor)); + + qreal alpha = color.alphaF(); + color.setAlphaF(0.6); + palette.setColor(QPalette::Disabled, QPalette::WindowText, color); + color.setAlphaF(alpha); + + palette.setColor(QPalette::Normal, QPalette::Text, color); + palette.setColor(QPalette::Inactive, QPalette::Text, color); + + const QColor buttonColor = Theme::defaultTheme()->color(Theme::ButtonTextColor); + palette.setColor(QPalette::Normal, QPalette::ButtonText, buttonColor); + palette.setColor(QPalette::Inactive, QPalette::ButtonText, buttonColor); + + //FIXME: hardcoded colors .. looks incorrect + palette.setColor(QPalette::Normal, QPalette::Base, QColor(0,0,0,0)); + palette.setColor(QPalette::Inactive, QPalette::Base, QColor(0,0,0,0)); + + buttonPalette = palette; + buttonPalette.setColor(QPalette::Normal, QPalette::Text, buttonColor); + buttonPalette.setColor(QPalette::Inactive, QPalette::Text, buttonColor); + + emit palettesUpdated(); +} + + +} // namespace Plasma + +#include "themedwidgetinterface_p.moc" + diff --git a/private/themedwidgetinterface_p.h b/private/themedwidgetinterface_p.h index 624e2f7cb..ac2eeec3b 100644 --- a/private/themedwidgetinterface_p.h +++ b/private/themedwidgetinterface_p.h @@ -28,6 +28,28 @@ namespace Plasma { +class PaletteHelper : public QObject +{ + Q_OBJECT +public: + static PaletteHelper *self(); + +public Q_SLOTS: + void generatePalettes(); + +Q_SIGNALS: + void palettesUpdated(); + +public: + QPalette palette; + QPalette buttonPalette; + +private: + PaletteHelper(); + static PaletteHelper *s_paletteHelper; +}; + + template class ThemedWidgetInterface { @@ -36,10 +58,10 @@ public: : q(publicClass), customPalette(false), customFont(false), - buttonColorForText(false) + buttonColorForText(false), + internalPaletteChange(false) { - QObject::connect(Theme::defaultTheme(), SIGNAL(themeChanged()), q, SLOT(setPalette())); - QObject::connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), q, SLOT(setPalette())); + QObject::connect(PaletteHelper::self(), SIGNAL(palettesUpdated()), q, SLOT(setPalette())); } void initTheming() @@ -52,33 +74,10 @@ public: void setPalette() { if (!customPalette) { - QColor color = Theme::defaultTheme()->color(Theme::TextColor); - QPalette p = q->palette(); - p.setColor(QPalette::Normal, QPalette::WindowText, color); - p.setColor(QPalette::Inactive, QPalette::WindowText, color); - - p.setColor(QPalette::Normal, QPalette::Link, Theme::defaultTheme()->color(Theme::LinkColor)); - p.setColor(QPalette::Normal, QPalette::LinkVisited, Theme::defaultTheme()->color(Theme::VisitedLinkColor)); - - - qreal alpha = color.alphaF(); - color.setAlphaF(0.6); - p.setColor(QPalette::Disabled, QPalette::WindowText, color); - color.setAlphaF(alpha); - - const QColor buttonColor = Theme::defaultTheme()->color(Theme::ButtonTextColor); - p.setColor(QPalette::Normal, QPalette::Text, buttonColorForText ? buttonColor : color); - p.setColor(QPalette::Inactive, QPalette::Text, buttonColorForText ? buttonColor : color); - - p.setColor(QPalette::Normal, QPalette::ButtonText, buttonColor); - p.setColor(QPalette::Inactive, QPalette::ButtonText, buttonColor); - - //FIXME: hardcoded colors .. looks incorrect - p.setColor(QPalette::Normal, QPalette::Base, QColor(0,0,0,0)); - p.setColor(QPalette::Inactive, QPalette::Base, QColor(0,0,0,0)); - - q->setPalette(p); - customPalette = false; + internalPaletteChange = true; + q->setPalette((buttonColorForText ? PaletteHelper::self()->buttonPalette + : PaletteHelper::self()->palette)); + internalPaletteChange = false; } if (!customFont) { @@ -95,7 +94,10 @@ public: break; case QEvent::PaletteChange: - customPalette = true; + if (!internalPaletteChange && + q->palette() != (buttonColorForText ? PaletteHelper::self()->buttonPalette : PaletteHelper::self()->palette)) { + customPalette = true; + } break; default: @@ -103,6 +105,13 @@ public: } } + void setWidget(QWidget *widget) + { + internalPaletteChange = true; + q->setWidget(widget); + internalPaletteChange = false; + } + void event(QEvent *event) { if (event->type() == QEvent::Show) { @@ -114,6 +123,7 @@ public: bool customPalette : 1; bool customFont : 1; bool buttonColorForText : 1; + bool internalPaletteChange : 1; }; } // namespace Plasma From e34c70415e34080498ad665ef494a7ea3f9bcd38 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Sun, 4 Dec 2011 13:59:54 +0100 Subject: [PATCH 24/25] git rid of the native member, it's redundant; use d->setWidget which notes that it's not a palette customization --- widgets/textbrowser.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/widgets/textbrowser.cpp b/widgets/textbrowser.cpp index 8e35ab5ce..870d570e0 100644 --- a/widgets/textbrowser.cpp +++ b/widgets/textbrowser.cpp @@ -40,7 +40,6 @@ class TextBrowserPrivate : public ThemedWidgetInterface public: TextBrowserPrivate(TextBrowser *browser) : ThemedWidgetInterface(browser), - native(0), savedMinimumHeight(0), savedMaximumHeight(QWIDGETSIZE_MAX), wasNotFixed(true) @@ -49,7 +48,8 @@ public: void setFixedHeight() { - if (native && native->document() && + KTextBrowser *native = q->nativeWidget(); + if (native->document() && q->sizePolicy().verticalPolicy() == QSizePolicy::Fixed && native->verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOff) { native->document()->setTextWidth(q->size().width()); @@ -84,7 +84,7 @@ TextBrowser::TextBrowser(QGraphicsWidget *parent) connect(native, SIGNAL(textChanged()), this, SIGNAL(textChanged())); connect(native, SIGNAL(textChanged()), this, SLOT(setFixedHeight())); native->setWindowIcon(QIcon()); - setWidget(native); + d->setWidget(native); d->native = native; native->setAttribute(Qt::WA_NoSystemBackground); native->setFrameShape(QFrame::NoFrame); @@ -114,12 +114,12 @@ QString TextBrowser::text() const void TextBrowser::setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy policy) { - d->native->setHorizontalScrollBarPolicy(policy); + nativeWidget()->setHorizontalScrollBarPolicy(policy); } void TextBrowser::setVerticalScrollBarPolicy(Qt::ScrollBarPolicy policy) { - d->native->setVerticalScrollBarPolicy(policy); + nativeWidget()->setVerticalScrollBarPolicy(policy); } void TextBrowser::setStyleSheet(const QString &stylesheet) @@ -173,8 +173,8 @@ void TextBrowser::resizeEvent(QGraphicsSceneResizeEvent *event) void TextBrowser::wheelEvent(QGraphicsSceneWheelEvent *event) { - if (d->native->verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOff && - d->native->horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOff) { + if (nativeWidget()->verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOff && + nativeWidget()->horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOff) { event->ignore(); } else { QGraphicsProxyWidget::wheelEvent(event); From 3948cfb8cf01665122fd8c185dd0196f9490993c Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Sun, 4 Dec 2011 14:00:02 +0100 Subject: [PATCH 25/25] use d->setWidget which notes that it's not a palette customization --- widgets/checkbox.cpp | 2 +- widgets/combobox.cpp | 2 +- widgets/groupbox.cpp | 2 +- widgets/label.cpp | 2 +- widgets/lineedit.cpp | 2 +- widgets/radiobutton.cpp | 2 +- widgets/spinbox.cpp | 2 +- widgets/textedit.cpp | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/widgets/checkbox.cpp b/widgets/checkbox.cpp index 98a2fa5de..e37405454 100644 --- a/widgets/checkbox.cpp +++ b/widgets/checkbox.cpp @@ -87,7 +87,7 @@ CheckBox::CheckBox(QGraphicsWidget *parent) { QCheckBox *native = new QCheckBox; connect(native, SIGNAL(toggled(bool)), this, SIGNAL(toggled(bool))); - setWidget(native); + d->setWidget(native); native->setWindowIcon(QIcon()); native->setAttribute(Qt::WA_NoSystemBackground); diff --git a/widgets/combobox.cpp b/widgets/combobox.cpp index 48a492346..d52eb0ab7 100644 --- a/widgets/combobox.cpp +++ b/widgets/combobox.cpp @@ -166,7 +166,7 @@ void ComboBox::setNativeWidget(KComboBox *nativeWidget) connect(nativeWidget, SIGNAL(currentIndexChanged(const QString &)), this, SIGNAL(textChanged(const QString &))); - setWidget(nativeWidget); + d->setWidget(nativeWidget); nativeWidget->setWindowIcon(QIcon()); nativeWidget->setAttribute(Qt::WA_NoSystemBackground); diff --git a/widgets/groupbox.cpp b/widgets/groupbox.cpp index 4b8379c7f..0abc2ca61 100644 --- a/widgets/groupbox.cpp +++ b/widgets/groupbox.cpp @@ -50,7 +50,7 @@ GroupBox::GroupBox(QGraphicsWidget *parent) d(new GroupBoxPrivate(this)) { QGroupBox *native = new QGroupBox; - setWidget(native); + d->setWidget(native); native->setWindowIcon(QIcon()); native->setAttribute(Qt::WA_NoSystemBackground); d->initTheming(); diff --git a/widgets/label.cpp b/widgets/label.cpp index b73aacb57..a216c6bd7 100644 --- a/widgets/label.cpp +++ b/widgets/label.cpp @@ -105,7 +105,7 @@ Label::Label(QGraphicsWidget *parent) connect(native, SIGNAL(linkActivated(QString)), this, SIGNAL(linkActivated(QString))); connect(native, SIGNAL(linkHovered(QString)), this, SIGNAL(linkHovered(QString))); - setWidget(native); + d->setWidget(native); d->initTheming(); } diff --git a/widgets/lineedit.cpp b/widgets/lineedit.cpp index 708ef3a70..d000439bf 100644 --- a/widgets/lineedit.cpp +++ b/widgets/lineedit.cpp @@ -130,7 +130,7 @@ void LineEdit::setNativeWidget(KLineEdit *nativeWidget) nativeWidget->setWindowFlags(nativeWidget->windowFlags()|Qt::BypassGraphicsProxyWidget); - setWidget(nativeWidget); + d->setWidget(nativeWidget); nativeWidget->setWindowIcon(QIcon()); nativeWidget->setAttribute(Qt::WA_NoSystemBackground); diff --git a/widgets/radiobutton.cpp b/widgets/radiobutton.cpp index dd9952b18..67e08288c 100644 --- a/widgets/radiobutton.cpp +++ b/widgets/radiobutton.cpp @@ -77,7 +77,7 @@ RadioButton::RadioButton(QGraphicsWidget *parent) { QRadioButton *native = new QRadioButton; connect(native, SIGNAL(toggled(bool)), this, SIGNAL(toggled(bool))); - setWidget(native); + d->setWidget(native); native->setWindowIcon(QIcon()); native->setAttribute(Qt::WA_NoSystemBackground); d->initTheming(); diff --git a/widgets/spinbox.cpp b/widgets/spinbox.cpp index bacdabdca..9c1c3fe66 100644 --- a/widgets/spinbox.cpp +++ b/widgets/spinbox.cpp @@ -67,7 +67,7 @@ SpinBox::SpinBox(QGraphicsWidget *parent) d->focusIndicator = new FocusIndicator(this, "widgets/lineedit"); - setWidget(native); + d->setWidget(native); native->setWindowIcon(QIcon()); native->setAttribute(Qt::WA_NoSystemBackground); native->setAutoFillBackground(false); diff --git a/widgets/textedit.cpp b/widgets/textedit.cpp index 633aec694..271f6cbfc 100644 --- a/widgets/textedit.cpp +++ b/widgets/textedit.cpp @@ -108,7 +108,7 @@ void TextEdit::setNativeWidget(KTextEdit *nativeWidget) connect(nativeWidget, SIGNAL(textChanged()), this, SIGNAL(textChanged())); nativeWidget->setWindowIcon(QIcon()); - setWidget(nativeWidget); + d->setWidget(nativeWidget); nativeWidget->setAttribute(Qt::WA_NoSystemBackground); nativeWidget->setFrameShape(QFrame::NoFrame);