changeset 304:04b52676b45f signals

fixed compiling all packages
author eldar_ins@eldar-laptop
date Sun, 13 Dec 2009 06:24:55 +0500
parents 98b211f3ee34
children 3b79bd4298e8 91ed8edd442e
files generator/abstractmetalang.h generator/cppimplgenerator.cpp generator/dgenerator.cpp generator/typesystem.cpp generator/typesystem.h generator/typesystem_network.xml generator/typesystem_xml.xml
diffstat 7 files changed, 21 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/generator/abstractmetalang.h	Sat Dec 12 16:01:55 2009 +0500
+++ b/generator/abstractmetalang.h	Sun Dec 13 06:24:55 2009 +0500
@@ -846,6 +846,7 @@
     bool isTypeAlias() const { return m_is_type_alias; }
 
     const QStringList &depends() { return m_type_entry->depends(); }
+    AbstractMetaFunctionList allFunctions() const { return m_functions; }
 
     bool needsConversionFunc;
 private:
--- a/generator/cppimplgenerator.cpp	Sat Dec 12 16:01:55 2009 +0500
+++ b/generator/cppimplgenerator.cpp	Sun Dec 13 06:24:55 2009 +0500
@@ -721,6 +721,7 @@
 
     if (java_class->typeEntry()->isValue())
     {
+        if (!java_class->typeEntry()->hasPrivateCopyConstructor())  // can do a copy if we have a public ctor or don't have any
         {
             QString argName = "orig";
             s << endl << endl
--- a/generator/dgenerator.cpp	Sat Dec 12 16:01:55 2009 +0500
+++ b/generator/dgenerator.cpp	Sun Dec 13 06:24:55 2009 +0500
@@ -2287,6 +2287,8 @@
     // construction of a native copy of a Value
     if (d_class->typeEntry()->isValue())
     {
+        AbstractMetaFunction *copy_ctor = d_class->copyConstructor();
+        if (!d_class->typeEntry()->hasPrivateCopyConstructor()) // can do a copy if we have a public ctor or don't have any
             s << INDENT << "static void* __constructNativeCopy(const void* orig) {" << endl
               << INDENT << "    return qtd_" << d_class->name() << "_native_copy(orig);" << endl
               << INDENT << "}" << endl << endl
@@ -2470,6 +2472,8 @@
 
     if (d_class->typeEntry()->isValue())
     {
+        AbstractMetaFunction *copy_ctor = d_class->copyConstructor();
+        if (!d_class->typeEntry()->hasPrivateCopyConstructor())  // can do a copy if we have a public ctor or don't have any
         {
             s << "private extern(C) void qtd_" << d_class->name() << "_placed_copy(const void* orig, void* place);" << endl
               << "private extern(C) void* qtd_" << d_class->name() << "_native_copy(const void* orig);" << endl;
--- a/generator/typesystem.cpp	Sat Dec 12 16:01:55 2009 +0500
+++ b/generator/typesystem.cpp	Sun Dec 13 06:24:55 2009 +0500
@@ -96,6 +96,7 @@
         // qtd stuff
         AddClass                    = 0x1100,
         PackageDepend               = 0x1200,
+        PrivateCopyConstructor      = 0x1300,
 
         // Code snip tags (0x1000, 0x2000, ... , 0xf000)
         InjectCode =           0x1000,
@@ -163,6 +164,7 @@
         tagNames["rename"] = StackElement::Rename;
         tagNames["typesystem"] = StackElement::Root;
         tagNames["custom-constructor"] = StackElement::CustomMetaConstructor;
+        tagNames["private-copy-constructor"] = StackElement::PrivateCopyConstructor;
         tagNames["custom-destructor"] = StackElement::CustomMetaDestructor;
         tagNames["argument-map"] = StackElement::ArgumentMap;
         tagNames["suppress-warning"] = StackElement::SuppressedWarning;
@@ -299,6 +301,11 @@
             delete current->value.customFunction;
         }
         break;
+    case StackElement::PrivateCopyConstructor:
+        {
+            current->entry->setHasPrivateCopyConstructor(true);
+        }
+        break;
     case StackElement::CustomMetaDestructor:
         {
             current->entry->setCustomDestructor(*current->value.customFunction);
--- a/generator/typesystem.h	Sat Dec 12 16:01:55 2009 +0500
+++ b/generator/typesystem.h	Sun Dec 13 06:24:55 2009 +0500
@@ -436,9 +436,10 @@
         : m_name(name),
           m_type(t),
           m_code_generation(GenerateAll),
-          m_preferred_conversion(true)
+          m_preferred_conversion(true),
+          m_has_copy_constructor(false)
     {
-    };
+    }
 
     virtual ~TypeEntry() { }
 
@@ -508,6 +509,8 @@
 
     // qtd
     virtual bool isStructInD() const { return false; }
+    bool hasPrivateCopyConstructor() const { return m_has_copy_constructor; }
+    void setHasPrivateCopyConstructor(bool has_copy_constructor) { m_has_copy_constructor = has_copy_constructor; }
 
 private:
     QString m_name;
@@ -516,6 +519,7 @@
     CustomFunction m_customConstructor;
     CustomFunction m_customDestructor;
     bool m_preferred_conversion;
+    bool m_has_copy_constructor;
 };
 typedef QHash<QString, QList<TypeEntry *> > TypeEntryHash;
 typedef QHash<QString, TypeEntry *> SingleTypeEntryHash;
--- a/generator/typesystem_network.xml	Sat Dec 12 16:01:55 2009 +0500
+++ b/generator/typesystem_network.xml	Sun Dec 13 06:24:55 2009 +0500
@@ -102,7 +102,7 @@
         <modify-function signature="abort()" access="non-final"/>
         <modify-function signature="disconnectFromHostImplementation()" access="non-final"/>
         <modify-function signature="flush()" access="non-final"/>
-        <modify-function signature="setReadBufferSize(long long)" access="non-final"/>
+        <modify-function signature="setReadBufferSize(qint64)" access="non-final"/>
         <modify-function signature="setSocketDescriptor(int,QAbstractSocket::SocketState,QFlags&lt;QIODevice::OpenModeFlag&gt;)" access="non-final"/>
         <modify-function signature="waitForConnected(int)" access="non-final"/>
         <modify-function signature="waitForDisconnected(int)" access="non-final"/>
--- a/generator/typesystem_xml.xml	Sat Dec 12 16:01:55 2009 +0500
+++ b/generator/typesystem_xml.xml	Sun Dec 13 06:24:55 2009 +0500
@@ -346,6 +346,7 @@
     </value-type>
 
     <value-type name="QXmlNamespaceSupport">
+    <private-copy-constructor/>
 <!--        <custom-constructor>
             QXmlNamespaceSupport *clone = new QXmlNamespaceSupport;
             clone-&gt;setPrefix("", copy-&gt;uri(""));
@@ -360,7 +361,6 @@
             delete (QXmlNamespaceSupport *)copy;
         </custom-destructor>
 
-
     
         <inject-code>
             <import-file name="typesystem_xml-java.java" quote-after-line="class QXmlNamespaceSupport___" quote-before-line="}// class"/>