forked from pool/wireshark
Accepting request 244918 from home:AndreasStieger:branches:network:utilities
- Build expermiental UI wireshark-qt: add wireshark-1.12.0-qt-QFont-stylename.patch to support building with Qt 4.6 on SLE 11 OBS-URL: https://build.opensuse.org/request/show/244918 OBS-URL: https://build.opensuse.org/package/show/network:utilities/wireshark?expand=0&rev=119
This commit is contained in:
parent
1547428a2a
commit
2498ca527d
57
wireshark-1.12.0-qt-QFont-stylename.patch
Normal file
57
wireshark-1.12.0-qt-QFont-stylename.patch
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
From: Andreas Stieger <andreas.stieger@gmx.de>
|
||||||
|
Date: Fri, 8 Aug 2014 19:50:24 +0200
|
||||||
|
Subject: [PATCH] Qt: Fix when build with Qt < 4.8.0
|
||||||
|
Upstream: Committed
|
||||||
|
References: https://www.wireshark.org/lists/wireshark-dev/201408/msg00074.html https://code.wireshark.org/review/#/c/3508/ https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commitdiff;h=020d0f89637faab8ec0e25e07d64eb66d96c2a72
|
||||||
|
|
||||||
|
Declared minimum requirement is Qt 4.6.0.
|
||||||
|
QFont.styleName is not available in Qt < 4.8
|
||||||
|
Fails on SLE11 with libqt4-devel-4.6.3-5.25.5:
|
||||||
|
[ 567s] qt_ui_utils.cpp: In function 'void smooth_font_size(QFont&)':
|
||||||
|
[ 567s] qt_ui_utils.cpp:58: error: 'class QFont' has no member named 'styleName'
|
||||||
|
|
||||||
|
---
|
||||||
|
ui/qt/font_color_preferences_frame.cpp | 8 +++++++-
|
||||||
|
ui/qt/qt_ui_utils.cpp | 4 ++++
|
||||||
|
2 files changed, 11 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/ui/qt/font_color_preferences_frame.cpp b/ui/qt/font_color_preferences_frame.cpp
|
||||||
|
index e9f4a5d..38c894c 100644
|
||||||
|
--- a/ui/qt/font_color_preferences_frame.cpp
|
||||||
|
+++ b/ui/qt/font_color_preferences_frame.cpp
|
||||||
|
@@ -81,9 +81,15 @@ void FontColorPreferencesFrame::updateWidgets()
|
||||||
|
{
|
||||||
|
int margin = style()->pixelMetric(QStyle::PM_LayoutLeftMargin);
|
||||||
|
|
||||||
|
+#if QT_VERSION < QT_VERSION_CHECK(4, 8, 0)
|
||||||
|
ui->fontPushButton->setText(
|
||||||
|
- cur_font_.family() + " "/* + cur_font_.styleName() + " "*/ +
|
||||||
|
+ cur_font_.family() + " " +
|
||||||
|
QString::number(cur_font_.pointSizeF(), 'f', 1));
|
||||||
|
+#else
|
||||||
|
+ ui->fontPushButton->setText(
|
||||||
|
+ cur_font_.family() + " " + cur_font_.styleName() + " " +
|
||||||
|
+ QString::number(cur_font_.pointSizeF(), 'f', 1));
|
||||||
|
+#endif
|
||||||
|
ui->fontSampleLineEdit->setFont(cur_font_);
|
||||||
|
|
||||||
|
QString line_edit_ss = QString("QLineEdit { margin-left: %1px; }").arg(margin);
|
||||||
|
diff --git a/ui/qt/qt_ui_utils.cpp b/ui/qt/qt_ui_utils.cpp
|
||||||
|
index 8ad29d2..f4a0621 100644
|
||||||
|
--- a/ui/qt/qt_ui_utils.cpp
|
||||||
|
+++ b/ui/qt/qt_ui_utils.cpp
|
||||||
|
@@ -55,7 +55,11 @@ QString gchar_free_to_qstring(gchar *glib_string) {
|
||||||
|
|
||||||
|
void smooth_font_size(QFont &font) {
|
||||||
|
QFontDatabase fdb;
|
||||||
|
+#if QT_VERSION < QT_VERSION_CHECK(4, 8, 0)
|
||||||
|
+ QList<int> size_list = fdb.smoothSizes(font.family(), "");
|
||||||
|
+#else
|
||||||
|
QList<int> size_list = fdb.smoothSizes(font.family(), font.styleName());
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
if (size_list.size() < 2) return;
|
||||||
|
|
||||||
|
--
|
||||||
|
1.7.9.5
|
||||||
|
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Aug 15 22:11:53 UTC 2014 - andreas.stieger@gmx.de
|
||||||
|
|
||||||
|
- Build expermiental UI wireshark-qt:
|
||||||
|
add wireshark-1.12.0-qt-QFont-stylename.patch
|
||||||
|
to support building with Qt 4.6 on SLE 11
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Aug 13 22:03:39 UTC 2014 - andreas.stieger@gmx.de
|
Wed Aug 13 22:03:39 UTC 2014 - andreas.stieger@gmx.de
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
%define use_caps 0
|
%define use_caps 0
|
||||||
|
|
||||||
%define use_gtk3 0%{?suse_version} > 1140
|
%define use_gtk3 0%{?suse_version} > 1140
|
||||||
|
%bcond_without qt
|
||||||
|
|
||||||
Name: wireshark
|
Name: wireshark
|
||||||
Version: 1.12.0
|
Version: 1.12.0
|
||||||
@ -37,14 +38,22 @@ Patch1: wireshark-1.2.0-disable-warning-dialog.patch
|
|||||||
Patch2: wireshark-1.2.0-geoip.patch
|
Patch2: wireshark-1.2.0-geoip.patch
|
||||||
Patch4: wireshark-1.10.0-enable_lua.patch
|
Patch4: wireshark-1.10.0-enable_lua.patch
|
||||||
Patch5: wireshark-1.10.0-authors-pod2man.patch
|
Patch5: wireshark-1.10.0-authors-pod2man.patch
|
||||||
|
Patch6: wireshark-1.12.0-qt-QFont-stylename.patch
|
||||||
BuildRequires: bison
|
BuildRequires: bison
|
||||||
BuildRequires: cairo-devel
|
BuildRequires: cairo-devel
|
||||||
BuildRequires: flex
|
BuildRequires: flex
|
||||||
%if 0%{?use_gtk3}
|
%if 0%{use_gtk3}
|
||||||
BuildRequires: gtk3-devel >= 3.0.0
|
BuildRequires: gtk3-devel >= 3.0.0
|
||||||
%else
|
%else
|
||||||
BuildRequires: gtk2-devel >= 2.12.0
|
BuildRequires: gtk2-devel >= 2.12.0
|
||||||
%endif
|
%endif
|
||||||
|
%if %{with qt}
|
||||||
|
%if 0%{?suse_version} >= 1220
|
||||||
|
BuildRequires: pkgconfig(QtCore) >= 4.6.0
|
||||||
|
%else
|
||||||
|
BuildRequires: libqt4-devel >= 4.6.0
|
||||||
|
%endif # 12.20
|
||||||
|
%endif # with qt
|
||||||
BuildRequires: krb5-devel
|
BuildRequires: krb5-devel
|
||||||
BuildRequires: libcap-devel
|
BuildRequires: libcap-devel
|
||||||
BuildRequires: libcares-devel
|
BuildRequires: libcares-devel
|
||||||
@ -125,6 +134,7 @@ sed -i 's!^Exec=wireshark!Exec=/usr/bin/xdg-su -c /usr/bin/wireshark!' wireshark
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%patch5 -p1
|
%patch5 -p1
|
||||||
|
%patch6 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
@ -139,12 +149,16 @@ sed -i 's!^Exec=wireshark!Exec=/usr/bin/xdg-su -c /usr/bin/wireshark!' wireshark
|
|||||||
%else
|
%else
|
||||||
--with-gtk3=no \
|
--with-gtk3=no \
|
||||||
--with-gtk2=yes \
|
--with-gtk2=yes \
|
||||||
|
%endif
|
||||||
|
%if %{with qt}
|
||||||
|
--with-qt=yes \
|
||||||
|
%else
|
||||||
|
--with-qt=no \
|
||||||
%endif
|
%endif
|
||||||
--with-ssl \
|
--with-ssl \
|
||||||
--with-gnutls=yes \
|
--with-gnutls=yes \
|
||||||
--with-gcrypt=yes \
|
--with-gcrypt=yes \
|
||||||
--with-python \
|
--with-python \
|
||||||
--with-qt=no \
|
|
||||||
--with-plugins=%{_libdir}/%{name}/plugins/%{version}
|
--with-plugins=%{_libdir}/%{name}/plugins/%{version}
|
||||||
|
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
@ -208,6 +222,9 @@ getent group wireshark >/dev/null || groupadd wireshark
|
|||||||
%{_bindir}/ethereal
|
%{_bindir}/ethereal
|
||||||
%{_bindir}/tethereal
|
%{_bindir}/tethereal
|
||||||
%{_bindir}/wireshark
|
%{_bindir}/wireshark
|
||||||
|
%if %{with qt}
|
||||||
|
%{_bindir}/wireshark-qt
|
||||||
|
%endif
|
||||||
%{_bindir}/editcap
|
%{_bindir}/editcap
|
||||||
%{_bindir}/tshark
|
%{_bindir}/tshark
|
||||||
%{_bindir}/mergecap
|
%{_bindir}/mergecap
|
||||||
|
Loading…
Reference in New Issue
Block a user