commit:     a5decb2f6b741174c2906759260db3fac6beb96d
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 15 19:50:26 2017 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Apr 15 20:31:21 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5decb2f

kde-frameworks/plasma: Add upstream fixes

- Wrong/weird toolbox icon sizes
- Wrong language locale in calendar popup
- Plasmashell runtime crashes caused by systray applets

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 .../files/plasma-5.33.0-calendar-locale.patch      |  49 ++++++
 .../plasma/files/plasma-5.33.0-iconsize.patch      | 164 +++++++++++++++++++++
 .../plasma-5.33.0-systray-crash-plasmashell.patch  |  55 +++++++
 kde-frameworks/plasma/plasma-5.33.0-r1.ebuild      |  76 ++++++++++
 4 files changed, 344 insertions(+)

diff --git a/kde-frameworks/plasma/files/plasma-5.33.0-calendar-locale.patch 
b/kde-frameworks/plasma/files/plasma-5.33.0-calendar-locale.patch
new file mode 100644
index 00000000000..554ac228d65
--- /dev/null
+++ b/kde-frameworks/plasma/files/plasma-5.33.0-calendar-locale.patch
@@ -0,0 +1,49 @@
+commit a01e4fb69efeb7a803e6d3a272c62224d7df2494
+Author: David Rosca <now...@gmail.com>
+Date:   Sat Apr 8 10:40:27 2017 +0200
+
+    Calendar: Use correct language for month and day names
+    
+    Apply fix for bug 353715 also on QML side.
+    
+    Differential Revision: https://phabricator.kde.org/D5345
+
+diff --git a/src/declarativeimports/calendar/qml/DaysCalendar.qml 
b/src/declarativeimports/calendar/qml/DaysCalendar.qml
+index 02b23b6e5..2b3ce446c 100644
+--- a/src/declarativeimports/calendar/qml/DaysCalendar.qml
++++ b/src/declarativeimports/calendar/qml/DaysCalendar.qml
+@@ -312,7 +312,7 @@ Item {
+             Components.Label {
+                 width: daysCalendar.cellWidth
+                 height: daysCalendar.cellHeight
+-                text: Qt.locale().dayName(calendarBackend.firstDayOfWeek + 
index, Locale.ShortFormat)
++                text: 
Qt.locale(Qt.locale().uiLanguages[0]).dayName(calendarBackend.firstDayOfWeek + 
index, Locale.ShortFormat)
+                 font.pixelSize: Math.max(theme.smallestFont.pixelSize, 
daysCalendar.cellHeight / 3)
+                 opacity: 0.4
+                 horizontalAlignment: Text.AlignHCenter
+diff --git a/src/declarativeimports/calendar/qml/MonthMenu.qml 
b/src/declarativeimports/calendar/qml/MonthMenu.qml
+index aa5d3b46d..beddf6852 100644
+--- a/src/declarativeimports/calendar/qml/MonthMenu.qml
++++ b/src/declarativeimports/calendar/qml/MonthMenu.qml
+@@ -28,7 +28,7 @@ PlasmaComponents.Menu {
+     property Instantiator items: Instantiator {
+         model: 12
+         PlasmaComponents.MenuItem {
+-            text: 
capitalizeFirstLetter(Qt.locale().standaloneMonthName(index))
++            text: 
capitalizeFirstLetter(Qt.locale(Qt.locale().uiLanguages[0]).standaloneMonthName(index))
+             onClicked: calendarBackend.displayedDate = new Date(year, index, 
1)
+         }
+         onObjectAdded: testMenu.addMenuItem(object)
+diff --git a/src/declarativeimports/calendar/qml/MonthView.qml 
b/src/declarativeimports/calendar/qml/MonthView.qml
+index a2229e5f2..e3c0e95d0 100644
+--- a/src/declarativeimports/calendar/qml/MonthView.qml
++++ b/src/declarativeimports/calendar/qml/MonthView.qml
+@@ -143,7 +143,7 @@ PinchArea {
+         Component.onCompleted: {
+             for (var i = 0; i < 12; ++i) {
+                 append({
+-                    label: Qt.locale().standaloneMonthName(i, 
Locale.LongFormat),
++                    label: 
Qt.locale(Qt.locale().uiLanguages[0]).standaloneMonthName(i, Locale.LongFormat),
+                     monthNumber: i + 1,
+                     isCurrent: true
+                 })

diff --git a/kde-frameworks/plasma/files/plasma-5.33.0-iconsize.patch 
b/kde-frameworks/plasma/files/plasma-5.33.0-iconsize.patch
new file mode 100644
index 00000000000..b74c8224fde
--- /dev/null
+++ b/kde-frameworks/plasma/files/plasma-5.33.0-iconsize.patch
@@ -0,0 +1,164 @@
+commit fb8ed07651a7101c2f9c41c6e6676ac8196c1225
+Author: Marco Martin <notm...@gmail.com>
+Date:   Mon Apr 3 15:42:29 2017 +0200
+
+    if the user did set an implicit size, keep it
+    
+    Summary:
+    if the user code did something like
+    IconItem {
+       implicitWidth: 32
+       implicitHeight: 32
+    }
+    
+    then never automatically update implicitWidth or height.
+    this favors compatibility and fixes the desktop
+    toolbox appearance
+    
+    Test Plan:
+    textbox works, other icon items in plasmashell seems properly sized.
+    applet alternatives fix is still needed
+    
+    Reviewers: #plasma, hein
+    
+    Reviewed By: #plasma, hein
+    
+    Subscribers: hein, davidedmundson, plasma-devel, #frameworks
+    
+    Tags: #plasma, #frameworks
+    
+    Differential Revision: https://phabricator.kde.org/D5243
+
+diff --git a/src/declarativeimports/core/iconitem.cpp 
b/src/declarativeimports/core/iconitem.cpp
+index e1666aa32..2b96c619d 100644
+--- a/src/declarativeimports/core/iconitem.cpp
++++ b/src/declarativeimports/core/iconitem.cpp
+@@ -49,6 +49,8 @@ IconItem::IconItem(QQuickItem *parent)
+       m_sizeChanged(false),
+       m_allowNextAnimation(false),
+       m_blockNextAnimation(false),
++      m_implicitHeightSetByUser(false),
++      m_implicitWidthSetByUser(false),
+       m_colorGroup(Plasma::Theme::NormalColorGroup),
+       m_animValue(0)
+ {
+@@ -75,6 +77,9 @@ IconItem::IconItem(QQuickItem *parent)
+     connect(this, SIGNAL(overlaysChanged()),
+             this, SLOT(schedulePixmapUpdate()));
+ 
++    connect(this, &IconItem::implicitWidthChanged, this, 
&IconItem::implicitWidthChanged2);
++    connect(this, &IconItem::implicitHeightChanged, this, 
&IconItem::implicitHeightChanged2);
++
+     updateImplicitSize();
+ }
+ 
+@@ -88,7 +93,13 @@ void IconItem::updateImplicitSize()
+         const QSize &s = m_imageIcon.size();
+ 
+         if (s.isValid()) {
+-            setImplicitSize(s.width(), s.height());
++            if (!m_implicitWidthSetByUser && !m_implicitHeightSetByUser) {
++                setImplicitSize(s.width(), s.height());
++            } else if (!m_implicitWidthSetByUser) {
++                setImplicitWidth(s.width());
++            } else if (!m_implicitHeightSetByUser) {
++                setImplicitHeight(s.height());
++            }
+ 
+             return;
+         }
+@@ -105,7 +116,13 @@ void IconItem::updateImplicitSize()
+             s = m_svgIcon->size();
+         }
+         if (s.isValid()) {
+-            setImplicitSize(s.width(), s.height());
++            if (!m_implicitWidthSetByUser && !m_implicitHeightSetByUser) {
++                setImplicitSize(s.width(), s.height());
++            } else if (!m_implicitWidthSetByUser) {
++                setImplicitWidth(s.width());
++            } else if (!m_implicitHeightSetByUser) {
++                setImplicitHeight(s.height());
++            }
+ 
+             return;
+         }
+@@ -113,7 +130,14 @@ void IconItem::updateImplicitSize()
+ 
+     // Fall back to initializing implicit size to the Dialog size.
+     const int implicitSize = 
KIconLoader::global()->currentSize(KIconLoader::Dialog);
+-    setImplicitSize(implicitSize, implicitSize);
++
++    if (!m_implicitWidthSetByUser && !m_implicitHeightSetByUser) {
++        setImplicitSize(implicitSize, implicitSize);
++    } else if (!m_implicitWidthSetByUser) {
++        setImplicitWidth(implicitSize);
++    } else if (!m_implicitHeightSetByUser) {
++        setImplicitHeight(implicitSize);
++    }
+ }
+ 
+ void IconItem::setSource(const QVariant &source)
+@@ -418,6 +442,20 @@ Plasma::Svg::Status IconItem::status() const
+     return m_status;
+ }
+ 
++void IconItem::setImplicitHeight2(int height)
++{
++    m_implicitHeightSetByUser = true;
++    setImplicitHeight(height);
++    emit implicitHeightChanged2();
++}
++
++void IconItem::setImplicitWidth2(int width)
++{
++    m_implicitWidthSetByUser = true;
++    setImplicitWidth(width);
++    emit implicitWidthChanged2();
++}
++
+ void IconItem::updatePolish()
+ {
+     QQuickItem::updatePolish();
+diff --git a/src/declarativeimports/core/iconitem.h 
b/src/declarativeimports/core/iconitem.h
+index e4b2a959d..8b524e7a0 100644
+--- a/src/declarativeimports/core/iconitem.h
++++ b/src/declarativeimports/core/iconitem.h
+@@ -119,6 +119,10 @@ class IconItem : public QQuickItem
+      */
+     Q_PROPERTY(int paintedHeight READ paintedHeight NOTIFY paintedSizeChanged)
+ 
++    Q_PROPERTY(int implicitHeight READ implicitHeight WRITE 
setImplicitHeight2 NOTIFY implicitHeightChanged2)
++
++    Q_PROPERTY(int implicitWidth READ implicitWidth WRITE setImplicitWidth2 
NOTIFY implicitWidthChanged2)
++
+ public:
+     IconItem(QQuickItem *parent = 0);
+     ~IconItem();
+@@ -155,6 +159,9 @@ public:
+     void setStatus(Plasma::Svg::Status status);
+     Plasma::Svg::Status status() const;
+ 
++    void setImplicitHeight2(int height);
++    void setImplicitWidth2(int height);
++
+     void updatePolish() Q_DECL_OVERRIDE;
+     QSGNode* updatePaintNode(QSGNode * oldNode, UpdatePaintNodeData * 
updatePaintNodeData) Q_DECL_OVERRIDE;
+ 
+@@ -176,6 +183,8 @@ Q_SIGNALS:
+     void colorGroupChanged();
+     void paintedSizeChanged();
+     void statusChanged();
++    void implicitHeightChanged2();
++    void implicitWidthChanged2();
+ 
+ private Q_SLOTS:
+     void schedulePixmapUpdate();
+@@ -210,6 +219,8 @@ private:
+     bool m_sizeChanged;
+     bool m_allowNextAnimation;
+     bool m_blockNextAnimation;
++    bool m_implicitHeightSetByUser;
++    bool m_implicitWidthSetByUser;
+ 
+     QPixmap m_iconPixmap;
+     QPixmap m_oldIconPixmap;

diff --git 
a/kde-frameworks/plasma/files/plasma-5.33.0-systray-crash-plasmashell.patch 
b/kde-frameworks/plasma/files/plasma-5.33.0-systray-crash-plasmashell.patch
new file mode 100644
index 00000000000..64a50b9c164
--- /dev/null
+++ b/kde-frameworks/plasma/files/plasma-5.33.0-systray-crash-plasmashell.patch
@@ -0,0 +1,55 @@
+commit 1387b5efe31e330777c8ffd9029f79063cc7a7a9
+Author: David Edmundson <k...@davidedmundson.co.uk>
+Date:   Thu Apr 13 10:41:40 2017 +0100
+
+    Guard against Applet not loading AppletInterface
+    
+    Summary:
+    This can happen if an applet has invalid metadata, it doesn't have a
+    script engine set (X-Plasma-API) so it won't load the 
DeclarativeAppletScripts
+    Having invalid metadata could come from the applet, or from the fallback 
applet
+    created in Containment::Private::createApplet.
+    
+    We guard against it in appletAdded but not in appletRemoved, which is
+    inconsistent. We also apparently must have guards elsewhere otherwise
+    we'd see the crash more.
+    
+    BUG: 377050
+    
+    Test Plan: Had corrupt applet, used to crash, now doesn't
+    
+    Reviewers: #plasma
+    
+    Subscribers: plasma-devel, #frameworks
+    
+    Tags: #plasma, #frameworks
+    
+    Differential Revision: https://phabricator.kde.org/D5423
+
+diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp 
b/src/scriptengines/qml/plasmoid/containmentinterface.cpp
+index 2ba4a8218..e311f6018 100644
+--- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp
++++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp
+@@ -821,7 +821,8 @@ void 
ContainmentInterface::appletAddedForward(Plasma::Applet *applet)
+ //     qDebug() << "Applet added on containment:" << m_containment->title() 
<< contGraphicObject
+ //              << "Applet: " << applet << applet->title() << 
appletGraphicObject;
+ 
+-    //Every applet should have a graphics object, otherwise don't disaplay 
anything
++    //applets can not have a graphic object if they don't have a script 
engine loaded
++    //this can happen if they were loaded with an invalid metadata
+     if (!appletGraphicObject) {
+         return;
+     }
+@@ -843,8 +844,10 @@ void 
ContainmentInterface::appletAddedForward(Plasma::Applet *applet)
+ void ContainmentInterface::appletRemovedForward(Plasma::Applet *applet)
+ {
+     AppletInterface *appletGraphicObject = 
applet->property("_plasma_graphicObject").value<AppletInterface *>();
+-    m_appletInterfaces.removeAll(appletGraphicObject);
+-    appletGraphicObject->m_positionBeforeRemoval = 
appletGraphicObject->mapToItem(this, QPointF());
++    if (appletGraphicObject) {
++        m_appletInterfaces.removeAll(appletGraphicObject);
++        appletGraphicObject->m_positionBeforeRemoval = 
appletGraphicObject->mapToItem(this, QPointF());
++    }
+     emit appletRemoved(appletGraphicObject);
+     emit appletsChanged();
+ }

diff --git a/kde-frameworks/plasma/plasma-5.33.0-r1.ebuild 
b/kde-frameworks/plasma/plasma-5.33.0-r1.ebuild
new file mode 100644
index 00000000000..c2e74f8b08e
--- /dev/null
+++ b/kde-frameworks/plasma/plasma-5.33.0-r1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+KMNAME="${PN}-framework"
+VIRTUALX_REQUIRED="test"
+inherit kde5
+
+DESCRIPTION="Plasma framework"
+LICENSE="LGPL-2+"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="gles2 wayland X"
+
+COMMON_DEPEND="
+       $(add_frameworks_dep kactivities)
+       $(add_frameworks_dep karchive)
+       $(add_frameworks_dep kconfig)
+       $(add_frameworks_dep kconfigwidgets)
+       $(add_frameworks_dep kcoreaddons)
+       $(add_frameworks_dep kdeclarative)
+       $(add_frameworks_dep kglobalaccel)
+       $(add_frameworks_dep kguiaddons)
+       $(add_frameworks_dep ki18n)
+       $(add_frameworks_dep kiconthemes)
+       $(add_frameworks_dep kio)
+       $(add_frameworks_dep knotifications)
+       $(add_frameworks_dep kpackage)
+       $(add_frameworks_dep kservice)
+       $(add_frameworks_dep kwindowsystem)
+       $(add_frameworks_dep kxmlgui)
+       $(add_qt_dep qtdbus)
+       $(add_qt_dep qtdeclarative)
+       $(add_qt_dep qtgui 'gles2=')
+       $(add_qt_dep qtquickcontrols)
+       $(add_qt_dep qtsql)
+       $(add_qt_dep qtsvg)
+       $(add_qt_dep qtwidgets)
+       !gles2? ( virtual/opengl )
+       wayland? (
+               $(add_frameworks_dep kwayland)
+               media-libs/mesa[egl]
+       )
+       X? (
+               $(add_qt_dep qtx11extras)
+               x11-libs/libX11
+               x11-libs/libxcb
+       )
+"
+DEPEND="${COMMON_DEPEND}
+       $(add_frameworks_dep kdoctools)
+       X? ( x11-proto/xproto )
+"
+RDEPEND="${COMMON_DEPEND}
+       !<kde-apps/kapptemplate-15.08.3-r1:5
+"
+
+RESTRICT+=" test"
+
+PATCHES=(
+       "${FILESDIR}/${P}-iconsize.patch"
+       "${FILESDIR}/${P}-calendar-locale.patch"
+       "${FILESDIR}/${P}-systray-crash-plasmashell.patch"
+)
+
+src_configure() {
+       local mycmakeargs=(
+               $(cmake-utils_use_find_package !gles2 OpenGL)
+               $(cmake-utils_use_find_package wayland EGL)
+               $(cmake-utils_use_find_package wayland KF5Wayland)
+               $(cmake-utils_use_find_package X X11)
+               $(cmake-utils_use_find_package X XCB)
+       )
+
+       kde5_src_configure
+}

Reply via email to