/*
 * Module code.
 *
 * Generated by SIP 4.12.4 on Fri Dec 30 00:40:58 2011
 */

#include "sipAPInepomuk.h"

#line 33 "/usr/local/share/py-sip/QtCore/qlist.sip"
#include <qlist.h>
#line 12 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"

#line 28 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/query.sip"
#include <nepomuk/query.h>
#line 44 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/query.sip"
#include <nepomuk/query.h>
#line 18 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"


extern "C" {static void assign_QList_0100Nepomuk_Query_Query_RequestProperty(void *, SIP_SSIZE_T, const void *);}
static void assign_QList_0100Nepomuk_Query_Query_RequestProperty(void *sipDst, SIP_SSIZE_T sipDstIdx, const void *sipSrc)
{
    reinterpret_cast<QList<Nepomuk::Query::Query::RequestProperty> *>(sipDst)[sipDstIdx] = *reinterpret_cast<const QList<Nepomuk::Query::Query::RequestProperty> *>(sipSrc);
}


extern "C" {static void *array_QList_0100Nepomuk_Query_Query_RequestProperty(SIP_SSIZE_T);}
static void *array_QList_0100Nepomuk_Query_Query_RequestProperty(SIP_SSIZE_T sipNrElem)
{
    return new QList<Nepomuk::Query::Query::RequestProperty>[sipNrElem];
}


extern "C" {static void *copy_QList_0100Nepomuk_Query_Query_RequestProperty(const void *, SIP_SSIZE_T);}
static void *copy_QList_0100Nepomuk_Query_Query_RequestProperty(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new QList<Nepomuk::Query::Query::RequestProperty>(reinterpret_cast<const QList<Nepomuk::Query::Query::RequestProperty> *>(sipSrc)[sipSrcIdx]);
}


/* Call the mapped type's destructor. */
extern "C" {static void release_QList_0100Nepomuk_Query_Query_RequestProperty(void *, int);}
static void release_QList_0100Nepomuk_Query_Query_RequestProperty(void *ptr, int)
{
    Py_BEGIN_ALLOW_THREADS
    delete reinterpret_cast<QList<Nepomuk::Query::Query::RequestProperty> *>(ptr);
    Py_END_ALLOW_THREADS
}



extern "C" {static int convertTo_QList_0100Nepomuk_Query_Query_RequestProperty(PyObject *, void **, int *, PyObject *);}
static int convertTo_QList_0100Nepomuk_Query_Query_RequestProperty(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QList<Nepomuk::Query::Query::RequestProperty> **sipCppPtr = reinterpret_cast<QList<Nepomuk::Query::Query::RequestProperty> **>(sipCppPtrV);

#line 64 "/usr/local/share/py-sip/QtCore/qlist.sip"
    SIP_SSIZE_T len;

    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0)
            return 0;

        for (SIP_SSIZE_T i = 0; i < len; ++i)
        {
            PyObject *itm = PySequence_ITEM(sipPy, i);
            bool ok = (itm && sipCanConvertToType(itm, sipType_Nepomuk_Query_Query_RequestProperty, SIP_NOT_NONE));

            Py_XDECREF(itm);

            if (!ok)
                return 0;
        }

        return 1;
    }

    QList<Nepomuk::Query::Query::RequestProperty> *ql = new QList<Nepomuk::Query::Query::RequestProperty>;
    len = PySequence_Size(sipPy);
 
    for (SIP_SSIZE_T i = 0; i < len; ++i)
    {
        PyObject *itm = PySequence_ITEM(sipPy, i);
        int state;
        Nepomuk::Query::Query::RequestProperty *t = reinterpret_cast<Nepomuk::Query::Query::RequestProperty *>(sipConvertToType(itm, sipType_Nepomuk_Query_Query_RequestProperty, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));

        Py_DECREF(itm);
 
        if (*sipIsErr)
        {
            sipReleaseType(t, sipType_Nepomuk_Query_Query_RequestProperty, state);

            delete ql;
            return 0;
        }

        ql->append(*t);

        sipReleaseType(t, sipType_Nepomuk_Query_Query_RequestProperty, state);
    }
 
    *sipCppPtr = ql;
 
    return sipGetState(sipTransferObj);
#line 108 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


