[QGIS-trac] Re: [Quantum GIS] #2985: qgis broken with new py-sip

Quantum GIS qgis at qgis.org
Tue Sep 7 06:39:05 EDT 2010


#2985: qgis broken with new py-sip
------------------------------------------------+---------------------------
   Reporter:  jasperla                          |              Owner:  nobody       
       Type:  bug                               |             Status:  new          
   Priority:  major: does not work as expected  |          Milestone:  Version 1.6.0
  Component:  Build/Install                     |            Version:  1.5.0        
   Keywords:  sip build failure                 |   Platform_version:               
   Platform:  OpenBSD                           |           Must_fix:  Yes          
Status_info:  0                                 |  
------------------------------------------------+---------------------------

Comment(by sthen):

 The following diff fixes things with sip>=4.11; I showed it to Phil
 Banks who thinks it's ok as a workaround and suggests it is made
 conditional depending on the version of SIP that is found.

 {{{
 --- python/core/conversions.sip.orig    Tue Sep  7 00:14:55 2010
 +++ python/core/conversions.sip Tue Sep  7 00:17:23 2010
 @@ -265,59 +265,6 @@ template <TYPE>



 -%MappedType QSet<int>
 -{
 -%TypeHeaderCode
 -#include <QSet>
 -#if (SIP_VERSION >= 0x040900)
 -#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject
 (sipType_QString))
 -#define sipClass_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject
 (sipType_QVariant))
 -#endif
 -%End
 -
 -%ConvertFromTypeCode
 -  // Create the list.
 -  PyObject *l;
 -
 -  if ((l = PyList_New(sipCpp->size())) == NULL)
 -    return NULL;
 -
 -  // Set the list elements.
 -  QSet<int>::iterator it = sipCpp->begin();
 -  for (int i = 0; it != sipCpp->end(); ++it, ++i)
 -  {
 -    PyObject *tobj;
 -
 -    if ((tobj = PyInt_FromLong(*it)) == NULL)
 -    {
 -      Py_DECREF(l);
 -      return NULL;
 -    }
 -    PyList_SET_ITEM(l, i, tobj);
 -  }
 -
 -  return l;
 -%End
 -
 -%ConvertToTypeCode
 -  // Check the type if that is all that is required.
 -  if (sipIsErr == NULL)
 -    return PyList_Check(sipPy);
 -
 -  QSet<int> *qset = new QSet<int>;
 -
 -  for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
 -  {
 -    qset->insert(PyInt_AsLong(PyList_GET_ITEM(sipPy, i)));
 -  }
 -
 -  *sipCppPtr = qset;
 -  return sipGetState(sipTransferObj);
 -%End
 -
 -};
 -
 -
  template <TYPE>
  %MappedType QSet<TYPE>
  {
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/2985#comment:1>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list