[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: [QKW PATCH] dcopidl2cpp
From: Jarosław Staniek <js () iidea ! pl>
Date: 2003-04-28 16:42:47
[Download RAW message or body]
- 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
["dcopidl2cpp-2003-04-28.diff" (text/x-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;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic