Skip to content
Permalink
Browse files

[sip] remove unused QPair conversion

  • Loading branch information
3nids committed Feb 12, 2018
1 parent 31e93ae commit 338a73b32e499fbb72cd799c70c9df0426c47880
Showing with 0 additions and 59 deletions.
  1. +0 −59 python/core/conversions.sip
@@ -1683,65 +1683,6 @@ template<int, TYPE2*>
%End
};

%MappedType QList < QPair< QgsVectorLayer *, int > >
{
%TypeHeaderCode
#include <QPair>
#include <QList>
%End

%ConvertFromTypeCode
//convert map to a python dictionary
PyObject *d;

if ((d = PyList_New( sipCpp->size() )) == NULL)
return NULL;

for ( int i = 0; i<sipCpp->size(); i++ )
{
PyObject *p;
if ((p = PyList_New(2) ) == NULL)
{
Py_DECREF(d);
return NULL;
}

PyObject *t1obj = sipConvertFromNewType(sipCpp->at(i).first, sipType_QgsVectorLayer, sipTransferObj);
PyObject *t2obj = PyLong_FromLong( (long) sipCpp->at(i).second );
PyList_SetItem( p, 0, t1obj );
PyList_SetItem( p, 1, t2obj );

PyList_SetItem( d, i, p );
}

return d;
%End

%ConvertToTypeCode
Py_ssize_t i = 0;

QList < QPair< QgsVectorLayer *, int > > *qm = new QList< QPair< QgsVectorLayer *, int > >;

for ( i = 0; i < PyList_GET_SIZE(sipPy); i++ )
{
int state;

PyObject *sipPair = PyList_GetItem( sipPy, i );
PyObject *sipLayer = PyList_GetItem( sipPair, 0 );
PyObject *sipIdx = PyList_GetItem( sipPair, 1 );

QgsVectorLayer *t1 = reinterpret_cast<QgsVectorLayer *>(sipConvertToType(sipLayer, sipType_QgsVectorLayer, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
int idx = PyLong_AsLongLong(sipIdx);
qm->append( qMakePair<QgsVectorLayer *, int>( t1, idx ) );
sipReleaseType(t1, sipType_QgsVectorLayer, state);
}

*sipCppPtr = qm;

return sipGetState(sipTransferObj);
%End
};

%MappedType QMap< QPair< QString, QString>, QPair< int, int > >
{
%TypeHeaderCode

0 comments on commit 338a73b

Please sign in to comment.
You can’t perform that action at this time.