Accepting request 1124387 from home:badshah400:branches:devel:tools
* Build against Qt6. * Add zeal-deprecate-qAsConst.patch -- replace deprecated qAsConst with std::as_const() (gh#zealdocs/zeal#1565); patch taken from upstream commit. * Use qt6 RPM macros for build. * Pass -DCMAKE_SKIP_INSTALL_RPATH=ON to cmake to avoid rpath being left to installed binary. * Drop deprecated scriptlets from %post(un). OBS-URL: https://build.opensuse.org/request/show/1124387 OBS-URL: https://build.opensuse.org/package/show/devel:tools/zeal?expand=0&rev=33
This commit is contained in:
parent
25606189c5
commit
c08d94b8a5
107
zeal-deprecate-qAsConst.patch
Normal file
107
zeal-deprecate-qAsConst.patch
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
From 9630cc94c155d87295e51b41fbab2bd5798f8229 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Nick Cao <nickcao@nichi.co>
|
||||||
|
Date: Sun, 29 Oct 2023 02:50:40 -0400
|
||||||
|
Subject: [PATCH] refactor: replace deprecated qAsConst with std::as_const()
|
||||||
|
(#1565)
|
||||||
|
|
||||||
|
Reference: https://github.com/qt/qtbase/blob/v6.6.0/src/corelib/global/qttypetraits.h#L32
|
||||||
|
---
|
||||||
|
src/libs/registry/docset.cpp | 4 ++--
|
||||||
|
src/libs/registry/docsetmetadata.cpp | 2 +-
|
||||||
|
src/libs/registry/docsetregistry.cpp | 6 +++---
|
||||||
|
src/libs/ui/docsetsdialog.cpp | 2 +-
|
||||||
|
src/libs/ui/qxtglobalshortcut/qxtglobalshortcut_x11.cpp | 2 +-
|
||||||
|
5 files changed, 8 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/libs/registry/docset.cpp b/src/libs/registry/docset.cpp
|
||||||
|
index 0c0dbb72..e82c9c9b 100644
|
||||||
|
--- a/src/libs/registry/docset.cpp
|
||||||
|
+++ b/src/libs/registry/docset.cpp
|
||||||
|
@@ -458,7 +458,7 @@ void Docset::loadSymbols(const QString &symbolType) const
|
||||||
|
// with it.first and it.second respectively pointing to the start and the end
|
||||||
|
// of the range of nodes having symbolType as key. It effectively represents a
|
||||||
|
// contiguous view over the nodes with a specified key.
|
||||||
|
- for (auto it = qAsConst(m_symbolStrings).equal_range(symbolType); it.first != it.second; ++it.first) {
|
||||||
|
+ for (auto it = std::as_const(m_symbolStrings).equal_range(symbolType); it.first != it.second; ++it.first) {
|
||||||
|
loadSymbols(symbolType, it.first.value());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -519,7 +519,7 @@ void Docset::createIndex()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Drop old indexes
|
||||||
|
- for (const QString &oldIndexName : qAsConst(oldIndexes)) {
|
||||||
|
+ for (const QString &oldIndexName : std::as_const(oldIndexes)) {
|
||||||
|
m_db->execute(indexDropQuery.arg(oldIndexName));
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/libs/registry/docsetmetadata.cpp b/src/libs/registry/docsetmetadata.cpp
|
||||||
|
index 0678a130..5144e2fe 100644
|
||||||
|
--- a/src/libs/registry/docsetmetadata.cpp
|
||||||
|
+++ b/src/libs/registry/docsetmetadata.cpp
|
||||||
|
@@ -97,7 +97,7 @@ void DocsetMetadata::save(const QString &path, const QString &version)
|
||||||
|
|
||||||
|
if (!m_urls.isEmpty()) {
|
||||||
|
QJsonArray urls;
|
||||||
|
- for (const QUrl &url : qAsConst(m_urls)) {
|
||||||
|
+ for (const QUrl &url : std::as_const(m_urls)) {
|
||||||
|
urls.append(url.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/libs/registry/docsetregistry.cpp b/src/libs/registry/docsetregistry.cpp
|
||||||
|
index 9776a19a..17be79ea 100644
|
||||||
|
--- a/src/libs/registry/docsetregistry.cpp
|
||||||
|
+++ b/src/libs/registry/docsetregistry.cpp
|
||||||
|
@@ -101,7 +101,7 @@ void DocsetRegistry::setFuzzySearchEnabled(bool enabled)
|
||||||
|
|
||||||
|
m_isFuzzySearchEnabled = enabled;
|
||||||
|
|
||||||
|
- for (Docset *docset : qAsConst(m_docsets)) {
|
||||||
|
+ for (Docset *docset : std::as_const(m_docsets)) {
|
||||||
|
docset->setFuzzySearchEnabled(enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -193,7 +193,7 @@ Docset *DocsetRegistry::docset(int index) const
|
||||||
|
|
||||||
|
Docset *DocsetRegistry::docsetForUrl(const QUrl &url)
|
||||||
|
{
|
||||||
|
- for (Docset *docset : qAsConst(m_docsets)) {
|
||||||
|
+ for (Docset *docset : std::as_const(m_docsets)) {
|
||||||
|
if (docset->baseUrl().isParentOf(url))
|
||||||
|
return docset;
|
||||||
|
}
|
||||||
|
@@ -226,7 +226,7 @@ void DocsetRegistry::_runQuery(const QString &query)
|
||||||
|
|
||||||
|
const SearchQuery searchQuery = SearchQuery::fromString(query);
|
||||||
|
if (searchQuery.hasKeywords()) {
|
||||||
|
- for (Docset *docset : qAsConst(m_docsets)) {
|
||||||
|
+ for (Docset *docset : std::as_const(m_docsets)) {
|
||||||
|
if (searchQuery.hasKeywords(docset->keywords()))
|
||||||
|
enabledDocsets << docset;
|
||||||
|
}
|
||||||
|
diff --git a/src/libs/ui/docsetsdialog.cpp b/src/libs/ui/docsetsdialog.cpp
|
||||||
|
index 4e3788bb..18d0409c 100644
|
||||||
|
--- a/src/libs/ui/docsetsdialog.cpp
|
||||||
|
+++ b/src/libs/ui/docsetsdialog.cpp
|
||||||
|
@@ -687,7 +687,7 @@ QNetworkReply *DocsetsDialog::download(const QUrl &url)
|
||||||
|
|
||||||
|
void DocsetsDialog::cancelDownloads()
|
||||||
|
{
|
||||||
|
- for (QNetworkReply *reply : qAsConst(m_replies)) {
|
||||||
|
+ for (QNetworkReply *reply : std::as_const(m_replies)) {
|
||||||
|
// Hide progress bar
|
||||||
|
QListWidgetItem *listItem
|
||||||
|
= ui->availableDocsetList->item(reply->property(ListItemIndexProperty).toInt());
|
||||||
|
diff --git a/src/libs/ui/qxtglobalshortcut/qxtglobalshortcut_x11.cpp b/src/libs/ui/qxtglobalshortcut/qxtglobalshortcut_x11.cpp
|
||||||
|
index a40c7720..7a832ad2 100644
|
||||||
|
--- a/src/libs/ui/qxtglobalshortcut/qxtglobalshortcut_x11.cpp
|
||||||
|
+++ b/src/libs/ui/qxtglobalshortcut/qxtglobalshortcut_x11.cpp
|
||||||
|
@@ -152,7 +152,7 @@ bool QxtGlobalShortcutPrivate::registerShortcut(quint32 nativeKey, quint32 nativ
|
||||||
|
}
|
||||||
|
|
||||||
|
bool failed = false;
|
||||||
|
- for (xcb_void_cookie_t cookie : qAsConst(xcbCookies)) {
|
||||||
|
+ for (xcb_void_cookie_t cookie : std::as_const(xcbCookies)) {
|
||||||
|
QScopedPointer<xcb_generic_error_t, QScopedPointerPodDeleter> error(xcb_request_check(xcbConnection, cookie));
|
||||||
|
failed = !error.isNull();
|
||||||
|
}
|
12
zeal.changes
12
zeal.changes
@ -1,3 +1,15 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Nov 9 09:40:47 UTC 2023 - Atri Bhattacharya <badshah400@gmail.com>
|
||||||
|
|
||||||
|
- Build against Qt6.
|
||||||
|
- Add zeal-deprecate-qAsConst.patch -- replace deprecated
|
||||||
|
qAsConst with std::as_const() (gh#zealdocs/zeal#1565); patch
|
||||||
|
taken from upstream commit.
|
||||||
|
- Use qt6 RPM macros for build.
|
||||||
|
- Pass -DCMAKE_SKIP_INSTALL_RPATH=ON to cmake to avoid rpath being
|
||||||
|
left to installed binary.
|
||||||
|
- Drop deprecated scriptlets from %post(un).
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Oct 31 05:15:17 UTC 2023 - david.anes@suse.com
|
Tue Oct 31 05:15:17 UTC 2023 - david.anes@suse.com
|
||||||
|
|
||||||
|
32
zeal.spec
32
zeal.spec
@ -28,21 +28,25 @@ URL: https://zealdocs.org
|
|||||||
Source0: %{name}-%{version}.tar.xz
|
Source0: %{name}-%{version}.tar.xz
|
||||||
# `help2man zeal > zeal.1` can't be run without X started.
|
# `help2man zeal > zeal.1` can't be run without X started.
|
||||||
Source9: zeal.1
|
Source9: zeal.1
|
||||||
|
# PATCH-FIX-UPSTREAM zeal-deprecate-qAsConst.patch gh#zealdocs/zeal#1565 badshah400@gmail.com -- replace deprecated qAsConst with std::as_const()
|
||||||
|
Patch0: https://github.com/zealdocs/zeal/commit/9630cc94c155d87295e51b41fbab2bd5798f8229.patch#/%{name}-deprecate-qAsConst.patch
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
BuildRequires: extra-cmake-modules
|
BuildRequires: extra-cmake-modules
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: hicolor-icon-theme
|
BuildRequires: hicolor-icon-theme
|
||||||
BuildRequires: libQt5Gui-private-headers-devel >= 5.2.0
|
BuildRequires: ninja
|
||||||
BuildRequires: pkgconfig
|
BuildRequires: pkgconfig
|
||||||
|
BuildRequires: qt6-gui-private-devel
|
||||||
BuildRequires: update-desktop-files
|
BuildRequires: update-desktop-files
|
||||||
BuildRequires: pkgconfig(Qt5Concurrent) >= 5.2.0
|
BuildRequires: pkgconfig(Qt6Concurrent) >= 6.2.0
|
||||||
BuildRequires: pkgconfig(Qt5WebEngine) >= 5.2.0
|
BuildRequires: pkgconfig(Qt6Core) >= 6.2.0
|
||||||
BuildRequires: pkgconfig(Qt5X11Extras) >= 5.2.0
|
BuildRequires: pkgconfig(Qt6Gui) >= 6.2.0
|
||||||
BuildRequires: pkgconfig(Qt5Xml) >= 5.2.0
|
BuildRequires: pkgconfig(Qt6WebChannel) >= 6.2.0
|
||||||
|
BuildRequires: pkgconfig(Qt6WebEngineWidgets) >= 6.2.0
|
||||||
BuildRequires: pkgconfig(libarchive)
|
BuildRequires: pkgconfig(libarchive)
|
||||||
BuildRequires: pkgconfig(sqlite3)
|
BuildRequires: pkgconfig(sqlite3)
|
||||||
BuildRequires: pkgconfig(xcb-keysyms)
|
BuildRequires: pkgconfig(xcb-keysyms)
|
||||||
Requires: libQt5Sql5-sqlite >= 5.2.0
|
Requires: libQt6Sql6 >= 6.2.0
|
||||||
Requires(post): hicolor-icon-theme
|
Requires(post): hicolor-icon-theme
|
||||||
Requires(post): update-desktop-files
|
Requires(post): update-desktop-files
|
||||||
Requires(postun):hicolor-icon-theme
|
Requires(postun):hicolor-icon-theme
|
||||||
@ -59,14 +63,14 @@ Zeal is an offline API documentation browser inspired by Dash
|
|||||||
Editor plugins for details.
|
Editor plugins for details.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%autosetup -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%cmake_kf5 -d build
|
%cmake_qt6 -DCMAKE_SKIP_INSTALL_RPATH=ON
|
||||||
%cmake_build
|
%qt6_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%kf5_makeinstall -C build
|
%qt6_install
|
||||||
%suse_update_desktop_file -r org.zealdocs.zeal Office Viewer
|
%suse_update_desktop_file -r org.zealdocs.zeal Office Viewer
|
||||||
%fdupes -s %{buildroot}%{_datadir}
|
%fdupes -s %{buildroot}%{_datadir}
|
||||||
|
|
||||||
@ -74,14 +78,6 @@ Zeal is an offline API documentation browser inspired by Dash
|
|||||||
mkdir -p %{buildroot}%{_mandir}/man1
|
mkdir -p %{buildroot}%{_mandir}/man1
|
||||||
cp %{SOURCE9} %{buildroot}%{_mandir}/man1
|
cp %{SOURCE9} %{buildroot}%{_mandir}/man1
|
||||||
|
|
||||||
%post
|
|
||||||
%desktop_database_post
|
|
||||||
%icon_theme_cache_post
|
|
||||||
|
|
||||||
%postun
|
|
||||||
%desktop_database_postun
|
|
||||||
%icon_theme_cache_postun
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license COPYING
|
%license COPYING
|
||||||
%doc README.md
|
%doc README.md
|
||||||
|
Loading…
Reference in New Issue
Block a user