diff options
author | Robert Xu <robxu9@gmail.com> | 2012-02-26 12:50:04 -0500 |
---|---|---|
committer | Robert Xu <robxu9@gmail.com> | 2012-02-26 12:50:04 -0500 |
commit | 481b46fdd0e36396cbbf2308dfce83df10b979df (patch) | |
tree | 16071d4a4e45db15c7080e2c0f8bedee90bc28a9 /opensuse/core/libdbus-1-tqt0 | |
parent | 5d7b5e6defb05f81691d286d40f67260c4733d00 (diff) | |
download | tde-packaging-481b46fdd0e36396cbbf2308dfce83df10b979df.tar.gz tde-packaging-481b46fdd0e36396cbbf2308dfce83df10b979df.zip |
Push working tdelibs (rpmlint errors don't count)
Diffstat (limited to 'opensuse/core/libdbus-1-tqt0')
-rw-r--r-- | opensuse/core/libdbus-1-tqt0/README.VERSION | 1 | ||||
-rw-r--r-- | opensuse/core/libdbus-1-tqt0/fix_circular_destructor.patch | 14 | ||||
-rw-r--r-- | opensuse/core/libdbus-1-tqt0/fix_ifdef.patch | 18 | ||||
-rw-r--r-- | opensuse/core/libdbus-1-tqt0/libdbus-1-tqt0.changes | 63 | ||||
-rw-r--r-- | opensuse/core/libdbus-1-tqt0/libdbus-1-tqt0.spec | 138 | ||||
-rw-r--r-- | opensuse/core/libdbus-1-tqt0/r785103.patch | 996 | ||||
-rw-r--r-- | opensuse/core/libdbus-1-tqt0/r795238.patch | 60 |
7 files changed, 1290 insertions, 0 deletions
diff --git a/opensuse/core/libdbus-1-tqt0/README.VERSION b/opensuse/core/libdbus-1-tqt0/README.VERSION new file mode 100644 index 000000000..b8b49c0d6 --- /dev/null +++ b/opensuse/core/libdbus-1-tqt0/README.VERSION @@ -0,0 +1 @@ +In the TRINITY tree this is dependencies/dbus-1-tqt. diff --git a/opensuse/core/libdbus-1-tqt0/fix_circular_destructor.patch b/opensuse/core/libdbus-1-tqt0/fix_circular_destructor.patch new file mode 100644 index 000000000..cadd26ca0 --- /dev/null +++ b/opensuse/core/libdbus-1-tqt0/fix_circular_destructor.patch @@ -0,0 +1,14 @@ +Index: tools/dbusxml2qt3/methodgen.cpp +=================================================================== +--- tools/dbusxml2qt3/methodgen.cpp (Revision 805416) ++++ tools/dbusxml2qt3/methodgen.cpp (Arbeitskopie) +@@ -1740,7 +1740,8 @@ + stream << " for (; it != endIt; ++it)" << endl; + stream << " {" << endl; + stream << " QDBusObjectBase* interface = it.data();" << endl; +- stream << " delete interface;" << endl; ++ stream << " if (interface != this)" << endl; ++ stream << " delete interface;" << endl; + stream << " }" << endl; + stream << " interfaces.clear();" << endl; + stream << "}" << endl; diff --git a/opensuse/core/libdbus-1-tqt0/fix_ifdef.patch b/opensuse/core/libdbus-1-tqt0/fix_ifdef.patch new file mode 100644 index 000000000..99da35290 --- /dev/null +++ b/opensuse/core/libdbus-1-tqt0/fix_ifdef.patch @@ -0,0 +1,18 @@ +--- dbus/qdbusobjectpath.h ++++ dbus/qdbusobjectpath.h +@@ -21,6 +21,9 @@ + * + */ + ++#ifndef QDBUSOBJECTPATH_H ++#define QDBUSOBJECTPATH_H ++ + #include <qcstring.h> + + /** +@@ -111,3 +114,5 @@ + */ + static int validate(const QCString& path); + }; ++ ++#endif diff --git a/opensuse/core/libdbus-1-tqt0/libdbus-1-tqt0.changes b/opensuse/core/libdbus-1-tqt0/libdbus-1-tqt0.changes new file mode 100644 index 000000000..bf37e62c7 --- /dev/null +++ b/opensuse/core/libdbus-1-tqt0/libdbus-1-tqt0.changes @@ -0,0 +1,63 @@ +------------------------------------------------------------------- +Thu Feb 2 03:12:24 UTC 2012 - robxu9@gmail.com + +- update to R13.99 + +------------------------------------------------------------------- +Sat Aug 13 15:57:46 UTC 2011 - rxu@lincomlinux.org + +- upgrade to TQt version and adjust accordingly + +------------------------------------------------------------------- +Fri Mar 6 15:38:51 CET 2009 - crrodriguez@suse.de + +- remove static libraries and "la" files + +------------------------------------------------------------------- +Thu May 8 17:15:13 CEST 2008 - hschaa@suse.de + +- Add fix_circular_destructor.patch which fixes a crash in the + generated objects + +------------------------------------------------------------------- +Wed Apr 9 17:45:53 CEST 2008 - hschaa@suse.de + +- Update to SVN revision 795238 which fixes some issues with KNM + +------------------------------------------------------------------- +Thu Mar 13 10:32:01 CET 2008 - hschaa@suse.de + +- Update to 0.8.1 + SVN revision 785103 +- Remove BRANCH_UPDATE.diff +- Add r785103.patch + +------------------------------------------------------------------- +Fri Feb 8 01:03:49 CET 2008 - dmueller@suse.de + +- also allow building on s390/s390x + +------------------------------------------------------------------- +Fri Jan 11 12:14:10 CET 2008 - hschaa@suse.de + +- add ifdefs to qdbusobjectpath.h (fix_ifdef.patch) + +------------------------------------------------------------------- +Wed Jan 9 19:01:49 CET 2008 - dmueller@suse.de + +- fix generation of nm introspection (branch update) + +------------------------------------------------------------------- +Mon Dec 17 16:43:44 CET 2007 - dmueller@suse.de + +- include bugfixes from SVN + +------------------------------------------------------------------- +Wed Dec 12 14:03:53 CET 2007 - hschaa@suse.de + +- Added packages to PDB + +------------------------------------------------------------------- +Fri Nov 30 13:30:33 CET 2007 - hschaa@suse.de + +- Initial checkin + diff --git a/opensuse/core/libdbus-1-tqt0/libdbus-1-tqt0.spec b/opensuse/core/libdbus-1-tqt0/libdbus-1-tqt0.spec new file mode 100644 index 000000000..329003857 --- /dev/null +++ b/opensuse/core/libdbus-1-tqt0/libdbus-1-tqt0.spec @@ -0,0 +1,138 @@ +# +# spec file for package libdbus-1-tqt0 +# +# Copyright (c) 2011 the Trinity Project (opensuse). +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.trinitydesktop.org/ +# + +# norootforbuild + + +Name: libdbus-1-tqt0 +Url: http://www.freedesktop.org/wiki/Software/DBusBindings +%define appname dbus-1-tqt +BuildRequires: dbus-1-devel libtqt4-devel cmake +License: GPL v2 or later +Group: Development/Libraries/C and C++ +AutoReqProv: on +Version: R13.99 +Release: 1 +Summary: TQt DBus Bindings +BuildRoot: %{_tmppath}/%{name}-%{version}-build +Source0: %{appname}-%{version}.tar.bz2 +Provides: libdbus-1-tqt-0 + +%description +This library provides TQt-classes for accessing the DBus + +Authors: +-------- + Kevin Krammer <kevin.krammer@gmx.at> + +%package devel +License: GPL v2 or later +Summary: Development files for libdbus-1-tqt +Group: Development/Libraries/C and C++ +Requires: %{name} = %{version}-%{release} +Requires: dbus-1-devel libtqt4-devel + +%description devel +This library provides TQt-classes for accessing the DBus. + +This package holds the development files for libdbus-1-tqt. + + + +Authors: +-------- + Kevin Krammer <kevin.krammer@gmx.at> + +%package -n dbusxml2qt3 +License: GPL v2 or later +Summary: Generate Qt3-classes from DBus-introspection data +Group: Development/Libraries/C and C++ +Requires: %{name} = %{version}-%{release} + +%description -n dbusxml2qt3 +dbusxml2tqt allows to generate TQt-compatible Qt3 classes from DBus-introspection data + + + +Authors: +-------- + Kevin Krammer <kevin.krammer@gmx.at> + +%prep +%setup -n %{appname}-%{version} -q + +%build +mkdir build +cd build + cmake -DCMAKE_SKIP_RPATH=ON \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \ + -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \ + -DLIB_INSTALL_DIR:PATH=%{_libdir} \ + -DLIBEXEC_INSTALL_DIR:PATH=%{_libexecdir} \ + -DLIB_SUFFIX=`$(echo %_lib | cut -b4-)` \ + -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DPKGCONFIG_INSTALL_DIR=%{_libdir}/pkgconfig \ + -DMAN_INSTALL_DIR=%{_mandir} \ + -DINFO_INSTALL_DIR=%{_infodir} \ + ../ + +%{__make} %{?jobs:-j%jobs} + +%install +cd build +make install DESTDIR=$RPM_BUILD_ROOT +#install -D -m 0755 ./tools/dbusxml2qt3/dbusxml2qt3 $RPM_BUILD_ROOT%{_bindir}/dbusxml2tqt +%{__rm} -f %{buildroot}%{_libdir}/*.la + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%doc README AUTHORS ChangeLog COPYING INSTALL +%{_libdir}/libdbus-1-tqt.so.0 +%{_libdir}/libdbus-1-tqt.so.0.0.0 + +%files devel +%defattr(-,root,root) +%{_libdir}/libdbus-1-tqt.so +%{_includedir}/tqdbusconnection.h +%{_includedir}/tqdbusdata.h +%{_includedir}/tqdbusdataconverter.h +%{_includedir}/tqdbusdatalist.h +%{_includedir}/tqdbusdatamap.h +%{_includedir}/tqdbuserror.h +%{_includedir}/tqdbusmacros.h +%{_includedir}/tqdbusmessage.h +%{_includedir}/tqdbusobject.h +%{_includedir}/tqdbusobjectpath.h +%{_includedir}/tqdbusproxy.h +%{_includedir}/tqdbusvariant.h +%{_libdir}/pkgconfig/dbus-1-tqt.pc + +%files -n dbusxml2qt3 +%defattr(-,root,root) +%{_bindir}/dbusxml2qt3 + +%changelog + diff --git a/opensuse/core/libdbus-1-tqt0/r785103.patch b/opensuse/core/libdbus-1-tqt0/r785103.patch new file mode 100644 index 000000000..d07b87180 --- /dev/null +++ b/opensuse/core/libdbus-1-tqt0/r785103.patch @@ -0,0 +1,996 @@ +diff -ur libdbus-1-qt3-0.8.1/qdbusintegrator.cpp ../dbus-qt4-qt3backport/qdbusintegrator.cpp +--- libdbus-1-qt3-0.8.1/qdbusintegrator.cpp 2007-12-17 12:34:08.000000000 +0100 ++++ ../dbus-qt4-qt3backport/qdbusintegrator.cpp 2008-03-13 10:28:54.000000000 +0100 +@@ -121,7 +121,7 @@ + QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data); + + int flags = dbus_watch_get_flags(watch); +- int fd = dbus_watch_get_fd(watch); ++ int fd = dbus_watch_get_unix_fd(watch); + + QDBusConnectionPrivate::Watcher watcher; + if (flags & DBUS_WATCH_READABLE) { +@@ -163,7 +163,7 @@ + //qDebug("remove watch"); + + QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data); +- int fd = dbus_watch_get_fd(watch); ++ int fd = dbus_watch_get_unix_fd(watch); + + QDBusConnectionPrivate::WatcherHash::iterator it = d->watchers.find(fd); + if (it != d->watchers.end()) +@@ -205,7 +205,7 @@ + //qDebug("toggle watch"); + + QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data); +- int fd = dbus_watch_get_fd(watch); ++ int fd = dbus_watch_get_unix_fd(watch); + + QDBusConnectionPrivate::WatcherHash::iterator it = d->watchers.find(fd); + if (it != d->watchers.end()) { +@@ -218,7 +218,7 @@ + int flags = dbus_watch_get_flags(watch); + + // qDebug("toggle watch %d to %d (write: %d, read: %d)", +-// dbus_watch_get_fd(watch), enabled, ++// dbus_watch_get_unix_fd(watch), enabled, + // flags & DBUS_WATCH_WRITABLE, flags & DBUS_WATCH_READABLE); + + if (flags & DBUS_WATCH_READABLE && (*wit).read) +diff -ur libdbus-1-qt3-0.8.1/tools/dbusxml2qt3/classgen.cpp ../dbus-qt4-qt3backport/tools/dbusxml2qt3/classgen.cpp +--- libdbus-1-qt3-0.8.1/tools/dbusxml2qt3/classgen.cpp 2007-12-17 12:34:08.000000000 +0100 ++++ ../dbus-qt4-qt3backport/tools/dbusxml2qt3/classgen.cpp 2008-03-13 10:28:54.000000000 +0100 +@@ -38,6 +38,11 @@ + insert(key, true); + } + ++ void removeString(const QString& key) ++ { ++ erase(key); ++ } ++ + void insertStringList(const QStringList& list) + { + QStringList::const_iterator it = list.begin(); +@@ -194,6 +199,14 @@ + forwards.insertString("class QDomElement"); + if (!classData.signals.isEmpty()) + forwards.insertString("class QString"); ++ if (!classData.asyncMethods.isEmpty()) ++ { ++ includes["Qt"].insertString("<qmap.h>"); ++ forwards.erase("template <typename K, typename V> class QMap"); ++ ++ includes["qdbus"].insertString("<dbus/qdbusmessage.h>"); ++ forwards.erase("class QDBusMessage"); ++ } + break; + + case Class::Proxy: +@@ -205,6 +218,11 @@ + forwards.insertString("class QString"); + if (!classData.properties.isEmpty()) + forwards.insertString("class QDBusVariant"); ++ if (!classData.asyncMethods.isEmpty()) ++ { ++ includes["Qt"].insertString("<qmap.h>"); ++ forwards.erase("template <typename K, typename V> class QMap"); ++ } + break; + + case Class::Node: +@@ -345,7 +363,7 @@ + stream << "#include \"" << (*it).name.lower() << ".h\"" << endl; + } + +- stream << "#include \"introspectable.h\"" << endl; ++ stream << "#include \"introspectableinterface.h\"" << endl; + + stream << endl; + } +@@ -442,7 +460,30 @@ + static void writeMethodDeclarations(const Class& classData, Class::Role role, + QTextStream& stream) + { +- if (!classData.methods.isEmpty()) ++ if (role == Class::Interface && !classData.asyncReplyMethods.isEmpty()) ++ { ++ stream << "public:" << endl; ++ ++ QValueList<Method>::const_iterator it = ++ classData.asyncReplyMethods.begin(); ++ QValueList<Method>::const_iterator endIt = ++ classData.asyncReplyMethods.end(); ++ for (; it != endIt; ++it) ++ { ++ Method method = *it; ++ method.name += "AsyncReply"; ++ ++ stream << " virtual void "; ++ MethodGenerator::writeMethodDeclaration(method, false, false, stream); ++ ++ stream << " virtual void " << (*it).name ++ << "AsyncError(int asyncCallId, const QDBusError& error);" ++ << endl; ++ stream << endl; ++ } ++ } ++ ++ if (!classData.methods.isEmpty() || !classData.asyncMethods.isEmpty()) + { + bool pureVirtual = true; + switch (role) +@@ -465,9 +506,35 @@ + QValueList<Method>::const_iterator endIt = classData.methods.end(); + for (; it != endIt; ++it) + { ++ if ((*it).async) continue; ++ + stream << " virtual bool "; + MethodGenerator::writeMethodDeclaration(*it, pureVirtual, true, stream); + } ++ ++ it = classData.asyncMethods.begin(); ++ endIt = classData.asyncMethods.end(); ++ for (; it != endIt; ++it) ++ { ++ Method method = *it; ++ method.name += "Async"; ++ ++ switch (role) ++ { ++ case Class::Interface: ++ stream << " virtual void "; ++ MethodGenerator::writeMethodDeclaration(method, pureVirtual, false, stream); ++ break; ++ ++ case Class::Proxy: ++ stream << " virtual bool "; ++ MethodGenerator::writeMethodDeclaration(method, pureVirtual, true, stream); ++ break; ++ ++ case Class::Node: // no async methods ++ break; ++ } ++ } + } + + if (!classData.properties.isEmpty()) +@@ -511,7 +578,7 @@ + switch (role) + { + case Class::Interface: +- if (!classData.methods.isEmpty()) ++ if (!classData.methods.isEmpty() || !classData.asyncMethods.isEmpty()) + { + stream << "protected: // implement sending replies" << endl; + stream << " virtual void handleMethodReply(const QDBusMessage& reply) = 0;" << endl; +@@ -527,15 +594,35 @@ + break; + + case Class::Proxy: ++ { + if (!classData.signals.isEmpty()) + { + stream << "protected slots: // usually no need to reimplement" << endl; + stream << " virtual void slotHandleDBusSignal(const QDBusMessage& message);" << endl; + stream << endl; + } ++ ++ if (!classData.asyncReplySignals.isEmpty()) ++ { ++ if (classData.signals.isEmpty()) ++ { ++ stream << "protected slots: // usually no need to reimplement" << endl; ++ } ++ stream << " virtual void slotHandleAsyncReply(int id, const QDBusMessage& message);" << endl; ++ stream << endl; ++ } ++ + stream << "protected:" << endl; + stream << " QDBusProxy* m_baseProxy;" << endl; ++ ++ if (!classData.asyncMethods.isEmpty()) ++ { ++ stream << endl; ++ stream << " QMap<int, QString> m_asyncCalls;" << endl; ++ } ++ + break; ++ } + + case Class::Node: // not variable methods + break; +@@ -547,7 +634,8 @@ + static void writeSignalDeclarations(const Class& classData, Class::Role role, + QTextStream& stream) + { +- if (classData.signals.isEmpty()) return; ++ if (classData.signals.isEmpty() && classData.asyncReplySignals.isEmpty()) ++ return; + + QString prefix; + switch (role) +@@ -578,6 +666,18 @@ + MethodGenerator::writeMethodDeclaration(*it, false, false, stream); + } + ++ it = classData.asyncReplySignals.begin(); ++ endIt = classData.asyncReplySignals.end(); ++ for (; it != endIt; ++it) ++ { ++ stream << prefix; ++ ++ Method signal = *it; ++ signal.name += "AsyncReply"; ++ ++ MethodGenerator::writeMethodDeclaration(signal, false, false, stream); ++ } ++ + stream << endl; + } + +@@ -598,8 +698,6 @@ + static void writeMethodCallDeclarations(const Class& classData, + QTextStream& stream) + { +- if (classData.methods.isEmpty()) return; +- + QValueList<Method>::const_iterator it = classData.methods.begin(); + QValueList<Method>::const_iterator endIt = classData.methods.end(); + for (; it != endIt; ++it) +@@ -607,6 +705,26 @@ + stream << " "; + MethodGenerator::writeMethodCallDeclaration(*it, stream); + } ++ ++ if (!classData.asyncReplyMethods.isEmpty()) ++ { ++ stream << "protected:" << endl; ++ stream << " QMap<int, QDBusMessage> m_asyncCalls;" << endl; ++ stream << endl; ++ } ++} ++ ++static void writeInterfaceAsyncReplyHandlers(const Class& classData, ++ QTextStream& stream) ++{ ++ if (classData.asyncReplyMethods.isEmpty()) return; ++ ++ QValueList<Method>::const_iterator it = classData.asyncReplyMethods.begin(); ++ QValueList<Method>::const_iterator endIt = classData.asyncReplyMethods.end(); ++ for (; it != endIt; ++it) ++ { ++ MethodGenerator::writeInterfaceAsyncReplyHandler(classData, *it, stream); ++ } + } + + static void writeMethodCalls(const Class& classData, QTextStream& stream) +@@ -615,6 +733,15 @@ + QValueList<Method>::const_iterator endIt = classData.methods.end(); + for (; it != endIt; ++it) + { ++ if ((*it).async) continue; ++ ++ MethodGenerator::writeMethodCall(classData, *it, stream); ++ } ++ ++ it = classData.asyncMethods.begin(); ++ endIt = classData.asyncMethods.end(); ++ for (; it != endIt; ++it) ++ { + MethodGenerator::writeMethodCall(classData, *it, stream); + } + } +@@ -625,6 +752,15 @@ + QValueList<Method>::const_iterator endIt = classData.methods.end(); + for (; it != endIt; ++it) + { ++ if ((*it).async) continue; ++ ++ MethodGenerator::writeProxyMethod(classData.name, *it, stream); ++ } ++ ++ it = classData.asyncMethods.begin(); ++ endIt = classData.asyncMethods.end(); ++ for (; it != endIt; ++it) ++ { + MethodGenerator::writeProxyMethod(classData.name, *it, stream); + } + } +@@ -643,6 +779,121 @@ + } + } + ++static void splitAsyncProxyMethods(Class& classData) ++{ ++ // create the async identifier ++ Argument idArgMethod; ++ idArgMethod.name = "asyncCallId"; ++ idArgMethod.signature = "int"; ++ idArgMethod.isPrimitive = true; ++ idArgMethod.direction = Argument::Out; ++ ++ Argument idArgSignal = idArgMethod; ++ idArgSignal.direction = Argument::In; ++ ++ QValueList<Method>::iterator it = classData.methods.begin(); ++ QValueList<Method>::iterator endIt = classData.methods.end(); ++ for (; it != endIt; ++it) ++ { ++ if (!(*it).async) continue; ++ ++ Method method = *it; ++ ++ QValueList<Argument> methodArgs; ++ QValueList<Argument> signalArgs; ++ ++ // add id argument ++ methodArgs << idArgMethod; ++ signalArgs << idArgSignal; ++ ++ // split in/out arguments: "in" belong to the method, "out" to the new signal ++ QValueList<Argument>::const_iterator argIt = method.arguments.begin(); ++ QValueList<Argument>::const_iterator argEndIt = method.arguments.end(); ++ for (; argIt != argEndIt; ++argIt) ++ { ++ if ((*argIt).direction == Argument::Out) ++ { ++ // signal parameters are "out" but have "in" signature, ++ // e.g. "const T&" ++ Argument arg = *argIt; ++ arg.direction = Argument::In; ++ ++ signalArgs << arg; ++ } ++ else ++ methodArgs << *argIt; ++ } ++ ++ // change method ++ method.arguments = methodArgs; ++ ++ classData.asyncMethods << method; ++ ++ // create "callback" signal ++ Method signal = method; ++ signal.arguments = signalArgs; ++ ++ classData.asyncReplySignals << signal; ++ } ++} ++ ++static void splitAsyncInterfaceMethods(Class& classData) ++{ ++ // create the async identifier ++ Argument idArgMethod; ++ idArgMethod.name = "asyncCallId"; ++ idArgMethod.signature = "int"; ++ idArgMethod.isPrimitive = true; ++ idArgMethod.direction = Argument::In; ++ ++ Argument idArgReply = idArgMethod; ++ ++ QValueList<Method>::iterator it = classData.methods.begin(); ++ QValueList<Method>::iterator endIt = classData.methods.end(); ++ for (; it != endIt; ++it) ++ { ++ if (!(*it).async) continue; ++ ++ Method method = *it; ++ ++ QValueList<Argument> methodArgs; ++ QValueList<Argument> replyArgs; ++ ++ // add id argument ++ methodArgs << idArgMethod; ++ replyArgs << idArgReply; ++ ++ // split in/out arguments: "in" belong to the call, "out" to the reply ++ QValueList<Argument>::const_iterator argIt = method.arguments.begin(); ++ QValueList<Argument>::const_iterator argEndIt = method.arguments.end(); ++ for (; argIt != argEndIt; ++argIt) ++ { ++ if ((*argIt).direction == Argument::Out) ++ { ++ // reply parameters are "out" for the service but "in" for ++ // the reply handler ++ Argument arg = *argIt; ++ arg.direction = Argument::In; ++ ++ replyArgs << arg; ++ } ++ else ++ methodArgs << *argIt; ++ } ++ ++ // change method ++ method.arguments = methodArgs; ++ ++ classData.asyncMethods << method; ++ ++ // create reply handler ++ Method reply = method; ++ reply.arguments = replyArgs; ++ ++ classData.asyncReplyMethods << reply; ++ } ++} ++ + bool ClassGenerator::initStreams(const QString& baseName, + QTextStream& headerStream, + QTextStream& sourceStream) +@@ -680,7 +931,6 @@ + { + closeIncludeGuard(baseName, headerStream); + writeFileFooter(headerStream); +- + writeFileFooter(sourceStream); + + QIODevice* device = headerStream.device(); +@@ -717,33 +967,36 @@ + QTextStream& headerStream, + QTextStream& sourceStream) + { ++ Class classDataCopy = classData; ++ splitAsyncInterfaceMethods(classDataCopy); ++ + // create header +- writeHeaderIncludes(classData, Class::Interface, headerStream); ++ writeHeaderIncludes(classDataCopy, Class::Interface, headerStream); + +- openNamespaces(classData.namespaces, headerStream); +- openClassDeclaration(classData, Class::Interface, headerStream); ++ openNamespaces(classDataCopy.namespaces, headerStream); ++ openClassDeclaration(classDataCopy, Class::Interface, headerStream); + +- writeSignalDeclarations(classData, Class::Interface, headerStream); +- writeMethodDeclarations(classData, Class::Interface, headerStream); +- writeMethodCallDeclarations(classData, headerStream); ++ writeSignalDeclarations(classDataCopy, Class::Interface, headerStream); ++ writeMethodDeclarations(classDataCopy, Class::Interface, headerStream); ++ writeMethodCallDeclarations(classDataCopy, headerStream); + +- closeClassDeclaration(classData, Class::Interface, headerStream); +- closeNamespaces(classData.namespaces, headerStream); ++ closeClassDeclaration(classDataCopy, Class::Interface, headerStream); ++ closeNamespaces(classDataCopy.namespaces, headerStream); + + // create source +- writeSourceIncludes(classData, Class::Interface, sourceStream); +- +- openNamespaces(classData.namespaces, sourceStream); ++ writeSourceIncludes(classDataCopy, Class::Interface, sourceStream); + +- MethodGenerator::writeIntrospectionDataMethod(classData, sourceStream); ++ openNamespaces(classDataCopy.namespaces, sourceStream); + +- writeSignalEmitters(classData, sourceStream); ++ MethodGenerator::writeIntrospectionDataMethod(classDataCopy, sourceStream); + +- writeMethodCalls(classData, sourceStream); ++ writeSignalEmitters(classDataCopy, sourceStream); ++ writeInterfaceAsyncReplyHandlers(classDataCopy, sourceStream); ++ writeMethodCalls(classDataCopy, sourceStream); + +- MethodGenerator::writeInterfaceMainMethod(classData, sourceStream); ++ MethodGenerator::writeInterfaceMainMethod(classDataCopy, sourceStream); + +- closeNamespaces(classData.namespaces, sourceStream); ++ closeNamespaces(classDataCopy.namespaces, sourceStream); + + return true; + } +@@ -752,33 +1005,39 @@ + QTextStream& headerStream, + QTextStream& sourceStream) + { ++ Class classDataCopy = classData; ++ splitAsyncProxyMethods(classDataCopy); ++ + // create header +- writeHeaderIncludes(classData, Class::Proxy, headerStream); ++ writeHeaderIncludes(classDataCopy, Class::Proxy, headerStream); + +- openNamespaces(classData.namespaces, headerStream); +- openClassDeclaration(classData, Class::Proxy, headerStream); ++ openNamespaces(classDataCopy.namespaces, headerStream); ++ openClassDeclaration(classDataCopy, Class::Proxy, headerStream); + +- writeSignalDeclarations(classData, Class::Proxy, headerStream); +- writeMethodDeclarations(classData, Class::Proxy, headerStream); ++ writeSignalDeclarations(classDataCopy, Class::Proxy, headerStream); ++ writeMethodDeclarations(classDataCopy, Class::Proxy, headerStream); + +- closeClassDeclaration(classData, Class::Proxy, headerStream); +- closeNamespaces(classData.namespaces, headerStream); ++ closeClassDeclaration(classDataCopy, Class::Proxy, headerStream); ++ closeNamespaces(classDataCopy.namespaces, headerStream); + + // create source +- writeSourceIncludes(classData, Class::Proxy, sourceStream); ++ writeSourceIncludes(classDataCopy, Class::Proxy, sourceStream); + +- openNamespaces(classData.namespaces, sourceStream); ++ openNamespaces(classDataCopy.namespaces, sourceStream); + +- MethodGenerator::writeProxyBegin(classData, sourceStream); ++ MethodGenerator::writeProxyBegin(classDataCopy, sourceStream); + +- writeProxyMethods(classData, sourceStream); ++ writeProxyMethods(classDataCopy, sourceStream); + +- writeProxyProperties(classData, sourceStream); ++ writeProxyProperties(classDataCopy, sourceStream); + +- if (!classData.signals.isEmpty()) +- MethodGenerator::writeSignalHandler(classData, sourceStream); ++ if (!classDataCopy.signals.isEmpty()) ++ MethodGenerator::writeSignalHandler(classDataCopy, sourceStream); + +- closeNamespaces(classData.namespaces, sourceStream); ++ if (!classDataCopy.asyncReplySignals.isEmpty()) ++ MethodGenerator::writeProxyAsyncReplyHandler(classDataCopy, sourceStream); ++ ++ closeNamespaces(classDataCopy.namespaces, sourceStream); + + return true; + } +@@ -796,7 +1055,6 @@ + + closeClassDeclaration(classData, Class::Node, headerStream); + closeNamespaces(classData.namespaces, headerStream); +- closeIncludeGuard(classData.name, headerStream); + + // create source + writeSourceIncludes(classData, Class::Node, sourceStream); +diff -ur libdbus-1-qt3-0.8.1/tools/dbusxml2qt3/main.cpp ../dbus-qt4-qt3backport/tools/dbusxml2qt3/main.cpp +--- libdbus-1-qt3-0.8.1/tools/dbusxml2qt3/main.cpp 2007-12-17 12:34:08.000000000 +0100 ++++ ../dbus-qt4-qt3backport/tools/dbusxml2qt3/main.cpp 2008-03-13 10:28:54.000000000 +0100 +@@ -153,12 +153,16 @@ + exit(3); + } + +- QStringList nameParts = QStringList::split("::", options["classname"]); ++ // class name for node is handled differently later on ++ if (!generateNode) ++ { ++ QStringList nameParts = QStringList::split("::", options["classname"]); + +- interfaces[0].name = nameParts.back(); ++ interfaces[0].name = nameParts.back(); + +- nameParts.pop_back(); +- interfaces[0].namespaces = nameParts; ++ nameParts.pop_back(); ++ interfaces[0].namespaces = nameParts; ++ } + } + + if (checkForOption(options, "namespace")) +@@ -284,6 +288,7 @@ + Method method; + method.name = "Introspect"; + method.noReply = false; ++ method.async = false; + + Argument argument; + argument.name = "data"; +diff -ur libdbus-1-qt3-0.8.1/tools/dbusxml2qt3/methodgen.cpp ../dbus-qt4-qt3backport/tools/dbusxml2qt3/methodgen.cpp +--- libdbus-1-qt3-0.8.1/tools/dbusxml2qt3/methodgen.cpp 2007-12-17 12:34:08.000000000 +0100 ++++ ../dbus-qt4-qt3backport/tools/dbusxml2qt3/methodgen.cpp 2008-03-13 10:28:54.000000000 +0100 +@@ -279,6 +279,24 @@ + return annotations; + } + ++static bool hasAnnotation(const QDomElement& element, const QString& annotation, QString* value = 0) ++{ ++ for (QDomNode node = element.firstChild(); !node.isNull(); ++ node = node.nextSibling()) ++ { ++ if (!node.isElement()) continue; ++ ++ QDomElement childElement = node.toElement(); ++ if (childElement.tagName() != "annotation") continue; ++ if (childElement.attribute("name") != annotation) continue; ++ ++ if (value != 0) *value = childElement.attribute("value"); ++ return true; ++ } ++ ++ return false; ++} ++ + static QValueList<Argument> extractArguments(const QDomElement& methodElement, + Class& classData) + { +@@ -568,9 +586,13 @@ + method.name = element.attribute("name"); + method.arguments = extractArguments(element, classData); + method.noReply = false; ++ method.async = false; + + if (element.tagName() == "method") ++ { ++ method.async = hasAnnotation(element, "org.freedesktop.DBus.GLib.Async"); + classData.methods.append(method); ++ } + else + classData.signals.append(method); + } +@@ -689,36 +711,85 @@ + void MethodGenerator::writeMethodCallDeclaration(const Method& method, + QTextStream& stream) + { +- stream << "QDBusMessage call" << method.name +- << "(const QDBusMessage& mesage);" << endl; ++ if (method.async) ++ stream << "void call" << method.name << "Async"; ++ else ++ stream << "QDBusMessage call" << method.name; ++ ++ stream << "(const QDBusMessage& message);" << endl; + stream << endl; + } + + void MethodGenerator::writeMethodCall(const Class& classData, + const Method& method, QTextStream& stream) + { +- stream << "QDBusMessage " << classData.name << "::call" << method.name +- << "(const QDBusMessage& message)" << endl;; ++ if (method.async) ++ stream << "void " << classData.name << "::call" << method.name << "Async"; ++ else ++ stream << "QDBusMessage " << classData.name << "::call" << method.name; ++ ++ stream << "(const QDBusMessage& message)" << endl; + + stream << "{" << endl; +- stream << " QDBusError error;" << endl; +- stream << " QDBusMessage reply;" << endl; +- stream << endl; + +- writeVariables(" ", method, stream); ++ if (method.async) ++ { ++ // FIXME: using writeVariables by removing asyncCallId argument ++ Method reducedMethod = method; ++ reducedMethod.arguments.pop_front(); ++ ++ writeVariables(" ", reducedMethod, stream); ++ } ++ else ++ { ++ stream << " QDBusError error;" << endl; ++ stream << " QDBusMessage reply;" << endl; ++ stream << endl; ++ ++ writeVariables(" ", method, stream); ++ } + + stream << endl; +- stream << " if (" << method.name << "("; ++ ++ if (method.async) ++ { ++ stream << " int _asyncCallId = 0;" << endl; ++ stream << " while (m_asyncCalls.find(_asyncCallId) != m_asyncCalls.end())" ++ << endl; ++ stream << " {" << endl; ++ stream << " ++_asyncCallId;" << endl; ++ stream << " }" << endl; ++ stream << " m_asyncCalls.insert(_asyncCallId, message);" << endl; ++ stream << endl; ++ ++ stream << " " << method.name << "Async("; ++ } ++ else ++ stream << " if (" << method.name << "("; + + QValueList<Argument>::const_iterator it = method.arguments.begin(); + QValueList<Argument>::const_iterator endIt = method.arguments.end(); +- for (; it != endIt; ++it) ++ while (it != endIt) + { +- stream << "_" << (*it).name << ", "; ++ stream << "_" << (*it).name; ++ ++ ++it; ++ if (it != endIt) stream << ", "; + } + +- stream << "error))" << endl; ++ if (method.async) ++ { ++ stream << ");" << endl; ++ stream << endl; ++ ++ stream << " return;" << endl; ++ stream << "}" << endl; ++ stream << endl; ++ return; ++ } + ++ if (method.arguments.count() > 0) stream << ", "; ++ stream << "error))" << endl; + + stream << " {" << endl; + stream << " reply = QDBusMessage::methodReply(message);" << endl; +@@ -878,6 +949,102 @@ + stream << endl; + } + ++ ++void MethodGenerator::writeInterfaceAsyncReplyHandler(const Class& classData, ++ const Method& method, QTextStream& stream) ++{ ++ stream << "void " << classData.name << "::" << method.name ++ << "AsyncReply("; ++ ++ QValueList<Argument>::const_iterator it = method.arguments.begin(); ++ QValueList<Argument>::const_iterator endIt = method.arguments.end(); ++ while (it != endIt) ++ { ++ if (!(*it).isPrimitive && (*it).direction == Argument::In) ++ stream << "const "; ++ ++ stream << (*it).signature; ++ ++ if (!(*it).isPrimitive || (*it).direction == Argument::Out) stream << "&"; ++ ++ stream << " " << (*it).name; ++ ++ ++it; ++ if (it != endIt) stream << ", "; ++ } ++ stream << ")" << endl; ++ stream << endl; ++ stream << "{" << endl; ++ ++ stream << " QMap<int, QDBusMessage>::iterator findIt = m_asyncCalls.find(asyncCallId);" << endl; ++ stream << " if (findIt == m_asyncCalls.end()) return;" << endl; ++ stream << endl; ++ ++ stream << " QDBusMessage call = findIt.data();" << endl; ++ stream << " m_asyncCalls.erase(findIt);" << endl; ++ stream << endl; ++ ++ stream << " QDBusMessage reply = QDBusMessage::methodReply(call);" ++ << endl; ++ ++ it = method.arguments.begin(); ++ for (++it; it != endIt; ++it) // skip asyncCallId at beginning ++ { ++ if (!(*it).annotatedType.isEmpty()) ++ { ++ stream << " QDBusData " << (*it).name << "Data;" << endl; ++ ++ // TODO error handling ++ stream << " if (QDBusDataConverter::convertToQDBusData<" ++ << (*it).annotatedType << ">(" << (*it).name << ", " ++ << (*it).name << "Data" ++ << ") != QDBusDataConverter::Success) return false;" ++ << endl; ++ stream << " reply << " << (*it).name << "Data;" << endl; ++ } ++ else if (!(*it).accessor.isEmpty()) ++ { ++ stream << " reply << QDBusData::from" << (*it).accessor << "("; ++ ++ if ((*it).subAccessor.isEmpty()) ++ stream << (*it).name; ++ else ++ stream << (*it).containerClass << "(" << (*it).name << ")"; ++ ++ stream << ");" << endl; ++ } ++ else ++ stream << " reply << " << (*it).name << ";" << endl; ++ } ++ stream << endl; ++ ++ stream << " handleMethodReply(reply);" << endl; ++ ++ stream << "}" << endl; ++ stream << endl; ++ ++ stream << "void " << classData.name << "::" << method.name ++ << "AsyncError(int asyncCallId, const QDBusError& error)"; ++ stream << endl; ++ ++ stream << "{" << endl; ++ ++ stream << " QMap<int, QDBusMessage>::iterator findIt = m_asyncCalls.find(asyncCallId);" << endl; ++ stream << " if (findIt == m_asyncCalls.end()) return;" << endl; ++ stream << endl; ++ ++ stream << " QDBusMessage call = findIt.data();" << endl; ++ stream << " m_asyncCalls.erase(findIt);" << endl; ++ stream << endl; ++ ++ stream << " QDBusMessage reply = QDBusMessage::methodError(call, error);" ++ << endl; ++ stream << " handleMethodReply(reply);" << endl; ++ ++ stream << "}" << endl; ++ stream << endl; ++} ++ + void MethodGenerator::writeInterfaceMainMethod(const Class& classData, + QTextStream& stream) + { +@@ -897,10 +1064,19 @@ + { + stream << " if (message.member() == \"" << (*it).name << "\")" << endl; + stream << " {" << endl; +- stream << " QDBusMessage reply = call" << (*it).name << "(message);" +- << endl; +- stream << " handleMethodReply(reply);" << endl; +- stream << endl; ++ ++ if ((*it).async) ++ { ++ stream << " call" << (*it).name << "Async(message);" << endl; ++ stream << endl; ++ } ++ else ++ { ++ stream << " QDBusMessage reply = call" << (*it).name ++ << "(message);" << endl; ++ stream << " handleMethodReply(reply);" << endl; ++ stream << endl; ++ } + stream << " return true;" << endl; + stream << " }" << endl; + stream << endl; +@@ -967,6 +1143,15 @@ + << endl; + } + ++ if (!classData.asyncReplySignals.isEmpty()) ++ { ++ stream << " QObject::connect(m_baseProxy, " ++ << "SIGNAL(asyncReply(int, const QDBusMessage&))," << endl; ++ stream << " this, " ++ << " SLOT(slotHandleAsyncReply(int, const QDBusMessage&)));" ++ << endl; ++ } ++ + stream << "}" << endl; + + stream << endl; +@@ -988,7 +1173,8 @@ + void MethodGenerator::writeProxyMethod(const QString& className, + const Method& method, QTextStream& stream) + { +- stream << "bool " << className << "::" << method.name << "("; ++ stream << "bool " << className << "::" << method.name ++ << (method.async ? "Async(" : "("); + + QValueList<Argument>::const_iterator it = method.arguments.begin(); + QValueList<Argument>::const_iterator endIt = method.arguments.end(); +@@ -1064,6 +1250,22 @@ + return; + } + ++ if (method.async) ++ { ++ stream << " asyncCallId = m_baseProxy->sendWithAsyncReply(\""; ++ stream << method.name << "\", parameters);" << endl; ++ stream << endl; ++ ++ stream << " if (asyncCallId != 0) m_asyncCalls[asyncCallId] = \"" ++ << method.name << "\";" << endl; ++ stream << endl; ++ ++ stream << " return (asyncCallId != 0);" << endl; ++ stream << "}" << endl; ++ stream << endl; ++ return; ++ } ++ + stream << " QDBusMessage reply = m_baseProxy->sendWithReply(\""; + stream << method.name << "\", parameters, &error);" << endl; + stream << endl; +@@ -1335,6 +1537,58 @@ + } + } + ++void MethodGenerator::writeProxyAsyncReplyHandler(const Class& classData, ++ QTextStream& stream) ++{ ++ stream << "void " << classData.name ++ << "::slotHandleAsyncReply(int asyncCallId, const QDBusMessage& message)" << endl; ++ stream << "{" << endl; ++ ++ stream << " QMap<int, QString>::iterator findIt = " ++ << "m_asyncCalls.find(asyncCallId);" << endl; ++ stream << " if (findIt == m_asyncCalls.end()) return;" << endl; ++ stream << endl; ++ stream << " const QString signalName = findIt.data();" << endl; ++ stream << " m_asyncCalls.erase(findIt);" << endl; ++ stream << endl; ++ ++ QValueList<Method>::const_iterator it = classData.asyncReplySignals.begin(); ++ QValueList<Method>::const_iterator endIt = classData.asyncReplySignals.end(); ++ bool first = true; ++ for (; it != endIt; ++it) ++ { ++ stream << " "; ++ ++ if (!first) ++ stream << "else "; ++ else ++ first = false; ++ ++ stream << "if (signalName == \"" << (*it).name << "\")" << endl; ++ stream << " {" << endl; ++ ++ // FIXME tricking writeVariables and writeSignalEmit into writing ++ // the reply emit code by manipulating arguments and name ++ stream << " int _asyncCallId = asyncCallId;" << endl; ++ ++ Method signal = *it; ++ signal.arguments.pop_front(); ++ ++ writeVariables(" ", signal, stream); ++ stream << endl; ++ ++ signal = *it; ++ signal.name += "AsyncReply"; ++ ++ writeSignalEmit(signal, stream); ++ ++ stream << " }" << endl; ++ } ++ ++ stream << "}" << endl; ++ stream << endl; ++} ++ + void MethodGenerator::writeIntrospectionDataMethod(const Class& classData, + QTextStream& stream) + { +diff -ur libdbus-1-qt3-0.8.1/tools/dbusxml2qt3/methodgen.h ../dbus-qt4-qt3backport/tools/dbusxml2qt3/methodgen.h +--- libdbus-1-qt3-0.8.1/tools/dbusxml2qt3/methodgen.h 2007-12-17 12:34:08.000000000 +0100 ++++ ../dbus-qt4-qt3backport/tools/dbusxml2qt3/methodgen.h 2008-03-13 10:28:55.000000000 +0100 +@@ -61,6 +61,7 @@ + QString name; + QValueList<Argument> arguments; + bool noReply; ++ bool async; + }; + + class Property : public Argument +@@ -86,6 +87,10 @@ + QValueList<Method> methods; + QValueList<Method> signals; + QValueList<Property> properties; ++ ++ QValueList<Method> asyncMethods; ++ QValueList<Method> asyncReplySignals; ++ QValueList<Method> asyncReplyMethods; + }; + + class MethodGenerator +@@ -109,6 +114,10 @@ + static void writeSignalEmitter(const Class& classData, const Method& method, + QTextStream& stream); + ++ static void writeInterfaceAsyncReplyHandler(const Class& classData, ++ const Method& method, ++ QTextStream& stream); ++ + static void writeInterfaceMainMethod(const Class& classData, + QTextStream& stream); + +@@ -125,6 +134,9 @@ + static void writeProxyProperty(const Class& classData, const Property& property, + QTextStream& stream); + ++ static void writeProxyAsyncReplyHandler(const Class& classData, ++ QTextStream& stream); ++ + static void writeIntrospectionDataMethod(const Class& classData, + QTextStream& stream); + diff --git a/opensuse/core/libdbus-1-tqt0/r795238.patch b/opensuse/core/libdbus-1-tqt0/r795238.patch new file mode 100644 index 000000000..3213c823d --- /dev/null +++ b/opensuse/core/libdbus-1-tqt0/r795238.patch @@ -0,0 +1,60 @@ +Index: dbus/qdbusdatamap.h +=================================================================== +--- dbus/qdbusdatamap.h (Revision 785103) ++++ dbus/qdbusdatamap.h (Revision 795238) +@@ -173,7 +173,7 @@ + } + else if (hasContainerValueType()) + { +- if (it.data()->buildSignature() != containerSignature) ++ if (it.data().buildDBusSignature() != containerSignature) + { + m_valueType = QDBusData::Invalid; + m_containerValueType = QDBusData(); +Index: dbus/qdbuserror.h +=================================================================== +--- dbus/qdbuserror.h (Revision 785103) ++++ dbus/qdbuserror.h (Revision 795238) +@@ -119,7 +119,7 @@ + * Returned by QDBusConnection's addConnection if the specified address + * isn't a valid D-Bus bus address. + * +- * @see QDBusConnection:::addConnection(const QString&,const QString&); ++ * @see QDBusConnection::addConnection(const QString&,const QString&); + */ + BadAddress, + +Index: tools/dbusxml2qt3/classgen.cpp +=================================================================== +--- tools/dbusxml2qt3/classgen.cpp (Revision 785103) ++++ tools/dbusxml2qt3/classgen.cpp (Revision 795238) +@@ -168,6 +168,17 @@ + extractForwardDeclarations(*it, forwards); + } + ++ it = classData.signals.begin(); ++ endIt = classData.signals.end(); ++ for (; it != endIt; ++it) ++ { ++ if ((*it).arguments.isEmpty()) continue; ++ ++ extractHeaderIncludes(*it, includes); ++ extractForwardDeclarations(*it, forwards); ++ } ++ ++ + QValueList<Property>::const_iterator propertyIt = classData.properties.begin(); + QValueList<Property>::const_iterator propertyEndIt = classData.properties.end(); + for (; propertyIt != propertyEndIt; ++propertyIt) +Index: dbus-1-qt3.pc.in +=================================================================== +--- dbus-1-qt3.pc.in (Revision 785103) ++++ dbus-1-qt3.pc.in (Revision 795238) +@@ -1,6 +1,6 @@ + prefix=@prefix@ + exec_prefix=@exec_prefix@ +-libdir=${prefix}/lib ++libdir=@libdir@ + includedir=${prefix}/include/dbus-1.0/qt3 + + Name: dbus-1-qt3 |