Hello community, here is the log from the commit of package soprano for openSUSE:Factory checked in at 2013-05-16 18:15:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/soprano (Old) and /work/SRC/openSUSE:Factory/.soprano.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "soprano" Changes: -------- --- /work/SRC/openSUSE:Factory/soprano/soprano-backend-sesame.changes 2013-05-03 07:40:47.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.soprano.new/soprano-backend-sesame.changes 2013-05-16 18:15:17.000000000 +0200 @@ -1,0 +2,7 @@ +Wed May 8 09:39:02 UTC 2013 - [email protected] + +- Revert add-a-stop-method-which-closes-all-servers.patch, as that + commit uses method available only with future KDE 4.11, and breaks + 4.10 + +------------------------------------------------------------------- soprano-backend-virtuoso.changes: same change soprano.changes: same change New: ---- add-a-stop-method-which-closes-all-servers.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ soprano-backend-sesame.spec ++++++ --- /var/tmp/diff_new_pack.P54V3h/_old 2013-05-16 18:15:18.000000000 +0200 +++ /var/tmp/diff_new_pack.P54V3h/_new 2013-05-16 18:15:18.000000000 +0200 @@ -27,6 +27,9 @@ Url: http://soprano.sourceforge.net/ Source0: http://downloads.sourceforge.net/soprano/soprano-%{version}.tar.bz2 Source100: baselibs.conf +# PATCH-FIX-UPSTREAM add-a-stop-method-which-closes-all-servers.patch -- We are reverting this patch, this makes soprano +# incompatible with KDE 4.10.x, for details see http://mail.kde.org/pipermail/nepomuk/2013-May/004335.html +Patch0: add-a-stop-method-which-closes-all-servers.patch BuildRequires: cmake BuildRequires: doxygen BuildRequires: kde4-filesystem @@ -54,6 +57,7 @@ # COMMON2-BEGIN # COMMON2-BEGIN %setup -q -n soprano-%{version} +%patch0 -Rp1 # COMMON2-END # COMMON2-END soprano-backend-virtuoso.spec: same change ++++++ soprano.spec ++++++ --- /var/tmp/diff_new_pack.P54V3h/_old 2013-05-16 18:15:18.000000000 +0200 +++ /var/tmp/diff_new_pack.P54V3h/_new 2013-05-16 18:15:18.000000000 +0200 @@ -26,6 +26,9 @@ Url: http://soprano.sourceforge.net/ Source0: http://downloads.sourceforge.net/soprano/soprano-%{version}.tar.bz2 Source100: baselibs.conf +# PATCH-FIX-UPSTREAM add-a-stop-method-which-closes-all-servers.patch -- We are reverting this patch, this makes soprano +# incompatible with KDE 4.10.x, for details see http://mail.kde.org/pipermail/nepomuk/2013-May/004335.html +Patch0: add-a-stop-method-which-closes-all-servers.patch BuildRequires: cmake BuildRequires: doxygen BuildRequires: kde4-filesystem @@ -53,6 +56,7 @@ %prep # COMMON2-BEGIN %setup -q -n soprano-%{version} +%patch0 -Rp1 # COMMON2-END %package backend-redland ++++++ add-a-stop-method-which-closes-all-servers.patch ++++++ From: Vishesh Handa <[email protected]> Date: Mon, 15 Apr 2013 10:52:52 +0000 Subject: Server: Add a stop method which closes all servers X-Git-Tag: v2.9.1 X-Git-Url: http://quickgit.kde.org/?p=soprano.git&a=commitdiff&h=5acc205e25efe0c1a997d6ef64e80ca502a32ed1 --- Server: Add a stop method which closes all servers Also had to change the internal signal emitted by the ServerConnection. They used to emit finished() which would then result in us removing them from the server list of connections. This would be done using the 'QObject::sender()'. However, since the stop signal deletes the connection the qobject_cast fails and gives 0. This result in the connection not being removed from the list. Also, when stop() is called the next time we try to delete it again. Instead we now connect to the destroyed(QObject*) signal, and avoid using qobject_cast. --- --- a/server/serverconnection.cpp +++ b/server/serverconnection.cpp @@ -146,6 +146,8 @@ // quit() emits the signal finished() when the thread is finished connect( d->socket, SIGNAL( disconnected() ), this, SLOT( quit() ) ); + connect( this, SIGNAL(finished()), + this, SLOT(deleteLater()) ); // start the event loop exec(); --- a/server/servercore.cpp +++ b/server/servercore.cpp @@ -50,7 +50,7 @@ void Soprano::Server::ServerCorePrivate::addConnection( ServerConnection* conn ) { connections.append( conn ); - QObject::connect( conn, SIGNAL(finished()), q, SLOT(serverConnectionFinished())); + QObject::connect( conn, SIGNAL(destroyed(QObject*)), q, SLOT(serverConnectionFinished(QObject*)) ); conn->start(); qDebug() << Q_FUNC_INFO << "New connection. New count:" << connections.count(); } @@ -179,6 +179,24 @@ } } +void Soprano::Server::ServerCore::stop() +{ + qDeleteAll( d->connections ); + qDeleteAll( d->models ); + + delete d->tcpServer; + d->tcpServer = 0; + + delete d->socketServer; + d->socketServer = 0; + +#ifdef BUILD_DBUS_SUPPORT + delete d->dbusController; + d->dbusController = 0; +#endif +} + + quint16 Soprano::Server::ServerCore::serverPort() const { @@ -229,12 +247,12 @@ } -void Soprano::Server::ServerCore::serverConnectionFinished() -{ - qDebug() << Q_FUNC_INFO; - ServerConnection* conn = qobject_cast<ServerConnection*>( sender() ); +void Soprano::Server::ServerCore::serverConnectionFinished(QObject* obj) +{ + qDebug() << Q_FUNC_INFO << d->connections.count(); + // We use static_cast cause qobject_case will fail since the object has been destroyed + ServerConnection* conn = static_cast<ServerConnection*>( obj ); d->connections.removeAll( conn ); - delete conn; qDebug() << Q_FUNC_INFO << "Connection removed. Current count:" << d->connections.count(); } --- a/server/servercore.h +++ b/server/servercore.h @@ -201,6 +201,14 @@ bool listen( quint16 port = DEFAULT_PORT ); /** + * Stops listening on all connections. This includes the local socket + * connection, the tcp connection and dbus, depending on which all are listening. + * + * This does not destroy the internal model + */ + void stop(); + + /** * \return The port this server is listening on or 0 if listen has not * been called successfully. * @@ -224,7 +232,7 @@ void registerAsDBusObject( const QString& objectPath = QString() ); private Q_SLOTS: - void serverConnectionFinished(); + void serverConnectionFinished(QObject* obj); protected: /** -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
