backport some upstream patches, .spec cosmetics

This commit is contained in:
Rex Dieter 2015-07-28 12:17:58 -05:00
parent aceb0dbbbe
commit c6d2b5bb9d
7 changed files with 253 additions and 13 deletions

View File

@ -0,0 +1,44 @@
From f399aa8b48db02f809454be5427c0ca01b809882 Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Tue, 7 Jul 2015 11:54:11 +0100
Subject: [PATCH 1/6] Only resize plot texture if size actually changes
Test compared rounded QSize with QSizeF, which will be almost always
returning true.
CCBUG: 348385
REVIEW: 124280
---
src/qmlcontrols/kquickcontrolsaddons/plotter.cpp | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/qmlcontrols/kquickcontrolsaddons/plotter.cpp b/src/qmlcontrols/kquickcontrolsaddons/plotter.cpp
index 9a939c3..93da3c7 100644
--- a/src/qmlcontrols/kquickcontrolsaddons/plotter.cpp
+++ b/src/qmlcontrols/kquickcontrolsaddons/plotter.cpp
@@ -799,16 +799,15 @@ QSGNode *Plotter::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updateP
u_matrix = s_program->uniformLocation("matrix");
}
- if (n->texture()->textureSize() != boundingRect().size()) {
- //we need a size always equal or smaller, size.toSize() won't do
- static_cast<PlotTexture *>(n->texture())->recreate(QSize(qRound(boundingRect().size().width()), qRound(boundingRect().size().height())));
+ //we need a size always equal or smaller, size.toSize() won't do
+ const QSize targetTextureSize(qRound(boundingRect().size().width()), qRound(boundingRect().size().height()));
+ if (n->texture()->textureSize() != targetTextureSize) {
+ static_cast<PlotTexture *>(n->texture())->recreate(targetTextureSize);
m_matrix = QMatrix4x4();
- m_matrix.ortho(0, qRound(width()), 0, qRound(height()), -1, 1);
+ m_matrix.ortho(0, targetTextureSize.width(), 0, targetTextureSize.height(), -1, 1);
}
- n->setRect(QRect(QPoint(0,0),
- QSize(qRound(boundingRect().size().width()),
- qRound(boundingRect().size().height()))));
+ n->setRect(QRect(QPoint(0,0), targetTextureSize));
return n;
}
--
1.9.3

View File

@ -0,0 +1,25 @@
From 12d8398896207c602bafdffcbef053cd9579ce08 Mon Sep 17 00:00:00 2001
From: l10n daemon script <scripty@kde.org>
Date: Fri, 10 Jul 2015 10:12:12 +0000
Subject: [PATCH 2/6] Upgrade KF5 version to 5.13.0.
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 359a899..d440172 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,7 @@ feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKA
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
set(REQUIRED_QT_VERSION "5.2.0")
-set(KF5_VERSION "5.12.0") # handled by release scripts
+set(KF5_VERSION "5.13.0") # handled by release scripts
set(KF5_DEP_VERSION "5.12.0") # handled by release scripts
find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Qml Quick Gui)
--
1.9.3

View File

@ -0,0 +1,44 @@
From 78b455d447c14d782b8a7fcf01ea122a98f40edc Mon Sep 17 00:00:00 2001
From: Aleix Pol <aleixpol@kde.org>
Date: Wed, 15 Jul 2015 17:22:27 +0200
Subject: [PATCH 3/6] Don't choke on empty QIconItem
Sometimes QML components have 0 width and height and that's perfectly fine.
If we try to paint it, we get warnings such as:
`QPainter::begin: Paint device returned engine == 0, type: 2`
REVIEW: 124306
---
src/qmlcontrols/kquickcontrolsaddons/qiconitem.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/qmlcontrols/kquickcontrolsaddons/qiconitem.cpp b/src/qmlcontrols/kquickcontrolsaddons/qiconitem.cpp
index 3a9dd17..2a90c34 100644
--- a/src/qmlcontrols/kquickcontrolsaddons/qiconitem.cpp
+++ b/src/qmlcontrols/kquickcontrolsaddons/qiconitem.cpp
@@ -118,7 +118,6 @@ QSGNode* QIconItem::updatePaintNode(QSGNode* node, QQuickItem::UpdatePaintNodeDa
mNode = new ManagedTextureNode;
}
- const QSize size(width(), height());
QIcon::Mode mode;
switch(m_state) {
case DefaultState:
@@ -132,7 +131,12 @@ QSGNode* QIconItem::updatePaintNode(QSGNode* node, QQuickItem::UpdatePaintNodeDa
break;
}
- mNode->setTexture(s_iconImageCache->loadTexture(window(), m_icon.pixmap(size, mode, QIcon::On).toImage()));
+ QImage img;
+ const QSize size(width(), height());
+ if (!size.isEmpty()) {
+ img = m_icon.pixmap(size, mode, QIcon::On).toImage();
+ }
+ mNode->setTexture(s_iconImageCache->loadTexture(window(), img));
mNode->setRect(QRect(QPoint(0,0), size));
node = mNode;
}
--
1.9.3

