From kde-core-devel Mon Apr 28 16:42:47 2003 From: =?ISO-8859-2?Q?Jaros=B3aw?= Staniek Date: Mon, 28 Apr 2003 16:42:47 +0000 To: kde-core-devel Subject: [QKW PATCH] dcopidl2cpp X-MARC-Message: https://marc.info/?l=kde-core-devel&m=105154816731165 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart8413533.bR8nDea0vA" --nextPart8413533.bR8nDea0vA Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8Bit - LINK_SCOPE tag is parsed and inserted inside _stub class declaration, if found (see previous patch). - Added default return values (false) of boolean types (not QKW related). - One error message about qt1 updated. -- regards / pozdrawiam, Jarosław Staniek --nextPart8413533.bR8nDea0vA Content-Type: text/x-diff; name="dcopidl2cpp-2003-04-28.diff" Content-Transfer-Encoding: 8Bit Content-Disposition: attachment; filename="dcopidl2cpp-2003-04-28.diff" Index: kdelibs/dcop/dcopidl2cpp/main.cpp =================================================================== RCS file: /home/kde/kdelibs/dcop/dcopidl2cpp/main.cpp,v retrieving revision 1.20 diff -u -3 -p -u -r1.20 main.cpp --- kdelibs/dcop/dcopidl2cpp/main.cpp 2 Mar 2002 18:09:52 -0000 1.20 +++ kdelibs/dcop/dcopidl2cpp/main.cpp 28 Apr 2003 15:11:54 -0000 @@ -42,7 +42,7 @@ int main( int argc, char** argv ) { if ( *qVersion() == '1' ) { - fprintf( stderr, "dcopidl2cpp appears to be linked to Qt 1 instead of Qt 2 ! Aborting.\n" ); + fprintf( stderr, "dcopidl2cpp appears to be linked to Qt 1 instead of Qt >= 2 ! Aborting.\n" ); exit(1); } int argpos = 1; Index: kdelibs/dcop/dcopidl2cpp/stub.cpp =================================================================== RCS file: /home/kde/kdelibs/dcop/dcopidl2cpp/stub.cpp,v retrieving revision 1.17 diff -u -3 -p -u -r1.17 stub.cpp --- kdelibs/dcop/dcopidl2cpp/stub.cpp 19 Apr 2003 08:27:00 -0000 1.17 +++ kdelibs/dcop/dcopidl2cpp/stub.cpp 28 Apr 2003 15:11:54 -0000 @@ -90,10 +90,17 @@ void generateStub( const QString& idl, c QDomElement n = e.firstChild().toElement(); Q_ASSERT( n.tagName() == "NAME" ); QString className = n.firstChild().toText().data() + ( "_stub" ); + + //optional: link scope for win32 + QDomElement s = n.nextSibling().toElement(); + QString linkScope; + if ( s.tagName() == "LINK_SCOPE" ) + linkScope = s.firstChild().toText().data(); + if (!linkScope.isEmpty()) + s = s.nextSibling().toElement(); // find dcop parent ( rightmost super class ) QString DCOPParent; - QDomElement s = n.nextSibling().toElement(); for( ; !s.isNull(); s = s.nextSibling().toElement() ) { if ( s.tagName() == "SUPER" ) DCOPParent = s.firstChild().toText().data(); @@ -134,7 +141,10 @@ void generateStub( const QString& idl, c str << endl; // Stub class definition - str << "class " << className; + str << "class "; + if ( !linkScope.isEmpty() ) //optional: link scope for win32 + str << linkScope << " "; + str << className; // Parent : inherited interface stub or dcopstub if ( !DCOPParent.isEmpty() && DCOPParent != "DCOPObject" ) { Index: kdelibs/dcop/dcopidl2cpp/stubimpl.cpp =================================================================== RCS file: /home/kde/kdelibs/dcop/dcopidl2cpp/stubimpl.cpp,v retrieving revision 1.26 diff -u -3 -p -u -r1.26 stubimpl.cpp --- kdelibs/dcop/dcopidl2cpp/stubimpl.cpp 19 Apr 2003 08:27:00 -0000 1.26 +++ kdelibs/dcop/dcopidl2cpp/stubimpl.cpp 28 Apr 2003 15:11:54 -0000 @@ -220,6 +220,8 @@ void generateStubImpl( const QString& id str << " " << result << " result"; if (isIntType( result )) str << " = 0"; + else if (result == "bool") + str << " = false"; str << ";" << endl; } --nextPart8413533.bR8nDea0vA--