diff options
Diffstat (limited to 'dev-libs/kreport')
-rw-r--r-- | dev-libs/kreport/files/kreport-3.2.0-Q_REQUIRED_RESULT-placing.patch | 54 | ||||
-rw-r--r-- | dev-libs/kreport/files/kreport-3.2.0-fix-cmake-config.patch | 35 | ||||
-rw-r--r-- | dev-libs/kreport/files/kreport-3.2.0-fix-insane-delay.patch | 166 | ||||
-rw-r--r-- | dev-libs/kreport/files/kreport-3.2.0-gcc12.patch | 26 | ||||
-rw-r--r-- | dev-libs/kreport/kreport-3.2.0-r3.ebuild (renamed from dev-libs/kreport/kreport-3.2.0-r2.ebuild) | 19 |
5 files changed, 294 insertions, 6 deletions
diff --git a/dev-libs/kreport/files/kreport-3.2.0-Q_REQUIRED_RESULT-placing.patch b/dev-libs/kreport/files/kreport-3.2.0-Q_REQUIRED_RESULT-placing.patch new file mode 100644 index 000000000000..bb90243c688e --- /dev/null +++ b/dev-libs/kreport/files/kreport-3.2.0-Q_REQUIRED_RESULT-placing.patch @@ -0,0 +1,54 @@ +From b37de83728dc7463dea37f71417560ae602f615d Mon Sep 17 00:00:00 2001 +From: Jaroslaw Staniek <staniek@kde.org> +Date: Sat, 1 Feb 2020 19:07:52 +0100 +Subject: [PATCH] TRIVIAL Move Q_REQUIRED_RESULT to correct place + +This can fix builds for newer MSVC +--- + src/common/KReportDataSource.h | 2 +- + src/common/KReportPluginManager.h | 2 +- + src/wrtembed/KReportDesigner.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/common/KReportDataSource.h b/src/common/KReportDataSource.h +index 4761af6c..89490b47 100644 +--- a/src/common/KReportDataSource.h ++++ b/src/common/KReportDataSource.h +@@ -124,7 +124,7 @@ public: + //! Creates a new instance with data source. Default implementation returns @c nullptr. + //! @a source is implementation-specific identifier. + //! Owner of the returned pointer is the caller. +- virtual KReportDataSource* create(const QString &source) const Q_REQUIRED_RESULT; ++ virtual Q_REQUIRED_RESULT KReportDataSource* create(const QString &source) const; + + private: + Q_DISABLE_COPY(KReportDataSource) +diff --git a/src/common/KReportPluginManager.h b/src/common/KReportPluginManager.h +index a8c4efcf..9ea01804 100644 +--- a/src/common/KReportPluginManager.h ++++ b/src/common/KReportPluginManager.h +@@ -49,7 +49,7 @@ class KREPORT_EXPORT KReportPluginManager : public QObject + + KReportPluginInterface* plugin(const QString& id) const; + +- QList<QAction*> createActions(QObject *parent) Q_REQUIRED_RESULT; ++ Q_REQUIRED_RESULT QList<QAction*> createActions(QObject *parent); + + private: + // class for access to the constructor +diff --git a/src/wrtembed/KReportDesigner.h b/src/wrtembed/KReportDesigner.h +index 404c8fd4..b5b64a30 100644 +--- a/src/wrtembed/KReportDesigner.h ++++ b/src/wrtembed/KReportDesigner.h +@@ -106,7 +106,7 @@ public: + @return Pointer to a new report section section object, ownership is transferred to + the caller + */ +- KReportDesignerSection* createSection() Q_REQUIRED_RESULT; ++ Q_REQUIRED_RESULT KReportDesignerSection* createSection(); + + /** + @brief Deletes the section specified +-- +GitLab + diff --git a/dev-libs/kreport/files/kreport-3.2.0-fix-cmake-config.patch b/dev-libs/kreport/files/kreport-3.2.0-fix-cmake-config.patch new file mode 100644 index 000000000000..625a05bd7f21 --- /dev/null +++ b/dev-libs/kreport/files/kreport-3.2.0-fix-cmake-config.patch @@ -0,0 +1,35 @@ +From 4ce3e8a857f2540909e1c23b73beef62eb3ab5fa Mon Sep 17 00:00:00 2001 +From: jordi fita i mas <jfita@infoblitz.com> +Date: Sat, 11 Apr 2020 22:37:20 +0200 +Subject: [PATCH] Add Qt5PrintSupport and KF5CoreAddons dependencies to CMake + config + +Reviewers: staniek + +Reviewed By: staniek + +Subscribers: staniek + +Tags: #kreport + +Differential Revision: https://phabricator.kde.org/D28736 +--- + src/KReportConfig.cmake.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/KReportConfig.cmake.in b/src/KReportConfig.cmake.in +index 7d74122b..9828fcc1 100644 +--- a/src/KReportConfig.cmake.in ++++ b/src/KReportConfig.cmake.in +@@ -20,6 +20,8 @@ include(CMakeFindDependencyMacro) + find_dependency(Qt5Core @REQUIRED_QT_VERSION@) + find_dependency(Qt5Widgets @REQUIRED_QT_VERSION@) + find_dependency(Qt5Xml @REQUIRED_QT_VERSION@) ++find_dependency(Qt5PrintSupport @REQUIRED_QT_VERSION@) ++find_dependency(KF5CoreAddons @REQUIRED_KF5_VERSION@) + find_dependency(KPropertyWidgets @REQUIRED_KPROPERTY_VERSION@) + + include("${CMAKE_CURRENT_LIST_DIR}/KReportTargets.cmake") +-- +GitLab + diff --git a/dev-libs/kreport/files/kreport-3.2.0-fix-insane-delay.patch b/dev-libs/kreport/files/kreport-3.2.0-fix-insane-delay.patch new file mode 100644 index 000000000000..cf059f0ca829 --- /dev/null +++ b/dev-libs/kreport/files/kreport-3.2.0-fix-insane-delay.patch @@ -0,0 +1,166 @@ +From 779479c5474e080a857b2d80bdc86b9cab6531a0 Mon Sep 17 00:00:00 2001 +From: Jaroslaw Staniek <staniek@kde.org> +Date: Fri, 1 Nov 2019 19:54:00 +0100 +Subject: [PATCH] Fix insane delay in report items creation + +Summary: +Fix insane delay in report items creation by not instantiating hi-resolution QPrinter object for each item. + +To be honest I am not understanding the whole word-wrapping algorithm used here. + +Test Plan: +Approach 1: Run KEXI and create report with large number of pages. Use at +least one text element. +Before the fix there's noticeable O(N) delay. + +Approach 2: Also if we enter static value for the text item the kreportexample +app, there is noticeable delay on each key press before this fix. + +Expected: all is smooth after the fix. + +Reviewers: piggz + +Reviewed By: piggz + +Subscribers: Kexi-Devel-list + +Tags: #kreport + +Differential Revision: https://phabricator.kde.org/D25108 +--- + src/CMakeLists.txt | 2 ++ + src/common/KReportUtils_p.cpp | 14 +++++++++++--- + src/common/KReportUtils_p.h | 12 +++++++++++- + src/items/text/KReportItemText.cpp | 11 ++++++----- + 4 files changed, 30 insertions(+), 9 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index e15d5ca6..1cf0b389 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -198,6 +198,8 @@ target_link_libraries(KReportUtilsPrivate + Qt5::Widgets + KF5::ConfigGui + KF5::WidgetsAddons ++ PRIVATE ++ Qt5::PrintSupport + ) + + ecm_setup_version(${PROJECT_VERSION} +diff --git a/src/common/KReportUtils_p.cpp b/src/common/KReportUtils_p.cpp +index 5ac288bb..0fd90c2f 100644 +--- a/src/common/KReportUtils_p.cpp ++++ b/src/common/KReportUtils_p.cpp +@@ -1,5 +1,5 @@ + /* This file is part of the KDE project +- Copyright (C) 2015-2016 Jarosław Staniek <staniek@kde.org> ++ Copyright (C) 2015-2019 Jarosław Staniek <staniek@kde.org> + Copyright (C) 2016 Adam Pigg <adam@piggz.co.uk> + + This library is free software; you can redistribute it and/or +@@ -26,13 +26,14 @@ + #include <KMessageBox> + + #include <QApplication> ++#include <QDebug> + #include <QDir> + #include <QFileInfo> ++#include <QGlobalStatic> ++#include <QPrinter> + #include <QRegularExpression> + #include <QResource> + #include <QStandardPaths> +-#include <QDebug> +-#include <QGlobalStatic> + + #ifdef Q_WS_X11 + #include <QX11Info> +@@ -329,6 +330,13 @@ int dpiY() + return s_instance->m_dpiY; + } + ++Q_GLOBAL_STATIC_WITH_ARGS(QPrinter, s_printerInstance, (QPrinter::HighResolution)) ++ ++QPrinter* highResolutionPrinter() ++{ ++ return s_printerInstance; ++} ++ + PageLayout::PageLayout() : QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0,0,0,0)) + { + } +diff --git a/src/common/KReportUtils_p.h b/src/common/KReportUtils_p.h +index 1d223f6e..9e4b111b 100644 +--- a/src/common/KReportUtils_p.h ++++ b/src/common/KReportUtils_p.h +@@ -1,5 +1,5 @@ + /* This file is part of the KDE project +- Copyright (C) 2015-2016 Jarosław Staniek <staniek@kde.org> ++ Copyright (C) 2015-2019 Jarosław Staniek <staniek@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public +@@ -26,6 +26,8 @@ + #include <QRect> + #include <QStandardPaths> + ++class QPrinter; ++ + const bool DEFAULT_SHOW_GRID = true; + const bool DEFAULT_SNAP_TO_GRID = true; + const int DEFAULT_GRID_DIVISIONS = 4; +@@ -173,6 +175,14 @@ int dpiX(); + + int dpiY(); + ++/*! ++ * Returns a high-resolution printer ++ * ++ * The QPrinter(QPrinter::HighResolution)) instance is created on first call. ++ * The global printer helps to optimize access to QPrinter when report items need it. ++ */ ++QPrinter* highResolutionPrinter(); ++ + //! This class is wrapper that fixes a critical QTBUG-47551 bug in default constructor of QPageLayout + //! Default constructor of QPageLayout does not initialize units. + //! https://bugreports.qt.io/browse/QTBUG-47551 +diff --git a/src/items/text/KReportItemText.cpp b/src/items/text/KReportItemText.cpp +index 29f63998..e05088fa 100644 +--- a/src/items/text/KReportItemText.cpp ++++ b/src/items/text/KReportItemText.cpp +@@ -1,5 +1,6 @@ + /* This file is part of the KDE project + * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) ++ * Copyright (C) 2019 Jarosław Staniek <staniek@kde.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -17,8 +18,9 @@ + + #include "KReportItemText.h" + #include "KReportRenderObjects.h" +-#include "kreportplugin_debug.h" + #include "KReportUtils.h" ++#include "KReportUtils_p.h" ++#include "kreportplugin_debug.h" + + #include <KPropertyListData> + #include <KPropertySet> +@@ -217,11 +219,10 @@ int KReportItemText::renderSimpleData(OROPage *page, OROSection *section, const + int pos = 0; + QChar separator; + QRegularExpression re(QLatin1String("\\s")); +- QPrinter prnt(QPrinter::HighResolution); +- QFontMetricsF fm(font(), &prnt); ++ const QFontMetricsF fm(font(), KReportPrivate::highResolutionPrinter()); + +- // int intRectWidth = (int)(trf.width() * prnt.resolution()) - 10; +- int intRectWidth = (int)((size().width() / 72) * prnt.resolution()); ++ const int intRectWidth ++ = (int)((size().width() / 72) * KReportPrivate::highResolutionPrinter()->resolution()); + int intLineCounter = 0; + qreal intBaseTop = trf.top(); + qreal intRectHeight = trf.height(); +-- +GitLab + diff --git a/dev-libs/kreport/files/kreport-3.2.0-gcc12.patch b/dev-libs/kreport/files/kreport-3.2.0-gcc12.patch new file mode 100644 index 000000000000..ce48a27f1dc3 --- /dev/null +++ b/dev-libs/kreport/files/kreport-3.2.0-gcc12.patch @@ -0,0 +1,26 @@ +From 4b4b94f0bafcb49cefb1e453edd04a46d6ceacce Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=96mer=20Fad=C4=B1l=20Usta?= <omerusta@gmail.com> +Date: Thu, 12 May 2022 05:01:48 +0000 +Subject: [PATCH] Fix build with GCC 12 (standard attributes in middle of + decl-specifiers) + +--- + src/common/KReportDataSource.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/common/KReportDataSource.h b/src/common/KReportDataSource.h +index 89490b47..0e45b644 100644 +--- a/src/common/KReportDataSource.h ++++ b/src/common/KReportDataSource.h +@@ -124,7 +124,7 @@ public: + //! Creates a new instance with data source. Default implementation returns @c nullptr. + //! @a source is implementation-specific identifier. + //! Owner of the returned pointer is the caller. +- virtual Q_REQUIRED_RESULT KReportDataSource* create(const QString &source) const; ++ Q_REQUIRED_RESULT virtual KReportDataSource* create(const QString &source) const; + + private: + Q_DISABLE_COPY(KReportDataSource) +-- +GitLab + diff --git a/dev-libs/kreport/kreport-3.2.0-r2.ebuild b/dev-libs/kreport/kreport-3.2.0-r3.ebuild index 2b551fa4ddae..d616a54c4a74 100644 --- a/dev-libs/kreport/kreport-3.2.0-r2.ebuild +++ b/dev-libs/kreport/kreport-3.2.0-r3.ebuild @@ -1,13 +1,13 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 ECM_QTHELP="true" ECM_TEST="true" -PYTHON_COMPAT=( python3_{7,8,9} ) -KFMIN=5.74.0 -QTMIN=5.15.1 +PYTHON_COMPAT=( python3_{9..12} ) +KFMIN=5.82.0 +QTMIN=5.15.2 VIRTUALX_REQUIRED="test" inherit ecm kde.org python-any-r1 @@ -40,7 +40,13 @@ DEPEND="${RDEPEND} ${PYTHON_DEPS} " -PATCHES=( "${FILESDIR}/${P}-gcc10.patch" ) +PATCHES=( + "${FILESDIR}/${P}-gcc10.patch" + "${FILESDIR}/${P}-fix-insane-delay.patch" + "${FILESDIR}/${P}-fix-cmake-config.patch" + "${FILESDIR}/${P}-Q_REQUIRED_RESULT-placing.patch" # gcc12-patch dep + "${FILESDIR}/${P}-gcc12.patch" +) pkg_setup() { python-any-r1_pkg_setup @@ -49,6 +55,7 @@ pkg_setup() { src_configure() { local mycmakeargs=( + -DCMAKE_DISABLE_FIND_PACKAGE_Qt5WebKitWidgets=ON $(cmake_use_find_package marble Marble) -DKREPORT_SCRIPTING=$(usex scripting) ) |