aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/generator/shiboken2/shibokengenerator.cpp')
-rw-r--r--sources/shiboken2/generator/shiboken2/shibokengenerator.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
index 60a7725a6..6bdbb5b76 100644
--- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
@@ -2251,9 +2251,7 @@ AbstractMetaClassList ShibokenGenerator::getAllAncestors(const AbstractMetaClass
QString ShibokenGenerator::getModuleHeaderFileName(const QString& moduleName) const
{
- QString result = moduleName.isEmpty() ? packageName() : moduleName;
- result.replace(QLatin1Char('.'), QLatin1Char('_'));
- return result.toLower() + QLatin1String("_python.h");
+ return moduleCppPrefix(moduleName).toLower() + QLatin1String("_python.h");
}
bool ShibokenGenerator::isCopyable(const AbstractMetaClass *metaClass)
@@ -2544,15 +2542,25 @@ bool ShibokenGenerator::avoidProtectedHack() const
return m_avoidProtectedHack;
}
-QString ShibokenGenerator::cppApiVariableName(const QString& moduleName) const
-{
- QString result = moduleName.isEmpty() ? ShibokenGenerator::packageName() : moduleName;
+QString ShibokenGenerator::moduleCppPrefix(const QString& moduleName) const
+ {
+ QString result = moduleName.isEmpty() ? packageName() : moduleName;
result.replace(QLatin1Char('.'), QLatin1Char('_'));
- result.prepend(QLatin1String("Sbk"));
- result.append(QLatin1String("Types"));
return result;
}
+QString ShibokenGenerator::cppApiVariableName(const QString& moduleName) const
+{
+ return QLatin1String("Sbk") + moduleCppPrefix(moduleName)
+ + QLatin1String("Types");
+}
+
+QString ShibokenGenerator::pythonModuleObjectName(const QString& moduleName) const
+{
+ return QLatin1String("Sbk") + moduleCppPrefix(moduleName)
+ + QLatin1String("ModuleObject");
+}
+
QString ShibokenGenerator::convertersVariableName(const QString& moduleName) const
{
QString result = cppApiVariableName(moduleName);