extern "C" {static PyObject *convertFrom_QList_0100Nepomuk_Query_Query_RequestProperty(void *, PyObject *);}
static PyObject *convertFrom_QList_0100Nepomuk_Query_Query_RequestProperty(void *sipCppV,PyObject *sipTransferObj)
{
   QList<Nepomuk::Query::Query::RequestProperty> *sipCpp = reinterpret_cast<QList<Nepomuk::Query::Query::RequestProperty> *>(sipCppV);

#line 37 "/usr/local/share/py-sip/QtCore/qlist.sip"
    // Create the list.
    PyObject *l;

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

    // Set the list elements.
    for (int i = 0; i < sipCpp->size(); ++i)
    {
        Nepomuk::Query::Query::RequestProperty *t = new Nepomuk::Query::Query::RequestProperty(sipCpp->at(i));
        PyObject *tobj;

        if ((tobj = sipConvertFromNewType(t, sipType_Nepomuk_Query_Query_RequestProperty, sipTransferObj)) == NULL)
        {
            Py_DECREF(l);
            delete t;

            return NULL;
        }

        PyList_SET_ITEM(l, i, tobj);
    }

    return l;
#line 142 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


sipMappedTypeDef sipTypeDef_nepomuk_QList_0100Nepomuk_Query_Query_RequestProperty = {
    {
        -1,
        0,
        0,
        SIP_TYPE_MAPPED,
        sipNameNr_621,
        {0}
    },
    {
        -1,
        {0, 0, 1},
        0, 0,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    },
    assign_QList_0100Nepomuk_Query_Query_RequestProperty,
    array_QList_0100Nepomuk_Query_Query_RequestProperty,
    copy_QList_0100Nepomuk_Query_Query_RequestProperty,
    release_QList_0100Nepomuk_Query_Query_RequestProperty,
    convertTo_QList_0100Nepomuk_Query_Query_RequestProperty,
    convertFrom_QList_0100Nepomuk_Query_Query_RequestProperty
};

#line 33 "/usr/local/share/py-sip/QtCore/qlist.sip"
#include <qlist.h>
#line 173 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"

#line 27 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/tag.sip"
#include <nepomuk/tag.h>
#line 177 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"


extern "C" {static void assign_QList_0100Nepomuk_Tag(void *, SIP_SSIZE_T, const void *);}
static void assign_QList_0100Nepomuk_Tag(void *sipDst, SIP_SSIZE_T sipDstIdx, const void *sipSrc)
{
    reinterpret_cast<QList<Nepomuk::Tag> *>(sipDst)[sipDstIdx] = *reinterpret_cast<const QList<Nepomuk::Tag> *>(sipSrc);
}


extern "C" {static void *array_QList_0100Nepomuk_Tag(SIP_SSIZE_T);}
static void *array_QList_0100Nepomuk_Tag(SIP_SSIZE_T sipNrElem)
{
    return new QList<Nepomuk::Tag>[sipNrElem];
}


extern "C" {static void *copy_QList_0100Nepomuk_Tag(const void *, SIP_SSIZE_T);}
static void *copy_QList_0100Nepomuk_Tag(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new QList<Nepomuk::Tag>(reinterpret_cast<const QList<Nepomuk::Tag> *>(sipSrc)[sipSrcIdx]);
}


/* Call the mapped type's destructor. */
extern "C" {static void release_QList_0100Nepomuk_Tag(void *, int);}
static void release_QList_0100Nepomuk_Tag(void *ptr, int)
{
    Py_BEGIN_ALLOW_THREADS
    delete reinterpret_cast<QList<Nepomuk::Tag> *>(ptr);
    Py_END_ALLOW_THREADS
}



extern "C" {static int convertTo_QList_0100Nepomuk_Tag(PyObject *, void **, int *, PyObject *);}
static int convertTo_QList_0100Nepomuk_Tag(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QList<Nepomuk::Tag> **sipCppPtr = reinterpret_cast<QList<Nepomuk::Tag> **>(sipCppPtrV);

#line 64 "/usr/local/share/py-sip/QtCore/qlist.sip"
    SIP_SSIZE_T len;

    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0)
            return 0;

        for (SIP_SSIZE_T i = 0; i < len; ++i)
        {
            PyObject *itm = PySequence_ITEM(sipPy, i);
            bool ok = (itm && sipCanConvertToType(itm, sipType_Nepomuk_Tag, SIP_NOT_NONE));

            Py_XDECREF(itm);

            if (!ok)
                return 0;
        }

        return 1;
    }

    QList<Nepomuk::Tag> *ql = new QList<Nepomuk::Tag>;
    len = PySequence_Size(sipPy);
 
    for (SIP_SSIZE_T i = 0; i < len; ++i)
    {
        PyObject *itm = PySequence_ITEM(sipPy, i);
        int state;
        Nepomuk::Tag *t = reinterpret_cast<Nepomuk::Tag *>(sipConvertToType(itm, sipType_Nepomuk_Tag, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));

        Py_DECREF(itm);
 
        if (*sipIsErr)
        {
            sipReleaseType(t, sipType_Nepomuk_Tag, state);

            delete ql;
            return 0;
        }

        ql->append(*t);

        sipReleaseType(t, sipType_Nepomuk_Tag, state);
    }
 
    *sipCppPtr = ql;
 
    return sipGetState(sipTransferObj);
#line 267 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


extern "C" {static PyObject *convertFrom_QList_0100Nepomuk_Tag(void *, PyObject *);}
static PyObject *convertFrom_QList_0100Nepomuk_Tag(void *sipCppV,PyObject *sipTransferObj)
{
   QList<Nepomuk::Tag> *sipCpp = reinterpret_cast<QList<Nepomuk::Tag> *>(sipCppV);

#line 37 "/usr/local/share/py-sip/QtCore/qlist.sip"
    // Create the list.
    PyObject *l;

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

    // Set the list elements.
    for (int i = 0; i < sipCpp->size(); ++i)
    {
        Nepomuk::Tag *t = new Nepomuk::Tag(sipCpp->at(i));
        PyObject *tobj;

        if ((tobj = sipConvertFromNewType(t, sipType_Nepomuk_Tag, sipTransferObj)) == NULL)
        {
            Py_DECREF(l);
            delete t;

            return NULL;
        }

        PyList_SET_ITEM(l, i, tobj);
    }

    return l;
#line 301 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


sipMappedTypeDef sipTypeDef_nepomuk_QList_0100Nepomuk_Tag = {
    {
        -1,
        0,
        0,
        SIP_TYPE_MAPPED,
        sipNameNr_7277,
        {0}
    },
    {
        -1,
        {0, 0, 1},
        0, 0,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    },
    assign_QList_0100Nepomuk_Tag,
    array_QList_0100Nepomuk_Tag,
    copy_QList_0100Nepomuk_Tag,
    release_QList_0100Nepomuk_Tag,
    convertTo_QList_0100Nepomuk_Tag,
    convertFrom_QList_0100Nepomuk_Tag
};

#line 33 "/usr/local/share/py-sip/QtCore/qlist.sip"
#include <qlist.h>
#line 332 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"

#line 46 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/resource.sip"
#include <nepomuk/resource.h>
#line 336 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"


extern "C" {static void assign_QList_0100Nepomuk_Resource(void *, SIP_SSIZE_T, const void *);}
static void assign_QList_0100Nepomuk_Resource(void *sipDst, SIP_SSIZE_T sipDstIdx, const void *sipSrc)
{
    reinterpret_cast<QList<Nepomuk::Resource> *>(sipDst)[sipDstIdx] = *reinterpret_cast<const QList<Nepomuk::Resource> *>(sipSrc);
}


extern "C" {static void *array_QList_0100Nepomuk_Resource(SIP_SSIZE_T);}
static void *array_QList_0100Nepomuk_Resource(SIP_SSIZE_T sipNrElem)
{
    return new QList<Nepomuk::Resource>[sipNrElem];
}


extern "C" {static void *copy_QList_0100Nepomuk_Resource(const void *, SIP_SSIZE_T);}
static void *copy_QList_0100Nepomuk_Resource(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new QList<Nepomuk::Resource>(reinterpret_cast<const QList<Nepomuk::Resource> *>(sipSrc)[sipSrcIdx]);
}


/* Call the mapped type's destructor. */
extern "C" {static void release_QList_0100Nepomuk_Resource(void *, int);}
static void release_QList_0100Nepomuk_Resource(void *ptr, int)
{
    Py_BEGIN_ALLOW_THREADS
    delete reinterpret_cast<QList<Nepomuk::Resource> *>(ptr);
    Py_END_ALLOW_THREADS
}



extern "C" {static int convertTo_QList_0100Nepomuk_Resource(PyObject *, void **, int *, PyObject *);}
static int convertTo_QList_0100Nepomuk_Resource(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QList<Nepomuk::Resource> **sipCppPtr = reinterpret_cast<QList<Nepomuk::Resource> **>(sipCppPtrV);

#line 64 "/usr/local/share/py-sip/QtCore/qlist.sip"
    SIP_SSIZE_T len;

    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0)
            return 0;

        for (SIP_SSIZE_T i = 0; i < len; ++i)
        {
            PyObject *itm = PySequence_ITEM(sipPy, i);
            bool ok = (itm && sipCanConvertToType(itm, sipType_Nepomuk_Resource, SIP_NOT_NONE));

            Py_XDECREF(itm);

            if (!ok)
                return 0;
        }

        return 1;
    }

    QList<Nepomuk::Resource> *ql = new QList<Nepomuk::Resource>;
    len = PySequence_Size(sipPy);
 
    for (SIP_SSIZE_T i = 0; i < len; ++i)
    {
        PyObject *itm = PySequence_ITEM(sipPy, i);
        int state;
        Nepomuk::Resource *t = reinterpret_cast<Nepomuk::Resource *>(sipConvertToType(itm, sipType_Nepomuk_Resource, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));

        Py_DECREF(itm);
 
        if (*sipIsErr)
        {
            sipReleaseType(t, sipType_Nepomuk_Resource, state);

            delete ql;
            return 0;
        }

        ql->append(*t);

        sipReleaseType(t, sipType_Nepomuk_Resource, state);
    }
 
    *sipCppPtr = ql;
 
    return sipGetState(sipTransferObj);
