summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-11-30 16:02:59 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-12-09 19:25:36 -0300
commite7d76b1765e93c6bd4b5830f92d06b328e5f70a3 (patch)
treea87b22268cc67e832abf09dd3940e53959ca5462
parent96622477caf8406e8b3b92bfe835a4371ba287b8 (diff)
downloadpyside-e7d76b1765e93c6bd4b5830f92d06b328e5f70a3.tar.gz
pyside-e7d76b1765e93c6bd4b5830f92d06b328e5f70a3.tar.xz
pyside-e7d76b1765e93c6bd4b5830f92d06b328e5f70a3.zip
Fixed code for setting QtCore.__version_info__ to not use Shiboken::makeTuple.
-rw-r--r--PySide/QtCore/glue/qt_version.cpp5
-rw-r--r--PySide/QtCore/typesystem_core.xml10
2 files changed, 9 insertions, 6 deletions
diff --git a/PySide/QtCore/glue/qt_version.cpp b/PySide/QtCore/glue/qt_version.cpp
deleted file mode 100644
index 66f8c00..0000000
--- a/PySide/QtCore/glue/qt_version.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-QList<QByteArray> version = QByteArray(qVersion()).split('.');
-PyObject *pyQtVersion = Shiboken::makeTuple(version[0].toInt(), version[1].toInt(), version[2].toInt());
-
-PyModule_AddStringConstant(module, "__version__", qVersion());
-PyModule_AddObject(module, "__version_info__", pyQtVersion);
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index ea77ddc..9e698f1 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -891,7 +891,15 @@
qAddPostRoutine(PySide::globalPostRoutineCallback);
</inject-code>
- <inject-code class="target" position="end" file="glue/qt_version.cpp" />
+ <inject-code class="target" position="end">
+ QList&lt;QByteArray&gt; version = QByteArray(qVersion()).split('.');
+ PyObject* pyQtVersion = PyTuple_New(3);
+ for (int i = 0; i &lt; 3; ++i)
+ PyTuple_SET_ITEM(pyQtVersion, i, PyInt_FromLong(version[i].toInt()));
+ PyModule_AddObject(module, "__version_info__", pyQtVersion);
+ PyModule_AddStringConstant(module, "__version__", qVersion());
+ </inject-code>
+
<inject-code class="target" position="end">
{ // Avoid name clash
Shiboken::AutoDecRef atexit(Shiboken::Module::import("atexit"));