diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-01-24 15:19:40 -0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:12:55 -0300 |
commit | 70a863eb2da935505ffa325c1772b13f4a80bded (patch) | |
tree | 6e8b5bfb18d0e951d047b04ec2be29cd1bf09758 /generator/shibokengenerator.cpp | |
parent | 9d36585f19bf858db10bee4c8b1933ed81301a98 (diff) |
Fix bug#633 - "bool of null QDate (possibly other empty QString/null QObj types?) returns True for empty instance; probably should be False"
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Renato Araújo <renato.filho@openbossa.org>
Diffstat (limited to 'generator/shibokengenerator.cpp')
-rw-r--r-- | generator/shibokengenerator.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/generator/shibokengenerator.cpp b/generator/shibokengenerator.cpp index ebf63ab8c..06e526775 100644 --- a/generator/shibokengenerator.cpp +++ b/generator/shibokengenerator.cpp @@ -35,6 +35,7 @@ #define RETURN_VALUE_HEURISTIC "enable-return-value-heuristic" #define ENABLE_PYSIDE_EXTENSIONS "enable-pyside-extensions" #define DISABLE_VERBOSE_ERROR_MESSAGES "disable-verbose-error-messages" +#define USE_ISNULL_AS_NB_NONZERO "use-isnull-as-nb_nonzero" //static void dumpFunction(AbstractMetaFunctionList lst); static QString baseConversionString(QString typeName); @@ -1627,6 +1628,7 @@ QMap<QString, QString> ShibokenGenerator::options() const opts.insert(RETURN_VALUE_HEURISTIC, "Enable heuristics to detect parent relationship on return values (USE WITH CAUTION!)"); opts.insert(ENABLE_PYSIDE_EXTENSIONS, "Enable PySide extensions, such as support for signal/slots, use this if you are creating a binding for a Qt-based library."); opts.insert(DISABLE_VERBOSE_ERROR_MESSAGES, "Disable verbose error messages. Turn the python code hard to debug but safe few kB on the generated bindings."); + opts.insert(USE_ISNULL_AS_NB_NONZERO, "If a class have an isNull()const method, it will be used to compute the value of boolean casts"); return opts; } @@ -1636,6 +1638,7 @@ bool ShibokenGenerator::doSetup(const QMap<QString, QString>& args) m_usePySideExtensions = args.contains(ENABLE_PYSIDE_EXTENSIONS); m_userReturnValueHeuristic = args.contains(RETURN_VALUE_HEURISTIC); m_verboseErrorMessagesDisabled = args.contains(DISABLE_VERBOSE_ERROR_MESSAGES); + m_useIsNullAsNbNonZero = args.contains(USE_ISNULL_AS_NB_NONZERO); return true; } @@ -1654,6 +1657,11 @@ bool ShibokenGenerator::usePySideExtensions() const return m_usePySideExtensions; } +bool ShibokenGenerator::useIsNullAsNbNonZero() const +{ + return m_useIsNullAsNbNonZero; +} + QString ShibokenGenerator::cppApiVariableName(const QString& moduleName) const { QString result = moduleName.isEmpty() ? ShibokenGenerator::packageName() : moduleName; |