View File

@ -0,0 +1,39 @@
From b449460131aa342ff8405e508345957116b87baf Mon Sep 17 00:00:00 2001
From: Marco Martin <notmart@gmail.com>
Date: Tue, 21 Jul 2015 18:58:28 +0200
Subject: [PATCH 4/6] add the userPaths context property
some user paths for pictures, movies etc, from QStandardPaths
---
src/kpackagelauncherqml/main.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/kpackagelauncherqml/main.cpp b/src/kpackagelauncherqml/main.cpp
index ba4559b..9d9cbbc 100644
--- a/src/kpackagelauncherqml/main.cpp
+++ b/src/kpackagelauncherqml/main.cpp
@@ -31,6 +31,7 @@
#include <QQmlExpression>
#include <QQmlProperty>
#include <QQuickWindow>
+#include <QStandardPaths>
#include <kdeclarative/qmlobject.h>
#include <KAboutData>
@@ -70,6 +71,13 @@ int main(int argc, char **argv)
return 1;
}
obj.engine()->rootContext()->setContextProperty("commandlineArguments", parser.positionalArguments());
+ QVariantMap paths;
+ paths["desktop"] = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
+ paths["documents"] = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
+ paths["music"] = QStandardPaths::writableLocation(QStandardPaths::MusicLocation);
+ paths["movies"] = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation);
+ paths["pictures"] = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
+ obj.engine()->rootContext()->setContextProperty("userPaths", paths);
obj.completeInitialization();
if (!obj.package().metadata().isValid()) {
--
1.9.3

View File

@ -0,0 +1,33 @@
From 7a6a2cda780784e504960c96b4b41241ddf10531 Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Mon, 27 Jul 2015 12:54:17 +0200
Subject: [PATCH 5/6] Don't refresh the entire window when we render the
plotter
This means the window is only updated when the plotter changes, rather
than effectively every possible frame.
Reviewed by: Marco Martin
CCBUG: 348385
---
src/qmlcontrols/kquickcontrolsaddons/plotter.cpp | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/qmlcontrols/kquickcontrolsaddons/plotter.cpp b/src/qmlcontrols/kquickcontrolsaddons/plotter.cpp
index 93da3c7..233dd6b 100644
--- a/src/qmlcontrols/kquickcontrolsaddons/plotter.cpp
+++ b/src/qmlcontrols/kquickcontrolsaddons/plotter.cpp
@@ -709,9 +709,6 @@ void Plotter::render()
// Delete the VBO
glDeleteBuffers(1, &vbo);
- if (window()) {
- window()->update();
- }
}
QSGNode *Plotter::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData)
--
1.9.3

View File

