summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-01-28 19:11:49 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2011-01-31 14:41:43 -0200
commit47c7ea62996992d5e6b68f67c914f7d7bdf71864 (patch)
treedd600acfe43f620ac8523cf8b70ea01e4ed2a1a7
parent4835555d4874527ddaf4b0c3bb4c017da96fa9c0 (diff)
downloadshiboken-47c7ea62996992d5e6b68f67c914f7d7bdf71864.tar.gz
shiboken-47c7ea62996992d5e6b68f67c914f7d7bdf71864.tar.xz
shiboken-47c7ea62996992d5e6b68f67c914f7d7bdf71864.zip
Fix bug613 - "QSvgRenderer chooses QByteArray overload when given a file path"
QString arguments will always be evaluated before QByteArray arguments. Reviewer: Luciano Wolf <lucianol.wolf@openbossa.org> Renato Ara├║jo <renato.filho@openbossa.org>
-rw-r--r--generator/overloaddata.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/generator/overloaddata.cpp b/generator/overloaddata.cpp
index 42b04fdf..f8fd831f 100644
--- a/generator/overloaddata.cpp
+++ b/generator/overloaddata.cpp
@@ -295,7 +295,7 @@ void OverloadData::sortNextOverloads()
} 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") {
+ } else if (checkQString && ov->argType()->indirections() > 0 && targetTypeEntryName != "QString" && targetTypeEntryName != "QByteArray") {
if (!graph.containsEdge(qstringIndex, sortData.map[targetTypeEntryName])) // Avoid cyclic dependency.
graph.addEdge(sortData.map[targetTypeEntryName], qstringIndex);
}
@@ -309,6 +309,10 @@ void OverloadData::sortNextOverloads()
}
}
+ // QByteArray args need to be checked after QString args
+ if (sortData.map.contains("QString") && sortData.map.contains("QByteArray"))
+ graph.addEdge(sortData.map["QString"], sortData.map["QByteArray"]);
+
foreach(OverloadData* ov, m_nextOverloadData) {
const AbstractMetaType* targetType = ov->argType();
if (!targetType->isEnum())