summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-11-10 18:33:00 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-11-11 10:43:05 -0300
commited83e5ef62ad4ba04aea50ba1bd10ec4684fd07c (patch)
treea90ab617de9b2a10417907a8fadcbeeaae69d43f /generator
parent9d3dfe4077857f1829ecdc6899ac4a383b9c32b7 (diff)
downloadshiboken-ed83e5ef62ad4ba04aea50ba1bd10ec4684fd07c.tar.gz
shiboken-ed83e5ef62ad4ba04aea50ba1bd10ec4684fd07c.tar.xz
shiboken-ed83e5ef62ad4ba04aea50ba1bd10ec4684fd07c.zip
Fix the fix that was previously reverted in d8e2d87f.
Reviewed by Lauro Moura <lauro.neto@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'generator')
-rw-r--r--generator/overloaddata.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/generator/overloaddata.cpp b/generator/overloaddata.cpp
index 9be972f1..29a1615f 100644
--- a/generator/overloaddata.cpp
+++ b/generator/overloaddata.cpp
@@ -147,6 +147,10 @@ void OverloadData::sortNextOverloads()
OverloadSortData sortData;
bool checkPyObject = false;
int pyobjectIndex = 0;
+ bool checkQString = false;
+ int qstringIndex = 0;
+ bool checkQVariant = false;
+ int qvariantIndex = 0;
// Primitive types that are not int, long, short,
// char and their respective unsigned counterparts.
@@ -172,6 +176,12 @@ void OverloadData::sortNextOverloads()
if (!checkPyObject && getTypeName(ov->argType()).contains("PyObject")) {
checkPyObject = true;
pyobjectIndex = sortData.lastProcessedItemId();
+ } else if (!checkQVariant && getTypeName(ov->argType()) == "QVariant") {
+ checkQVariant = true;
+ qvariantIndex = sortData.lastProcessedItemId();
+ } else if (!checkQString && getTypeName(ov->argType()) == "QString") {
+ checkQString = true;
+ qstringIndex = sortData.lastProcessedItemId();
}
foreach (const AbstractMetaType* instantiation, ov->argType()->instantiations()) {
@@ -265,8 +275,15 @@ void OverloadData::sortNextOverloads()
}
/* Add dependency on PyObject, so its check is the last one (too generic) */
- if (checkPyObject && !targetTypeEntryName.contains("PyObject"))
+ if (checkPyObject && !targetTypeEntryName.contains("PyObject")) {
graph.addEdge(sortData.map[targetTypeEntryName], pyobjectIndex);
+ } else if (checkQVariant && targetTypeEntryName != "QVariant") {
+ if (!graph.containsEdge(qvariantIndex, sortData.map[targetTypeEntryName])) // Avoid cyclic dependency.
+ graph.addEdge(sortData.map[targetTypeEntryName], qvariantIndex);
+ } else if (checkQString && ov->argType()->indirections() > 0 && targetTypeEntryName != "QString") {
+ if (!graph.containsEdge(qstringIndex, sortData.map[targetTypeEntryName])) // Avoid cyclic dependency.
+ graph.addEdge(sortData.map[targetTypeEntryName], qstringIndex);
+ }
if (targetTypeEntry->isEnum()) {
for (int i = 0; i < numPrimitives; ++i) {