From 55679ada12d60f3c7626387e24dc20f14fb4f3d6cbae61435bdc4c9fad38650b Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Mon, 27 Jan 2020 10:24:00 +0000 Subject: [PATCH] - bsc#1161365: Add lxqt-globalkeys-0.14.1-fix-qt.5.14.patch OBS-URL: https://build.opensuse.org/package/show/X11:LXQt/lxqt-globalkeys?expand=0&rev=15 --- lxqt-globalkeys-0.14.1-fix-qt.5.14.patch | 124 +++++++++++++++++++++++ lxqt-globalkeys.changes | 5 + lxqt-globalkeys.spec | 5 +- 3 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 lxqt-globalkeys-0.14.1-fix-qt.5.14.patch diff --git a/lxqt-globalkeys-0.14.1-fix-qt.5.14.patch b/lxqt-globalkeys-0.14.1-fix-qt.5.14.patch new file mode 100644 index 0000000..56e36e2 --- /dev/null +++ b/lxqt-globalkeys-0.14.1-fix-qt.5.14.patch @@ -0,0 +1,124 @@ +From c9ec69850428e599fba282c32e51868b815e3019 Mon Sep 17 00:00:00 2001 +From: Chih-Hsuan Yen +Date: Sun, 15 Dec 2019 09:33:12 +0800 +Subject: [PATCH] Fix building with Qt 5.14 + +--- + daemon/core.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/daemon/core.cpp b/daemon/core.cpp +index 1be64ec..53bdf7b 100644 +--- a/daemon/core.cpp ++++ b/daemon/core.cpp +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include + + #include + #include +From 4169bbc9a8d64683fb028b1e87253379afc14cff Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lu=C3=ADs=20Pereira?= +Date: Thu, 12 Dec 2019 16:04:38 +0000 +Subject: [PATCH] Remove obsolete qBinaryFind + +Use std::lower_bound instead. +--- + config/default_model.cpp | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +diff --git a/config/default_model.cpp b/config/default_model.cpp +index 852971e..360d708 100644 +--- a/config/default_model.cpp ++++ b/config/default_model.cpp +@@ -29,6 +29,8 @@ + #include "default_model.h" + #include "actions.h" + ++#include ++ + + DefaultModel::DefaultModel(Actions *actions, const QColor &grayedOutColour, const QFont &highlightedFont, const QFont &italicFont, const QFont &highlightedItalicFont, QObject *parent) + : QAbstractTableModel(parent) +@@ -223,7 +225,7 @@ void DefaultModel::actionAdded(qulonglong id) + if (result.first) + { + QList keys = mContent.keys(); +- int row = qBinaryFind(keys, mContent.lowerBound(id).key()) - keys.constBegin(); ++ int row = std::lower_bound(keys.constBegin(), keys.constEnd(), mContent.lowerBound(id).key()) - keys.constBegin(); + + beginInsertRows(QModelIndex(), row, row); + +@@ -237,7 +239,7 @@ void DefaultModel::actionAdded(qulonglong id) + { + if (id != siblingId) + { +- int siblingRow = qBinaryFind(keys, siblingId) - keys.constBegin(); ++ int siblingRow = std::lower_bound(keys.constBegin(), keys.constEnd(), siblingId) - keys.constBegin(); + emit dataChanged(index(siblingRow, 1), index(siblingRow, 1)); + } + } +@@ -250,7 +252,7 @@ void DefaultModel::actionEnabled(qulonglong id, bool enabled) + if (mContent.contains(id)) + { + QList keys = mContent.keys(); +- int row = qBinaryFind(keys, id) - keys.constBegin(); ++ int row = std::lower_bound(keys.constBegin(), keys.constEnd(), id) - keys.constBegin(); + + mContent[id].enabled = enabled; + +@@ -266,7 +268,7 @@ void DefaultModel::actionModified(qulonglong id) + if (result.first) + { + QList keys = mContent.keys(); +- int row = qBinaryFind(keys, id) - keys.constBegin(); ++ int row = std::lower_bound(keys.constBegin(), keys.constEnd(), id) - keys.constBegin(); + + if (mContent[id].shortcut != result.second.shortcut) + { +@@ -274,12 +276,12 @@ void DefaultModel::actionModified(qulonglong id) + mShortcuts[mContent[id].shortcut].remove(id); + for(qulonglong siblingId : qAsConst(mShortcuts[mContent[id].shortcut])) + { +- int siblingRow = qBinaryFind(keys, siblingId) - keys.constBegin(); ++ int siblingRow = std::lower_bound(keys.constBegin(), keys.constEnd(), siblingId) - keys.constBegin(); + emit dataChanged(index(siblingRow, 1), index(siblingRow, 1)); + } + for(qulonglong siblingId : qAsConst(mShortcuts[result.second.shortcut])) + { +- int siblingRow = qBinaryFind(keys, siblingId) - keys.constBegin(); ++ int siblingRow = std::lower_bound(keys.constBegin(), keys.constEnd(), siblingId) - keys.constBegin(); + emit dataChanged(index(siblingRow, 1), index(siblingRow, 1)); + } + } +@@ -296,8 +298,8 @@ void DefaultModel::actionsSwapped(qulonglong id1, qulonglong id2) + if (mContent.contains(id1) && mContent.contains(id2)) + { + QList keys = mContent.keys(); +- int row1 = qBinaryFind(keys, id1) - keys.constBegin(); +- int row2 = qBinaryFind(keys, id2) - keys.constBegin(); ++ int row1 = std::lower_bound(keys.constBegin(), keys.constEnd(), id1) - keys.constBegin(); ++ int row2 = std::lower_bound(keys.constBegin(), keys.constEnd(), id2) - keys.constBegin(); + + // swap + GeneralActionInfo tmp = mContent[id1]; +@@ -314,7 +316,7 @@ void DefaultModel::actionRemoved(qulonglong id) + if (mContent.contains(id)) + { + QList keys = mContent.keys(); +- int row = qBinaryFind(keys, id) - keys.constBegin(); ++ int row = std::lower_bound(keys.constBegin(), keys.constEnd(), id) - keys.constBegin(); + + beginRemoveRows(QModelIndex(), row, row); + +@@ -327,7 +329,7 @@ void DefaultModel::actionRemoved(qulonglong id) + + for(qulonglong siblingId : qAsConst(mShortcuts[shortcut])) + { +- int siblingRow = qBinaryFind(keys, siblingId) - keys.constBegin(); ++ int siblingRow = std::lower_bound(keys.constBegin(), keys.constEnd(), siblingId) - keys.constBegin(); + emit dataChanged(index(siblingRow, 1), index(siblingRow, 1)); + } + } diff --git a/lxqt-globalkeys.changes b/lxqt-globalkeys.changes index 80de134..082e96d 100644 --- a/lxqt-globalkeys.changes +++ b/lxqt-globalkeys.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jan 27 10:19:54 UTC 2020 - Michael Vetter + +- bsc#1161365: Add lxqt-globalkeys-0.14.1-fix-qt.5.14.patch + ------------------------------------------------------------------- Thu Oct 17 06:31:35 UTC 2019 - Michael Vetter diff --git a/lxqt-globalkeys.spec b/lxqt-globalkeys.spec index b0de285..c6adaa4 100644 --- a/lxqt-globalkeys.spec +++ b/lxqt-globalkeys.spec @@ -1,7 +1,7 @@ # # spec file for package lxqt-globalkeys # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,6 +24,7 @@ License: LGPL-2.1-or-later URL: https://www.lxqt.org Source: https://github.com/lxde/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz Source1: https://github.com/lxde/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz.asc +Patch0: lxqt-globalkeys-0.14.1-fix-qt.5.14.patch Source2: %{name}.keyring BuildRequires: cmake >= 3.1.0 BuildRequires: fdupes @@ -32,6 +33,7 @@ BuildRequires: lxqt-build-tools-devel >= 0.6.0 BuildRequires: pkgconfig BuildRequires: cmake(KF5WindowSystem) BuildRequires: pkgconfig(Qt5UiTools) +BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(lxqt) >= 0.14.1 Requires(post): desktop-file-utils Requires(pre): desktop-file-utils @@ -68,6 +70,7 @@ UI system libraries for lxqt-globalkeys %prep %setup -q +%patch0 -p1 # Changing LXQt into X-LXQt in desktop files to be freedesktop compliant and shut rpmlint warnings #find -name '*desktop.in*' -exec sed -ri 's/(LXQt;)/X-\1/' {} +