#line 426 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


extern "C" {static PyObject *convertFrom_QList_0100Nepomuk_Resource(void *, PyObject *);}
static PyObject *convertFrom_QList_0100Nepomuk_Resource(void *sipCppV,PyObject *sipTransferObj)
{
   QList<Nepomuk::Resource> *sipCpp = reinterpret_cast<QList<Nepomuk::Resource> *>(sipCppV);

#line 37 "/usr/local/share/py-sip/QtCore/qlist.sip"
    // Create the list.
    PyObject *l;

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

    // Set the list elements.
    for (int i = 0; i < sipCpp->size(); ++i)
    {
        Nepomuk::Resource *t = new Nepomuk::Resource(sipCpp->at(i));
        PyObject *tobj;

        if ((tobj = sipConvertFromNewType(t, sipType_Nepomuk_Resource, sipTransferObj)) == NULL)
        {
            Py_DECREF(l);
            delete t;

            return NULL;
        }

        PyList_SET_ITEM(l, i, tobj);
    }

    return l;
#line 460 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


sipMappedTypeDef sipTypeDef_nepomuk_QList_0100Nepomuk_Resource = {
    {
        -1,
        0,
        0,
        SIP_TYPE_MAPPED,
        sipNameNr_5028,
        {0}
    },
    {
        -1,
        {0, 0, 1},
        0, 0,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    },
    assign_QList_0100Nepomuk_Resource,
    array_QList_0100Nepomuk_Resource,
    copy_QList_0100Nepomuk_Resource,
    release_QList_0100Nepomuk_Resource,
    convertTo_QList_0100Nepomuk_Resource,
    convertFrom_QList_0100Nepomuk_Resource
};

#line 33 "/usr/local/share/py-sip/QtCore/qhash.sip"
#include <qhash.h>
#line 491 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"

#line 35 "/usr/local/share/py-sip/QtCore/qurl.sip"
#include <qurl.h>
#line 495 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
#line 27 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/variant.sip"
#include <nepomuk/variant.h>
#line 498 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"


extern "C" {static void assign_QHash_0100QUrl_0100Nepomuk_Variant(void *, SIP_SSIZE_T, const void *);}
static void assign_QHash_0100QUrl_0100Nepomuk_Variant(void *sipDst, SIP_SSIZE_T sipDstIdx, const void *sipSrc)
{
    reinterpret_cast<QHash<QUrl,Nepomuk::Variant> *>(sipDst)[sipDstIdx] = *reinterpret_cast<const QHash<QUrl,Nepomuk::Variant> *>(sipSrc);
}


extern "C" {static void *array_QHash_0100QUrl_0100Nepomuk_Variant(SIP_SSIZE_T);}
static void *array_QHash_0100QUrl_0100Nepomuk_Variant(SIP_SSIZE_T sipNrElem)
{
    return new QHash<QUrl,Nepomuk::Variant>[sipNrElem];
}


extern "C" {static void *copy_QHash_0100QUrl_0100Nepomuk_Variant(const void *, SIP_SSIZE_T);}
static void *copy_QHash_0100QUrl_0100Nepomuk_Variant(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new QHash<QUrl,Nepomuk::Variant>(reinterpret_cast<const QHash<QUrl,Nepomuk::Variant> *>(sipSrc)[sipSrcIdx]);
}


/* Call the mapped type's destructor. */
extern "C" {static void release_QHash_0100QUrl_0100Nepomuk_Variant(void *, int);}
static void release_QHash_0100QUrl_0100Nepomuk_Variant(void *ptr, int)
{
    Py_BEGIN_ALLOW_THREADS
    delete reinterpret_cast<QHash<QUrl,Nepomuk::Variant> *>(ptr);
    Py_END_ALLOW_THREADS
}



extern "C" {static int convertTo_QHash_0100QUrl_0100Nepomuk_Variant(PyObject *, void **, int *, PyObject *);}
static int convertTo_QHash_0100QUrl_0100Nepomuk_Variant(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QHash<QUrl,Nepomuk::Variant> **sipCppPtr = reinterpret_cast<QHash<QUrl,Nepomuk::Variant> **>(sipCppPtrV);

#line 89 "/usr/local/share/py-sip/QtCore/qhash.sip"
    PyObject *t1obj, *t2obj;
    SIP_SSIZE_T i = 0;

    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PyDict_Check(sipPy))
            return 0;

        while (PyDict_Next(sipPy, &i, &t1obj, &t2obj))
        {
            if (!sipCanConvertToType(t1obj, sipType_QUrl, SIP_NOT_NONE))
                return 0;

            if (!sipCanConvertToType(t2obj, sipType_Nepomuk_Variant, SIP_NOT_NONE))
                return 0;
        } 

        return 1;
    }

    QHash<QUrl, Nepomuk::Variant> *qm = new QHash<QUrl, Nepomuk::Variant>;
 
    while (PyDict_Next(sipPy, &i, &t1obj, &t2obj))
    {
        int state1, state2;

        QUrl *t1 = reinterpret_cast<QUrl *>(sipConvertToType(t1obj, sipType_QUrl, sipTransferObj, SIP_NOT_NONE, &state1, sipIsErr));
        Nepomuk::Variant *t2 = reinterpret_cast<Nepomuk::Variant *>(sipConvertToType(t2obj, sipType_Nepomuk_Variant, sipTransferObj, SIP_NOT_NONE, &state2, sipIsErr));
 
        if (*sipIsErr)
        {
            sipReleaseType(t1, sipType_QUrl, state1);
            sipReleaseType(t2, sipType_Nepomuk_Variant, state2);

            delete qm;
            return 0;
        }

        qm->insert(*t1, *t2);

        sipReleaseType(t1, sipType_QUrl, state1);
        sipReleaseType(t2, sipType_Nepomuk_Variant, state2);
    }
 
    *sipCppPtr = qm;
 
    return sipGetState(sipTransferObj);
