1 |
spatz 10/06/27 20:08:25 |
2 |
|
3 |
Added: libdbusmenu-qt-0.3.5-qt-4.7.patch |
4 |
Log: |
5 |
Add patch to fix building with Qt 4.7.0-beta1, bug 324843. Thanks to Alec Moskvin for patch from upstream. |
6 |
(Portage version: 2.2_rc67/cvs/Linux x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 dev-libs/libdbusmenu-qt/files/libdbusmenu-qt-0.3.5-qt-4.7.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libdbusmenu-qt/files/libdbusmenu-qt-0.3.5-qt-4.7.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libdbusmenu-qt/files/libdbusmenu-qt-0.3.5-qt-4.7.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: libdbusmenu-qt-0.3.5-qt-4.7.patch |
15 |
=================================================================== |
16 |
From f3c2fb90e1c2b94e561ccf33e4c2049f96ce45e2 Mon Sep 17 00:00:00 2001 |
17 |
From: Aurelien Gateau <aurelien.gateau@×××××××××.com> |
18 |
Date: Thu, 24 Jun 2010 10:04:35 +0200 |
19 |
Subject: [PATCH] Better build check for QIcon::name() |
20 |
|
21 |
--- |
22 |
src/CMakeLists.txt | 21 +++++++++++++++++++++ |
23 |
src/dbusmenu_config.h.in | 2 ++ |
24 |
src/dbusmenuexporter.cpp | 3 ++- |
25 |
3 files changed, 25 insertions(+), 1 deletions(-) |
26 |
create mode 100644 src/dbusmenu_config.h.in |
27 |
|
28 |
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt |
29 |
index 2f4f5fd..ef555a3 100644 |
30 |
--- a/src/CMakeLists.txt |
31 |
+++ b/src/CMakeLists.txt |
32 |
@@ -1,4 +1,7 @@ |
33 |
+include(CheckCXXSourceCompiles) |
34 |
include (CheckCXXCompilerFlag) |
35 |
+ |
36 |
+# Check some compiler flags |
37 |
check_cxx_compiler_flag(-fvisibility=hidden __DBUSMENU_HAVE_GCC_VISIBILITY) |
38 |
if (__DBUSMENU_HAVE_GCC_VISIBILITY AND NOT WIN32) |
39 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") |
40 |
@@ -18,6 +21,24 @@ if (MSVC) |
41 |
add_definitions(-D__PRETTY_FUNCTION__=__FUNCTION__) |
42 |
endif (MSVC) |
43 |
|
44 |
+# Check whether QIcon::name() exists. It was added in late Qt 4.7 cycle, and is |
45 |
+# not present in betas. |
46 |
+set(CMAKE_REQUIRED_INCLUDES "${QT_INCLUDE_DIR}") |
47 |
+set(CMAKE_REQUIRED_LIBRARIES "QtGui") |
48 |
+check_cxx_source_compiles(" |
49 |
+#include <QtGui/QIcon> |
50 |
+int main() { |
51 |
+ QIcon icon; |
52 |
+ icon.name(); |
53 |
+ return 0; |
54 |
+} |
55 |
+" HAVE_QICON_NAME) |
56 |
+if (NOT HAVE_QICON_NAME) |
57 |
+ message(STATUS "QIcon::name() does not exist, DBusMenuExporter will not export icon names by itself") |
58 |
+endif() |
59 |
+configure_file(dbusmenu_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/dbusmenu_config.h @ONLY) |
60 |
+ |
61 |
+ |
62 |
set(dbusmenu_qt_SRCS |
63 |
dbusmenu_p.cpp |
64 |
dbusmenuexporter.cpp |
65 |
diff --git a/src/dbusmenu_config.h.in b/src/dbusmenu_config.h.in |
66 |
new file mode 100644 |
67 |
index 0000000..c884fb7 |
68 |
--- /dev/null |
69 |
+++ b/src/dbusmenu_config.h.in |
70 |
@@ -0,0 +1,2 @@ |
71 |
+/* Whether QIcon::name() exists */ |
72 |
+#cmakedefine HAVE_QICON_NAME |
73 |
diff --git a/src/dbusmenuexporter.cpp b/src/dbusmenuexporter.cpp |
74 |
index af37eaa..e77681c 100644 |
75 |
--- a/src/dbusmenuexporter.cpp |
76 |
+++ b/src/dbusmenuexporter.cpp |
77 |
@@ -30,6 +30,7 @@ |
78 |
#include <QXmlStreamWriter> |
79 |
|
80 |
// Local |
81 |
+#include "dbusmenu_config.h" |
82 |
#include "dbusmenu_p.h" |
83 |
#include "dbusmenuexporterdbus_p.h" |
84 |
#include "dbusmenuexporterprivate_p.h" |
85 |
@@ -277,7 +278,7 @@ void DBusMenuExporter::doEmitLayoutUpdated() |
86 |
QString DBusMenuExporter::iconNameForAction(QAction *action) |
87 |
{ |
88 |
DMRETURN_VALUE_IF_FAIL(action, QString()); |
89 |
-#if QT_VERSION >= 0x040700 |
90 |
+#ifdef HAVE_QICON_NAME |
91 |
QIcon icon = action->icon(); |
92 |
return icon.isNull() ? QString() : icon.name(); |
93 |
#else |
94 |
-- |
95 |
1.6.1 |