diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-11 15:26:55 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-12 04:50:58 +0000 |
commit | dbb78237ef6622a2daae32fa3f5fa0cd9b1ffda5 (patch) | |
tree | 19ed9388e1013095f6ca0f6ab8f30d2139ba640c /sources/shiboken2/ApiExtractor | |
parent | 9f7532987dfcebb195fc46a9349975e00ab4ea62 (diff) |
shiboken: Line-wrap message about not find function for modification
Put each candidate on a new line and limit the number of member
functions in the output.
Change-Id: Ia628e61009997b37e0f3c2129fba5ccfa29f763e
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor')
-rw-r--r-- | sources/shiboken2/ApiExtractor/messages.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sources/shiboken2/ApiExtractor/messages.cpp b/sources/shiboken2/ApiExtractor/messages.cpp index c4537ee39..b81585933 100644 --- a/sources/shiboken2/ApiExtractor/messages.cpp +++ b/sources/shiboken2/ApiExtractor/messages.cpp @@ -55,15 +55,17 @@ QString msgNoFunctionForModification(const QString &signature, str << " (specified as '" << originalSignature << "')"; str << " for function modification in '" << className << "' not found."; - if (possibleSignatures.isEmpty()) { - str << " No candidates were found. Member functions: "; - for (int f = 0, size = allFunctions.size(); f < size; ++f) { - if (f) - str << ", "; - str << allFunctions.at(f)->minimalSignature(); - } - } else { - str << " Possible candidates: " << possibleSignatures.join(QLatin1String(", ")); + if (!possibleSignatures.isEmpty()) { + str << "\n Possible candidates:\n"; + for (const auto &s : possibleSignatures) + str << " " << s << '\n'; + } else if (!allFunctions.isEmpty()) { + str << "\n No candidates were found. Member functions:\n"; + const int maxCount = qMin(10, allFunctions.size()); + for (int f = 0; f < maxCount; ++f) + str << " " << allFunctions.at(f)->minimalSignature() << '\n'; + if (maxCount < allFunctions.size()) + str << " ...\n"; } return result; } |