#line 587 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


extern "C" {static PyObject *convertFrom_QHash_0100QUrl_0100Nepomuk_Variant(void *, PyObject *);}
static PyObject *convertFrom_QHash_0100QUrl_0100Nepomuk_Variant(void *sipCppV,PyObject *sipTransferObj)
{
   QHash<QUrl,Nepomuk::Variant> *sipCpp = reinterpret_cast<QHash<QUrl,Nepomuk::Variant> *>(sipCppV);

#line 37 "/usr/local/share/py-sip/QtCore/qhash.sip"
    // Create the dictionary.
    PyObject *d = PyDict_New();

    if (!d)
        return NULL;

    // Set the dictionary elements.
    QHash<QUrl, Nepomuk::Variant>::const_iterator i = sipCpp->constBegin();

    while (i != sipCpp->constEnd())
    {
        QUrl *t1 = new QUrl(i.key());
        Nepomuk::Variant *t2 = new Nepomuk::Variant(i.value());

        PyObject *t1obj = sipConvertFromNewType(t1, sipType_QUrl, sipTransferObj);
        PyObject *t2obj = sipConvertFromNewType(t2, sipType_Nepomuk_Variant, sipTransferObj);

        if (t1obj == NULL || t2obj == NULL || PyDict_SetItem(d, t1obj, t2obj) < 0)
        {
            Py_DECREF(d);

            if (t1obj)
            {
                Py_DECREF(t1obj);
            }
            else
            {
                delete t1;
            }

            if (t2obj)
            {
                Py_DECREF(t2obj);
            }
            else
            {
                delete t2;
            }

            return NULL;
        }

        Py_DECREF(t1obj);
        Py_DECREF(t2obj);

        ++i;
    }

    return d;
#line 646 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


sipMappedTypeDef sipTypeDef_nepomuk_QHash_0100QUrl_0100Nepomuk_Variant = {
    {
        -1,
        0,
        0,
        SIP_TYPE_MAPPED,
        sipNameNr_3545,
        {0}
    },
    {
        -1,
        {0, 0, 1},
        0, 0,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    },
    assign_QHash_0100QUrl_0100Nepomuk_Variant,
    array_QHash_0100QUrl_0100Nepomuk_Variant,
    copy_QHash_0100QUrl_0100Nepomuk_Variant,
    release_QHash_0100QUrl_0100Nepomuk_Variant,
    convertTo_QHash_0100QUrl_0100Nepomuk_Variant,
    convertFrom_QHash_0100QUrl_0100Nepomuk_Variant
};

#line 33 "/usr/local/share/py-sip/QtCore/qhash.sip"
#include <qhash.h>
#line 677 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"

#line 77 "/usr/local/share/py-sip/QtCore/qstring.sip"
#include <qstring.h>
#line 681 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
#line 27 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/variant.sip"
#include <nepomuk/variant.h>
#line 684 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
#line 36 "/usr/local/share/py-sip/QtCore/qstring.sip"
#include <qstring.h>
#line 687 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"


extern "C" {static void assign_QHash_0100QString_0100Nepomuk_Variant(void *, SIP_SSIZE_T, const void *);}
static void assign_QHash_0100QString_0100Nepomuk_Variant(void *sipDst, SIP_SSIZE_T sipDstIdx, const void *sipSrc)
{
    reinterpret_cast<QHash<QString,Nepomuk::Variant> *>(sipDst)[sipDstIdx] = *reinterpret_cast<const QHash<QString,Nepomuk::Variant> *>(sipSrc);
}


extern "C" {static void *array_QHash_0100QString_0100Nepomuk_Variant(SIP_SSIZE_T);}
static void *array_QHash_0100QString_0100Nepomuk_Variant(SIP_SSIZE_T sipNrElem)
{
    return new QHash<QString,Nepomuk::Variant>[sipNrElem];
}


extern "C" {static void *copy_QHash_0100QString_0100Nepomuk_Variant(const void *, SIP_SSIZE_T);}
static void *copy_QHash_0100QString_0100Nepomuk_Variant(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new QHash<QString,Nepomuk::Variant>(reinterpret_cast<const QHash<QString,Nepomuk::Variant> *>(sipSrc)[sipSrcIdx]);
}


/* Call the mapped type's destructor. */
extern "C" {static void release_QHash_0100QString_0100Nepomuk_Variant(void *, int);}
static void release_QHash_0100QString_0100Nepomuk_Variant(void *ptr, int)
{
    Py_BEGIN_ALLOW_THREADS
    delete reinterpret_cast<QHash<QString,Nepomuk::Variant> *>(ptr);
    Py_END_ALLOW_THREADS
}



extern "C" {static int convertTo_QHash_0100QString_0100Nepomuk_Variant(PyObject *, void **, int *, PyObject *);}
static int convertTo_QHash_0100QString_0100Nepomuk_Variant(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QHash<QString,Nepomuk::Variant> **sipCppPtr = reinterpret_cast<QHash<QString,Nepomuk::Variant> **>(sipCppPtrV);

#line 89 "/usr/local/share/py-sip/QtCore/qhash.sip"
    PyObject *t1obj, *t2obj;
    SIP_SSIZE_T i = 0;

    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PyDict_Check(sipPy))
            return 0;

        while (PyDict_Next(sipPy, &i, &t1obj, &t2obj))
        {
            if (!sipCanConvertToType(t1obj, sipType_QString, SIP_NOT_NONE))
                return 0;

            if (!sipCanConvertToType(t2obj, sipType_Nepomuk_Variant, SIP_NOT_NONE))
                return 0;
        } 

        return 1;
    }

    QHash<QString, Nepomuk::Variant> *qm = new QHash<QString, Nepomuk::Variant>;
 
    while (PyDict_Next(sipPy, &i, &t1obj, &t2obj))
    {
        int state1, state2;

        QString *t1 = reinterpret_cast<QString *>(sipConvertToType(t1obj, sipType_QString, sipTransferObj, SIP_NOT_NONE, &state1, sipIsErr));
        Nepomuk::Variant *t2 = reinterpret_cast<Nepomuk::Variant *>(sipConvertToType(t2obj, sipType_Nepomuk_Variant, sipTransferObj, SIP_NOT_NONE, &state2, sipIsErr));
 
        if (*sipIsErr)
        {
            sipReleaseType(t1, sipType_QString, state1);
            sipReleaseType(t2, sipType_Nepomuk_Variant, state2);

            delete qm;
            return 0;
        }

        qm->insert(*t1, *t2);

        sipReleaseType(t1, sipType_QString, state1);
        sipReleaseType(t2, sipType_Nepomuk_Variant, state2);
    }
 
    *sipCppPtr = qm;
 
    return sipGetState(sipTransferObj);
