Skip to content

Commit

Permalink
[sip] remove unused QPair conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Feb 12, 2018
1 parent 31e93ae commit 338a73b
Showing 1 changed file with 0 additions and 59 deletions.
59 changes: 0 additions & 59 deletions python/core/conversions.sip
Expand Up @@ -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
Expand Down

0 comments on commit 338a73b

Please sign in to comment.