@ -0,0 +1,42 @@
From 1e77e17135b0f1828ca88aecb3cd75c3de111e0a Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Mon, 27 Jul 2015 23:29:36 +0200
Subject: [PATCH 6/6] Detect initial face icon being created
REVIEW: 124499
---
src/qmlcontrols/kcoreaddons/kuserproxy.cpp | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/qmlcontrols/kcoreaddons/kuserproxy.cpp b/src/qmlcontrols/kcoreaddons/kuserproxy.cpp
index 383220f..a0b4425 100644
--- a/src/qmlcontrols/kcoreaddons/kuserproxy.cpp
+++ b/src/qmlcontrols/kcoreaddons/kuserproxy.cpp
@@ -21,6 +21,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "kuserproxy.h"
#include <QFile>
+#include <QDir>
#include <QHostInfo>
#include <QTextStream>
#include <QUrl>
@@ -35,7 +36,15 @@ KUserProxy::KUserProxy (QObject *parent)
: QObject(parent),
m_temporaryEmptyFaceIconPath(false)
{
- m_dirWatch.addFile(m_user.faceIconPath());
+ QString pathToFaceIcon(m_user.faceIconPath());
+ if (pathToFaceIcon.isEmpty()) {
+ //KUser returns null if the current faceIconPath is empty
+ //so we should explicitly watch ~/.face.icon rather than faceIconPath()
+ //as we want to watch for this file being created
+ pathToFaceIcon = QDir::homePath() + QStringLiteral("/.face.icon");
+ }
+
+ m_dirWatch.addFile(pathToFaceIcon);
if (QFile::exists(etcPasswd)) {
m_dirWatch.addFile(etcPasswd);
}
--
1.9.3

View File

@ -2,11 +2,11 @@
Name: kf5-%{framework}
Version: 5.12.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: KDE Frameworks 5 Tier 3 addon for Qt declarative
License: GPLv2+ and MIT
URL: http://www.kde.org
URL: https://projects.kde.org/projects/frameworks/kdeclarative/
%global versiondir %(echo %{version} | cut -d. -f1-2)
%global revision %(echo %{version} | cut -d. -f3)
@ -17,6 +17,14 @@ URL: http://www.kde.org
%endif
Source0: http://download.kde.org/%{stable}/frameworks/%{versiondir}/%{framework}-%{version}.tar.xz
## upstream patches
Patch1: 0001-Only-resize-plot-texture-if-size-actually-changes.patch
#Patch2: 0002-Upgrade-KF5-version-to-5.13.0.patch
Patch3: 0003-Don-t-choke-on-empty-QIconItem.patch
Patch4: 0004-add-the-userPaths-context-property.patch
Patch5: 0005-Don-t-refresh-the-entire-window-when-we-render-the-p.patch
Patch6: 0006-Detect-initial-face-icon-being-created.patch
BuildRequires: kf5-rpm-macros
BuildRequires: extra-cmake-modules
BuildRequires: qt5-qtbase-devel
@ -52,16 +60,18 @@ developing applications that use %{name}.
%prep
%setup -q -n %{framework}-%{version}
%autosetup -p1 -n %{framework}-%{version}
%build
mkdir -p %{_target_platform}
mkdir %{_target_platform}
pushd %{_target_platform}
%{cmake_kf5} ..
popd
make %{?_smp_mflags} -C %{_target_platform}
%install
make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
%find_lang kdeclarative5_qt --with-qt --all-name
@ -75,25 +85,28 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
%{_kf5_bindir}/kpackagelauncherqml
%{_kf5_libdir}/libKF5Declarative.so.*
%{_kf5_libdir}/libKF5QuickAddons.so.*
%{_kf5_qmldir}/org/kde/draganddrop
%{_kf5_qmldir}/org/kde/kcoreaddons
%{_kf5_qmldir}/org/kde/kquickcontrols
%{_kf5_qmldir}/org/kde/kquickcontrolsaddons
%{_kf5_qmldir}/org/kde/private/kquickcontrols
%{_kf5_qmldir}/org/kde/kio
%{_kf5_qmldir}/org/kde/kwindowsystem
%{_kf5_qmldir}/org/kde/draganddrop/
%{_kf5_qmldir}/org/kde/kcoreaddons/
%{_kf5_qmldir}/org/kde/kquickcontrols/
%{_kf5_qmldir}/org/kde/kquickcontrolsaddons/
%{_kf5_qmldir}/org/kde/private/kquickcontrols/
%{_kf5_qmldir}/org/kde/kio/
%{_kf5_qmldir}/org/kde/kwindowsystem/
%files devel
%{_kf5_includedir}/kdeclarative_version.h
%{_kf5_includedir}/KDeclarative
%{_kf5_includedir}/KDeclarative/
%{_kf5_libdir}/libKF5Declarative.so
%{_kf5_libdir}/libKF5QuickAddons.so
%{_kf5_libdir}/cmake/KF5Declarative
%{_kf5_libdir}/cmake/KF5Declarative/
%{_kf5_archdatadir}/mkspecs/modules/qt_KDeclarative.pri
%{_kf5_archdatadir}/mkspecs/modules/qt_QuickAddons.pri
%changelog
* Tue Jul 28 2015 Rex Dieter <rdieter@fedoraproject.org> 5.12.0-2
- backport some upstream patches, .spec cosmetics
* Sun Jul 12 2015 Rex Dieter <rdieter@fedoraproject.org> - 5.12.0-1
- 5.12.0