#line 776 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


extern "C" {static PyObject *convertFrom_QHash_0100QString_0100Nepomuk_Variant(void *, PyObject *);}
static PyObject *convertFrom_QHash_0100QString_0100Nepomuk_Variant(void *sipCppV,PyObject *sipTransferObj)
{
   QHash<QString,Nepomuk::Variant> *sipCpp = reinterpret_cast<QHash<QString,Nepomuk::Variant> *>(sipCppV);

#line 37 "/usr/local/share/py-sip/QtCore/qhash.sip"
    // Create the dictionary.
    PyObject *d = PyDict_New();

    if (!d)
        return NULL;

    // Set the dictionary elements.
    QHash<QString, Nepomuk::Variant>::const_iterator i = sipCpp->constBegin();

    while (i != sipCpp->constEnd())
    {
        QString *t1 = new QString(i.key());
        Nepomuk::Variant *t2 = new Nepomuk::Variant(i.value());

        PyObject *t1obj = sipConvertFromNewType(t1, sipType_QString, sipTransferObj);
        PyObject *t2obj = sipConvertFromNewType(t2, sipType_Nepomuk_Variant, sipTransferObj);

        if (t1obj == NULL || t2obj == NULL || PyDict_SetItem(d, t1obj, t2obj) < 0)
        {
            Py_DECREF(d);

            if (t1obj)
            {
                Py_DECREF(t1obj);
            }
            else
            {
                delete t1;
            }

            if (t2obj)
            {
                Py_DECREF(t2obj);
            }
            else
            {
                delete t2;
            }

            return NULL;
        }

        Py_DECREF(t1obj);
        Py_DECREF(t2obj);

        ++i;
    }

    return d;
#line 835 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


sipMappedTypeDef sipTypeDef_nepomuk_QHash_0100QString_0100Nepomuk_Variant = {
    {
        -1,
        0,
        0,
        SIP_TYPE_MAPPED,
        sipNameNr_2956,
        {0}
    },
    {
        -1,
        {0, 0, 1},
        0, 0,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    },
    assign_QHash_0100QString_0100Nepomuk_Variant,
    array_QHash_0100QString_0100Nepomuk_Variant,
    copy_QHash_0100QString_0100Nepomuk_Variant,
    release_QHash_0100QString_0100Nepomuk_Variant,
    convertTo_QHash_0100QString_0100Nepomuk_Variant,
    convertFrom_QHash_0100QString_0100Nepomuk_Variant
};

#line 33 "/usr/local/share/py-sip/QtCore/qlist.sip"
#include <qlist.h>
#line 866 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"

#line 29 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/class.sip"
#include <nepomuk/class.h>
#line 870 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"


extern "C" {static void assign_QList_0100Nepomuk_Types_Class(void *, SIP_SSIZE_T, const void *);}
static void assign_QList_0100Nepomuk_Types_Class(void *sipDst, SIP_SSIZE_T sipDstIdx, const void *sipSrc)
{
    reinterpret_cast<QList<Nepomuk::Types::Class> *>(sipDst)[sipDstIdx] = *reinterpret_cast<const QList<Nepomuk::Types::Class> *>(sipSrc);
}


extern "C" {static void *array_QList_0100Nepomuk_Types_Class(SIP_SSIZE_T);}
static void *array_QList_0100Nepomuk_Types_Class(SIP_SSIZE_T sipNrElem)
{
    return new QList<Nepomuk::Types::Class>[sipNrElem];
}


extern "C" {static void *copy_QList_0100Nepomuk_Types_Class(const void *, SIP_SSIZE_T);}
static void *copy_QList_0100Nepomuk_Types_Class(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new QList<Nepomuk::Types::Class>(reinterpret_cast<const QList<Nepomuk::Types::Class> *>(sipSrc)[sipSrcIdx]);
}


/* Call the mapped type's destructor. */
extern "C" {static void release_QList_0100Nepomuk_Types_Class(void *, int);}
static void release_QList_0100Nepomuk_Types_Class(void *ptr, int)
{
    Py_BEGIN_ALLOW_THREADS
    delete reinterpret_cast<QList<Nepomuk::Types::Class> *>(ptr);
    Py_END_ALLOW_THREADS
}



extern "C" {static int convertTo_QList_0100Nepomuk_Types_Class(PyObject *, void **, int *, PyObject *);}
static int convertTo_QList_0100Nepomuk_Types_Class(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QList<Nepomuk::Types::Class> **sipCppPtr = reinterpret_cast<QList<Nepomuk::Types::Class> **>(sipCppPtrV);

#line 64 "/usr/local/share/py-sip/QtCore/qlist.sip"
    SIP_SSIZE_T len;

    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0)
            return 0;

        for (SIP_SSIZE_T i = 0; i < len; ++i)
        {
            PyObject *itm = PySequence_ITEM(sipPy, i);
            bool ok = (itm && sipCanConvertToType(itm, sipType_Nepomuk_Types_Class, SIP_NOT_NONE));

            Py_XDECREF(itm);

            if (!ok)
                return 0;
        }

        return 1;
    }

    QList<Nepomuk::Types::Class> *ql = new QList<Nepomuk::Types::Class>;
    len = PySequence_Size(sipPy);
 
    for (SIP_SSIZE_T i = 0; i < len; ++i)
    {
        PyObject *itm = PySequence_ITEM(sipPy, i);
        int state;
        Nepomuk::Types::Class *t = reinterpret_cast<Nepomuk::Types::Class *>(sipConvertToType(itm, sipType_Nepomuk_Types_Class, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));

        Py_DECREF(itm);
 
        if (*sipIsErr)
        {
            sipReleaseType(t, sipType_Nepomuk_Types_Class, state);

            delete ql;
            return 0;
        }

        ql->append(*t);

        sipReleaseType(t, sipType_Nepomuk_Types_Class, state);
    }
 
    *sipCppPtr = ql;
 
    return sipGetState(sipTransferObj);
