summaryrefslogtreecommitdiffstats
path: root/generator/headergenerator.cpp
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-10-27 19:45:19 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-10-28 15:12:05 -0200
commit45f10c2264bef5c25e493bb6f70ef6355a7f94d1 (patch)
tree799a43630c1ce008d1bc28ec9084f55cb3eed5a8 /generator/headergenerator.cpp
parentb146f4117c676a6a65b1e29a09d5f6c86541cd0d (diff)
downloadshiboken-45f10c2264bef5c25e493bb6f70ef6355a7f94d1.tar.gz
shiboken-45f10c2264bef5c25e493bb6f70ef6355a7f94d1.tar.xz
shiboken-45f10c2264bef5c25e493bb6f70ef6355a7f94d1.zip
Write copy constructor for Object types when there is one.
Diffstat (limited to 'generator/headergenerator.cpp')
-rw-r--r--generator/headergenerator.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/generator/headergenerator.cpp b/generator/headergenerator.cpp
index 39db3c6e..12d246a1 100644
--- a/generator/headergenerator.cpp
+++ b/generator/headergenerator.cpp
@@ -91,9 +91,6 @@ void HeaderGenerator::generateClass(QTextStream& s, const AbstractMetaClass* met
s << endl << '{' << endl << "public:" << endl;
- if (metaClass->typeEntry()->isValue())
- writeCopyCtor(s, metaClass);
-
bool hasVirtualFunction = false;
foreach (AbstractMetaFunction *func, filterFunctions(metaClass)) {
if (func->isVirtual())
@@ -142,11 +139,13 @@ void HeaderGenerator::generateClass(QTextStream& s, const AbstractMetaClass* met
void HeaderGenerator::writeFunction(QTextStream& s, const AbstractMetaFunction* func) const
{
+
// do not write copy ctors here.
- if (func->isCopyConstructor())
+ if (!func->isPrivate() && func->isCopyConstructor()) {
+ writeCopyCtor(s, func->ownerClass());
return;
-
- if (func->isConstructor() && func->isUserAdded())
+ }
+ if (func->isUserAdded())
return;
#ifdef AVOID_PROTECTED_HACK