~ubuntu-branches/ubuntu/precise/qgis/precise

« back to all changes in this revision

Viewing changes to debian/patches/pyqt48.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-02-18 20:06:52 UTC
  • mfrom: (3.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110218200652-q8p18ino306ph7mp
Tags: 1.4.0+12730-5ubuntu1
* Merge from Debian unstable (LP: #707791), remaining changes:
  - Fix compilation issues with QT 4.7
  - Add build-depends on libqtwebkit-dev
  - Fix build failure with GCC 4.5
* Fix build failure with python-qt4 4.8
* Build-depend on python-sip-dev instead of *sip4* transitional packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
##
 
3
## All lines beginning with `## DP:' are a description of the patch.
 
4
## DP: Fix FTBFS with python-qt4 4.8
 
5
 
 
6
@DPATCH@
 
7
 
 
8
diff -Nur qgis-1.4.0+12730/python/core/conversions.sip qgis-1.4.0+12730.patch/python/core/conversions.sip
 
9
--- qgis-1.4.0+12730/python/core/conversions.sip        2010-01-07 11:33:12.000000000 +0100
 
10
+++ qgis-1.4.0+12730.patch/python/core/conversions.sip  2011-02-18 20:24:17.637766208 +0100
 
11
@@ -264,135 +264,6 @@
 
12
 
 
13
 
 
14
 
 
15
-%MappedType QSet<int>
 
16
-{
 
17
-%TypeHeaderCode
 
18
-#include <QSet>
 
19
-#if (SIP_VERSION >= 0x040900)
 
20
-#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString))
 
21
-#define sipClass_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
 
22
-#endif
 
23
-%End
 
24
-
 
25
-%ConvertFromTypeCode
 
26
-  // Create the list.
 
27
-  PyObject *l;
 
28
-
 
29
-  if ((l = PyList_New(sipCpp->size())) == NULL)
 
30
-    return NULL;
 
31
-      
 
32
-  // Set the list elements.
 
33
-  QSet<int>::iterator it = sipCpp->begin();
 
34
-  for (int i = 0; it != sipCpp->end(); ++it, ++i)
 
35
-  {
 
36
-    PyObject *tobj;
 
37
-
 
38
-    if ((tobj = PyInt_FromLong(*it)) == NULL)
 
39
-    {
 
40
-      Py_DECREF(l);
 
41
-      return NULL;
 
42
-    }
 
43
-    PyList_SET_ITEM(l, i, tobj);
 
44
-  }
 
45
-
 
46
-  return l;
 
47
-%End
 
48
-
 
49
-%ConvertToTypeCode
 
50
-  // Check the type if that is all that is required.
 
51
-  if (sipIsErr == NULL)
 
52
-    return PyList_Check(sipPy);
 
53
-
 
54
-  QSet<int> *qset = new QSet<int>;
 
55
-
 
56
-  for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
 
57
-  {
 
58
-    qset->insert(PyInt_AsLong(PyList_GET_ITEM(sipPy, i)));
 
59
-  }
 
60
-
 
61
-  *sipCppPtr = qset;
 
62
-  return sipGetState(sipTransferObj);
 
63
-%End
 
64
-
 
65
-};
 
66
-
 
67
-
 
68
-template <TYPE>
 
69
-%MappedType QSet<TYPE>
 
70
-{
 
71
-%TypeHeaderCode
 
72
-#include <QSet>
 
73
-#if (SIP_VERSION >= 0x040900)
 
74
-#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString))
 
75
-#define sipClass_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
 
76
-#endif
 
77
-%End
 
78
-
 
79
-%ConvertFromTypeCode
 
80
-  // Create the list.
 
81
-  PyObject *l;
 
82
-
 
83
-  if ((l = PyList_New(sipCpp->size())) == NULL)
 
84
-    return NULL;
 
85
-      
 
86
-  // Set the list elements.
 
87
-  int i=0;
 
88
-  for (QSet<TYPE>::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it, ++i)
 
89
-  {
 
90
-    TYPE *t = new TYPE(*it);
 
91
-    PyObject *tobj;
 
92
-
 
93
-    if ((tobj = sipConvertFromNewInstance(t, sipClass_TYPE, sipTransferObj)) == NULL)
 
94
-    {
 
95
-      Py_DECREF(l);
 
96
-      delete t;
 
97
-      return NULL;
 
98
-    }
 
99
-    PyList_SET_ITEM(l, i, tobj);
 
100
-  }
 
101
 
102
-  return l;
 
103
-%End
 
104
-
 
105
-%ConvertToTypeCode
 
106
-  // Check the type if that is all that is required.
 
107
-  if (sipIsErr == NULL)
 
108
-  {
 
109
-    if (!PyList_Check(sipPy))
 
110
-      return 0;
 
111
-
 
112
-    for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
 
113
-      if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_TYPE, SIP_NOT_NONE))
 
114
-        return 0;
 
115
-
 
116
-    return 1;
 
117
-  }
 
118
-
 
119
-  QSet<TYPE> *qset = new QSet<TYPE>;
 
120
-
 
121
-  for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
 
122
-  {
 
123
-    int state;
 
124
-    TYPE* t = reinterpret_cast<TYPE *>(sipConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
 
125
-
 
126
-    if (*sipIsErr)
 
127
-    {
 
128
-      sipReleaseInstance(t, sipClass_TYPE, state);
 
129
-      delete qset;
 
130
-      return 0;
 
131
-    }
 
132
-    qset->insert(*t);
 
133
-    sipReleaseInstance(t, sipClass_TYPE, state);
 
134
-  }
 
135
-
 
136
-  *sipCppPtr = qset;
 
137
-  return sipGetState(sipTransferObj);
 
138
-%End
 
139
-
 
140
-};
 
141
-
 
142
-
 
143
-
 
144
 template<TYPE>
 
145
 %MappedType QMap<int, QMap<int, TYPE> >
 
146
 {