#line 960 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


extern "C" {static PyObject *convertFrom_QList_0100Nepomuk_Types_Class(void *, PyObject *);}
static PyObject *convertFrom_QList_0100Nepomuk_Types_Class(void *sipCppV,PyObject *sipTransferObj)
{
   QList<Nepomuk::Types::Class> *sipCpp = reinterpret_cast<QList<Nepomuk::Types::Class> *>(sipCppV);

#line 37 "/usr/local/share/py-sip/QtCore/qlist.sip"
    // Create the list.
    PyObject *l;

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

    // Set the list elements.
    for (int i = 0; i < sipCpp->size(); ++i)
    {
        Nepomuk::Types::Class *t = new Nepomuk::Types::Class(sipCpp->at(i));
        PyObject *tobj;

        if ((tobj = sipConvertFromNewType(t, sipType_Nepomuk_Types_Class, sipTransferObj)) == NULL)
        {
            Py_DECREF(l);
            delete t;

            return NULL;
        }

        PyList_SET_ITEM(l, i, tobj);
    }

    return l;
#line 994 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


sipMappedTypeDef sipTypeDef_nepomuk_QList_0100Nepomuk_Types_Class = {
    {
        -1,
        0,
        0,
        SIP_TYPE_MAPPED,
        sipNameNr_3574,
        {0}
    },
    {
        -1,
        {0, 0, 1},
        0, 0,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    },
    assign_QList_0100Nepomuk_Types_Class,
    array_QList_0100Nepomuk_Types_Class,
    copy_QList_0100Nepomuk_Types_Class,
    release_QList_0100Nepomuk_Types_Class,
    convertTo_QList_0100Nepomuk_Types_Class,
    convertFrom_QList_0100Nepomuk_Types_Class
};

#line 33 "/usr/local/share/py-sip/QtCore/qlist.sip"
#include <qlist.h>
#line 1025 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"

#line 29 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/property.sip"
#include <nepomuk/property.h>
#line 1029 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"


extern "C" {static void assign_QList_0100Nepomuk_Types_Property(void *, SIP_SSIZE_T, const void *);}
static void assign_QList_0100Nepomuk_Types_Property(void *sipDst, SIP_SSIZE_T sipDstIdx, const void *sipSrc)
{
    reinterpret_cast<QList<Nepomuk::Types::Property> *>(sipDst)[sipDstIdx] = *reinterpret_cast<const QList<Nepomuk::Types::Property> *>(sipSrc);
}


extern "C" {static void *array_QList_0100Nepomuk_Types_Property(SIP_SSIZE_T);}
static void *array_QList_0100Nepomuk_Types_Property(SIP_SSIZE_T sipNrElem)
{
    return new QList<Nepomuk::Types::Property>[sipNrElem];
}


extern "C" {static void *copy_QList_0100Nepomuk_Types_Property(const void *, SIP_SSIZE_T);}
static void *copy_QList_0100Nepomuk_Types_Property(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new QList<Nepomuk::Types::Property>(reinterpret_cast<const QList<Nepomuk::Types::Property> *>(sipSrc)[sipSrcIdx]);
}


/* Call the mapped type's destructor. */
extern "C" {static void release_QList_0100Nepomuk_Types_Property(void *, int);}
static void release_QList_0100Nepomuk_Types_Property(void *ptr, int)
{
    Py_BEGIN_ALLOW_THREADS
    delete reinterpret_cast<QList<Nepomuk::Types::Property> *>(ptr);
    Py_END_ALLOW_THREADS
}



extern "C" {static int convertTo_QList_0100Nepomuk_Types_Property(PyObject *, void **, int *, PyObject *);}
static int convertTo_QList_0100Nepomuk_Types_Property(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QList<Nepomuk::Types::Property> **sipCppPtr = reinterpret_cast<QList<Nepomuk::Types::Property> **>(sipCppPtrV);

#line 64 "/usr/local/share/py-sip/QtCore/qlist.sip"
    SIP_SSIZE_T len;

    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0)
            return 0;

        for (SIP_SSIZE_T i = 0; i < len; ++i)
        {
            PyObject *itm = PySequence_ITEM(sipPy, i);
            bool ok = (itm && sipCanConvertToType(itm, sipType_Nepomuk_Types_Property, SIP_NOT_NONE));

            Py_XDECREF(itm);

            if (!ok)
                return 0;
        }

        return 1;
    }

    QList<Nepomuk::Types::Property> *ql = new QList<Nepomuk::Types::Property>;
    len = PySequence_Size(sipPy);
 
    for (SIP_SSIZE_T i = 0; i < len; ++i)
    {
        PyObject *itm = PySequence_ITEM(sipPy, i);
        int state;
        Nepomuk::Types::Property *t = reinterpret_cast<Nepomuk::Types::Property *>(sipConvertToType(itm, sipType_Nepomuk_Types_Property, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));

        Py_DECREF(itm);
 
        if (*sipIsErr)
        {
            sipReleaseType(t, sipType_Nepomuk_Types_Property, state);

            delete ql;
            return 0;
        }

        ql->append(*t);

        sipReleaseType(t, sipType_Nepomuk_Types_Property, state);
    }
 
    *sipCppPtr = ql;
 
    return sipGetState(sipTransferObj);
#line 1119 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


