[sip] remove unused QPair conversion

This commit is contained in:
Denis Rouzaud 2018-02-12 09:22:53 -04:00
parent 31e93aecae
commit 338a73b32e

View File

@ -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