1
#! /bin/sh /usr/share/dpatch/dpatch-run
3
## All lines beginning with `## DP:' are a description of the patch.
4
## DP: Fix FTBFS with python-qt4 4.8
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
15
-%MappedType QSet<int>
19
-#if (SIP_VERSION >= 0x040900)
20
-#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString))
21
-#define sipClass_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
29
- if ((l = PyList_New(sipCpp->size())) == NULL)
32
- // Set the list elements.
33
- QSet<int>::iterator it = sipCpp->begin();
34
- for (int i = 0; it != sipCpp->end(); ++it, ++i)
38
- if ((tobj = PyInt_FromLong(*it)) == NULL)
43
- PyList_SET_ITEM(l, i, tobj);
50
- // Check the type if that is all that is required.
51
- if (sipIsErr == NULL)
52
- return PyList_Check(sipPy);
54
- QSet<int> *qset = new QSet<int>;
56
- for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
58
- qset->insert(PyInt_AsLong(PyList_GET_ITEM(sipPy, i)));
62
- return sipGetState(sipTransferObj);
69
-%MappedType QSet<TYPE>
73
-#if (SIP_VERSION >= 0x040900)
74
-#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString))
75
-#define sipClass_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
83
- if ((l = PyList_New(sipCpp->size())) == NULL)
86
- // Set the list elements.
88
- for (QSet<TYPE>::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it, ++i)
90
- TYPE *t = new TYPE(*it);
93
- if ((tobj = sipConvertFromNewInstance(t, sipClass_TYPE, sipTransferObj)) == NULL)
99
- PyList_SET_ITEM(l, i, tobj);
106
- // Check the type if that is all that is required.
107
- if (sipIsErr == NULL)
109
- if (!PyList_Check(sipPy))
112
- for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
113
- if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_TYPE, SIP_NOT_NONE))
119
- QSet<TYPE> *qset = new QSet<TYPE>;
121
- for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
124
- TYPE* t = reinterpret_cast<TYPE *>(sipConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
128
- sipReleaseInstance(t, sipClass_TYPE, state);
133
- sipReleaseInstance(t, sipClass_TYPE, state);
137
- return sipGetState(sipTransferObj);
145
%MappedType QMap<int, QMap<int, TYPE> >