extern "C" {static PyObject *convertFrom_QList_0100Nepomuk_Types_Property(void *, PyObject *);}
static PyObject *convertFrom_QList_0100Nepomuk_Types_Property(void *sipCppV,PyObject *sipTransferObj)
{
   QList<Nepomuk::Types::Property> *sipCpp = reinterpret_cast<QList<Nepomuk::Types::Property> *>(sipCppV);

#line 37 "/usr/local/share/py-sip/QtCore/qlist.sip"
    // Create the list.
    PyObject *l;

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

    // Set the list elements.
    for (int i = 0; i < sipCpp->size(); ++i)
    {
        Nepomuk::Types::Property *t = new Nepomuk::Types::Property(sipCpp->at(i));
        PyObject *tobj;

        if ((tobj = sipConvertFromNewType(t, sipType_Nepomuk_Types_Property, sipTransferObj)) == NULL)
        {
            Py_DECREF(l);
            delete t;

            return NULL;
        }

        PyList_SET_ITEM(l, i, tobj);
    }

    return l;
#line 1153 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


sipMappedTypeDef sipTypeDef_nepomuk_QList_0100Nepomuk_Types_Property = {
    {
        -1,
        0,
        0,
        SIP_TYPE_MAPPED,
        sipNameNr_2988,
        {0}
    },
    {
        -1,
        {0, 0, 1},
        0, 0,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    },
    assign_QList_0100Nepomuk_Types_Property,
    array_QList_0100Nepomuk_Types_Property,
    copy_QList_0100Nepomuk_Types_Property,
    release_QList_0100Nepomuk_Types_Property,
    convertTo_QList_0100Nepomuk_Types_Property,
    convertFrom_QList_0100Nepomuk_Types_Property
};

#line 33 "/usr/local/share/py-sip/QtCore/qlist.sip"
#include <qlist.h>
#line 1184 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"

#line 27 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/term.sip"
#include <nepomuk/term.h>
#line 1188 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"


extern "C" {static void assign_QList_0100Nepomuk_Query_Term(void *, SIP_SSIZE_T, const void *);}
static void assign_QList_0100Nepomuk_Query_Term(void *sipDst, SIP_SSIZE_T sipDstIdx, const void *sipSrc)
{
    reinterpret_cast<QList<Nepomuk::Query::Term> *>(sipDst)[sipDstIdx] = *reinterpret_cast<const QList<Nepomuk::Query::Term> *>(sipSrc);
}


extern "C" {static void *array_QList_0100Nepomuk_Query_Term(SIP_SSIZE_T);}
static void *array_QList_0100Nepomuk_Query_Term(SIP_SSIZE_T sipNrElem)
{
    return new QList<Nepomuk::Query::Term>[sipNrElem];
}


extern "C" {static void *copy_QList_0100Nepomuk_Query_Term(const void *, SIP_SSIZE_T);}
static void *copy_QList_0100Nepomuk_Query_Term(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new QList<Nepomuk::Query::Term>(reinterpret_cast<const QList<Nepomuk::Query::Term> *>(sipSrc)[sipSrcIdx]);
}


/* Call the mapped type's destructor. */
extern "C" {static void release_QList_0100Nepomuk_Query_Term(void *, int);}
static void release_QList_0100Nepomuk_Query_Term(void *ptr, int)
{
    Py_BEGIN_ALLOW_THREADS
    delete reinterpret_cast<QList<Nepomuk::Query::Term> *>(ptr);
    Py_END_ALLOW_THREADS
}



extern "C" {static int convertTo_QList_0100Nepomuk_Query_Term(PyObject *, void **, int *, PyObject *);}
static int convertTo_QList_0100Nepomuk_Query_Term(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QList<Nepomuk::Query::Term> **sipCppPtr = reinterpret_cast<QList<Nepomuk::Query::Term> **>(sipCppPtrV);

#line 64 "/usr/local/share/py-sip/QtCore/qlist.sip"
    SIP_SSIZE_T len;

    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0)
            return 0;

        for (SIP_SSIZE_T i = 0; i < len; ++i)
        {
            PyObject *itm = PySequence_ITEM(sipPy, i);
            bool ok = (itm && sipCanConvertToType(itm, sipType_Nepomuk_Query_Term, SIP_NOT_NONE));

            Py_XDECREF(itm);

            if (!ok)
                return 0;
        }

        return 1;
    }

    QList<Nepomuk::Query::Term> *ql = new QList<Nepomuk::Query::Term>;
    len = PySequence_Size(sipPy);
 
    for (SIP_SSIZE_T i = 0; i < len; ++i)
    {
        PyObject *itm = PySequence_ITEM(sipPy, i);
        int state;
        Nepomuk::Query::Term *t = reinterpret_cast<Nepomuk::Query::Term *>(sipConvertToType(itm, sipType_Nepomuk_Query_Term, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));

        Py_DECREF(itm);
 
        if (*sipIsErr)
        {
            sipReleaseType(t, sipType_Nepomuk_Query_Term, state);

            delete ql;
            return 0;
        }

        ql->append(*t);

        sipReleaseType(t, sipType_Nepomuk_Query_Term, state);
    }
 
    *sipCppPtr = ql;
 
    return sipGetState(sipTransferObj);
#line 1278 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


