Skip to content

Commit 338a73b

Browse files
committed
[sip] remove unused QPair conversion
1 parent 31e93ae commit 338a73b

File tree

1 file changed

+0
-59
lines changed

1 file changed

+0
-59
lines changed

python/core/conversions.sip

-59
Original file line numberDiff line numberDiff line change
@@ -1683,65 +1683,6 @@ template<int, TYPE2*>
16831683
%End
16841684
};
16851685

1686-
%MappedType QList < QPair< QgsVectorLayer *, int > >
1687-
{
1688-
%TypeHeaderCode
1689-
#include <QPair>
1690-
#include <QList>
1691-
%End
1692-
1693-
%ConvertFromTypeCode
1694-
//convert map to a python dictionary
1695-
PyObject *d;
1696-
1697-
if ((d = PyList_New( sipCpp->size() )) == NULL)
1698-
return NULL;
1699-
1700-
for ( int i = 0; i<sipCpp->size(); i++ )
1701-
{
1702-
PyObject *p;
1703-
if ((p = PyList_New(2) ) == NULL)
1704-
{
1705-
Py_DECREF(d);
1706-
return NULL;
1707-
}
1708-
1709-
PyObject *t1obj = sipConvertFromNewType(sipCpp->at(i).first, sipType_QgsVectorLayer, sipTransferObj);
1710-
PyObject *t2obj = PyLong_FromLong( (long) sipCpp->at(i).second );
1711-
PyList_SetItem( p, 0, t1obj );
1712-
PyList_SetItem( p, 1, t2obj );
1713-
1714-
PyList_SetItem( d, i, p );
1715-
}
1716-
1717-
return d;
1718-
%End
1719-
1720-
%ConvertToTypeCode
1721-
Py_ssize_t i = 0;
1722-
1723-
QList < QPair< QgsVectorLayer *, int > > *qm = new QList< QPair< QgsVectorLayer *, int > >;
1724-
1725-
for ( i = 0; i < PyList_GET_SIZE(sipPy); i++ )
1726-
{
1727-
int state;
1728-
1729-
PyObject *sipPair = PyList_GetItem( sipPy, i );
1730-
PyObject *sipLayer = PyList_GetItem( sipPair, 0 );
1731-
PyObject *sipIdx = PyList_GetItem( sipPair, 1 );
1732-
1733-
QgsVectorLayer *t1 = reinterpret_cast<QgsVectorLayer *>(sipConvertToType(sipLayer, sipType_QgsVectorLayer, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
1734-
int idx = PyLong_AsLongLong(sipIdx);
1735-
qm->append( qMakePair<QgsVectorLayer *, int>( t1, idx ) );
1736-
sipReleaseType(t1, sipType_QgsVectorLayer, state);
1737-
}
1738-
1739-
*sipCppPtr = qm;
1740-
1741-
return sipGetState(sipTransferObj);
1742-
%End
1743-
};
1744-
17451686
%MappedType QMap< QPair< QString, QString>, QPair< int, int > >
17461687
{
17471688
%TypeHeaderCode

0 commit comments

Comments
 (0)