extern "C" {static PyObject *convertFrom_QList_0100Nepomuk_Query_Term(void *, PyObject *);}
static PyObject *convertFrom_QList_0100Nepomuk_Query_Term(void *sipCppV,PyObject *sipTransferObj)
{
   QList<Nepomuk::Query::Term> *sipCpp = reinterpret_cast<QList<Nepomuk::Query::Term> *>(sipCppV);

#line 37 "/usr/local/share/py-sip/QtCore/qlist.sip"
    // Create the list.
    PyObject *l;

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

    // Set the list elements.
    for (int i = 0; i < sipCpp->size(); ++i)
    {
        Nepomuk::Query::Term *t = new Nepomuk::Query::Term(sipCpp->at(i));
        PyObject *tobj;

        if ((tobj = sipConvertFromNewType(t, sipType_Nepomuk_Query_Term, sipTransferObj)) == NULL)
        {
            Py_DECREF(l);
            delete t;

            return NULL;
        }

        PyList_SET_ITEM(l, i, tobj);
    }

    return l;
#line 1312 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


sipMappedTypeDef sipTypeDef_nepomuk_QList_0100Nepomuk_Query_Term = {
    {
        -1,
        0,
        0,
        SIP_TYPE_MAPPED,
        sipNameNr_3980,
        {0}
    },
    {
        -1,
        {0, 0, 1},
        0, 0,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    },
    assign_QList_0100Nepomuk_Query_Term,
    array_QList_0100Nepomuk_Query_Term,
    copy_QList_0100Nepomuk_Query_Term,
    release_QList_0100Nepomuk_Query_Term,
    convertTo_QList_0100Nepomuk_Query_Term,
    convertFrom_QList_0100Nepomuk_Query_Term
};

#line 33 "/usr/local/share/py-sip/QtCore/qhash.sip"
#include <qhash.h>
#line 1343 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"

#line 77 "/usr/local/share/py-sip/QtCore/qstring.sip"
#include <qstring.h>
#line 1347 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
#line 29 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/property.sip"
#include <nepomuk/property.h>
#line 1350 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
#line 36 "/usr/local/share/py-sip/QtCore/qstring.sip"
#include <qstring.h>
#line 1353 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"


extern "C" {static void assign_QHash_0100QString_0100Nepomuk_Types_Property(void *, SIP_SSIZE_T, const void *);}
static void assign_QHash_0100QString_0100Nepomuk_Types_Property(void *sipDst, SIP_SSIZE_T sipDstIdx, const void *sipSrc)
{
    reinterpret_cast<QHash<QString,Nepomuk::Types::Property> *>(sipDst)[sipDstIdx] = *reinterpret_cast<const QHash<QString,Nepomuk::Types::Property> *>(sipSrc);
}


extern "C" {static void *array_QHash_0100QString_0100Nepomuk_Types_Property(SIP_SSIZE_T);}
static void *array_QHash_0100QString_0100Nepomuk_Types_Property(SIP_SSIZE_T sipNrElem)
{
    return new QHash<QString,Nepomuk::Types::Property>[sipNrElem];
}


extern "C" {static void *copy_QHash_0100QString_0100Nepomuk_Types_Property(const void *, SIP_SSIZE_T);}
static void *copy_QHash_0100QString_0100Nepomuk_Types_Property(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new QHash<QString,Nepomuk::Types::Property>(reinterpret_cast<const QHash<QString,Nepomuk::Types::Property> *>(sipSrc)[sipSrcIdx]);
}


/* Call the mapped type's destructor. */
extern "C" {static void release_QHash_0100QString_0100Nepomuk_Types_Property(void *, int);}
static void release_QHash_0100QString_0100Nepomuk_Types_Property(void *ptr, int)
{
    Py_BEGIN_ALLOW_THREADS
    delete reinterpret_cast<QHash<QString,Nepomuk::Types::Property> *>(ptr);
    Py_END_ALLOW_THREADS
}



extern "C" {static int convertTo_QHash_0100QString_0100Nepomuk_Types_Property(PyObject *, void **, int *, PyObject *);}
static int convertTo_QHash_0100QString_0100Nepomuk_Types_Property(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
    QHash<QString,Nepomuk::Types::Property> **sipCppPtr = reinterpret_cast<QHash<QString,Nepomuk::Types::Property> **>(sipCppPtrV);

#line 89 "/usr/local/share/py-sip/QtCore/qhash.sip"
    PyObject *t1obj, *t2obj;
    SIP_SSIZE_T i = 0;

    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PyDict_Check(sipPy))
            return 0;

        while (PyDict_Next(sipPy, &i, &t1obj, &t2obj))
        {
            if (!sipCanConvertToType(t1obj, sipType_QString, SIP_NOT_NONE))
                return 0;

            if (!sipCanConvertToType(t2obj, sipType_Nepomuk_Types_Property, SIP_NOT_NONE))
                return 0;
        } 

        return 1;
    }

    QHash<QString, Nepomuk::Types::Property> *qm = new QHash<QString, Nepomuk::Types::Property>;
 
    while (PyDict_Next(sipPy, &i, &t1obj, &t2obj))
    {
        int state1, state2;

        QString *t1 = reinterpret_cast<QString *>(sipConvertToType(t1obj, sipType_QString, sipTransferObj, SIP_NOT_NONE, &state1, sipIsErr));
        Nepomuk::Types::Property *t2 = reinterpret_cast<Nepomuk::Types::Property *>(sipConvertToType(t2obj, sipType_Nepomuk_Types_Property, sipTransferObj, SIP_NOT_NONE, &state2, sipIsErr));
 
        if (*sipIsErr)
        {
            sipReleaseType(t1, sipType_QString, state1);
            sipReleaseType(t2, sipType_Nepomuk_Types_Property, state2);

            delete qm;
            return 0;
        }

        qm->insert(*t1, *t2);

        sipReleaseType(t1, sipType_QString, state1);
        sipReleaseType(t2, sipType_Nepomuk_Types_Property, state2);
    }
 
    *sipCppPtr = qm;
 
    return sipGetState(sipTransferObj);
#line 1442 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


extern "C" {static PyObject *convertFrom_QHash_0100QString_0100Nepomuk_Types_Property(void *, PyObject *);}
static PyObject *convertFrom_QHash_0100QString_0100Nepomuk_Types_Property(void *sipCppV,PyObject *sipTransferObj)
{
   QHash<QString,Nepomuk::Types::Property> *sipCpp = reinterpret_cast<QHash<QString,Nepomuk::Types::Property> *>(sipCppV);

#line 37 "/usr/local/share/py-sip/QtCore/qhash.sip"
    // Create the dictionary.
    PyObject *d = PyDict_New();

    if (!d)
        return NULL;

    // Set the dictionary elements.
    QHash<QString, Nepomuk::Types::Property>::const_iterator i = sipCpp->constBegin();

    while (i != sipCpp->constEnd())
    {
        QString *t1 = new QString(i.key());
        Nepomuk::Types::Property *t2 = new Nepomuk::Types::Property(i.value());

        PyObject *t1obj = sipConvertFromNewType(t1, sipType_QString, sipTransferObj);
        PyObject *t2obj = sipConvertFromNewType(t2, sipType_Nepomuk_Types_Property, sipTransferObj);

        if (t1obj == NULL || t2obj == NULL || PyDict_SetItem(d, t1obj, t2obj) < 0)
        {
            Py_DECREF(d);

            if (t1obj)
            {
                Py_DECREF(t1obj);
            }
            else
            {
                delete t1;
            }

            if (t2obj)
            {
                Py_DECREF(t2obj);
            }
            else
            {
                delete t2;
            }

            return NULL;
        }

        Py_DECREF(t1obj);
        Py_DECREF(t2obj);

        ++i;
    }

    return d;
#line 1501 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/nepomuk/sipnepomukpart1.cpp"
}


sipMappedTypeDef sipTypeDef_nepomuk_QHash_0100QString_0100Nepomuk_Types_Property = {
    {
        -1,
        0,
        0,
        SIP_TYPE_MAPPED,
        sipNameNr_1665,
        {0}
    },
    {
        -1,
        {0, 0, 1},
        0, 0,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    },
    assign_QHash_0100QString_0100Nepomuk_Types_Property,
    array_QHash_0100QString_0100Nepomuk_Types_Property,
    copy_QHash_0100QString_0100Nepomuk_Types_Property,
    release_QHash_0100QString_0100Nepomuk_Types_Property,
    convertTo_QHash_0100QString_0100Nepomuk_Types_Property,
    convertFrom_QHash_0100QString_0100Nepomuk_Types_Property
};
