[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdepimlibs/akonadi
From: Tobias Koenig <tokoe () kde ! org>
Date: 2010-12-17 15:07:07
Message-ID: 20101217150707.2026DAC8A8 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1207333 by tokoe:
Reselect resource after session reconnect.
Every resource executes a ResourceSelectJob on startup to
tell the server that this session belongs to an resource.
If the server was restarted (e.g. after a server crash), the session
had been reconnected, but the ResourceSelectJob not been re-executed.
This lead to failing of resource-specific jobs in the new session.
M +9 -0 resourcebase.cpp
M +1 -0 resourcebase.h
M +2 -0 session.cpp
M +9 -0 session.h
--- trunk/KDE/kdepimlibs/akonadi/resourcebase.cpp #1207332:1207333
@@ -136,6 +136,13 @@
void changeCommittedResult( KJob* job );
+ void slotSessionReconnected()
+ {
+ Q_Q( ResourceBase );
+
+ new ResourceSelectJob( q->identifier() );
+ }
+
void createItemSyncInstanceIfMissing()
{
Q_Q( ResourceBase );
@@ -229,6 +236,8 @@
DBusConnectionPool::threadConnection().registerObject( QLatin1String( "/Debug" ), \
d, QDBusConnection::ExportScriptableSlots );
new ResourceSelectJob( identifier() );
+
+ connect( d->mChangeRecorder->session(), SIGNAL( reconnected() ), SLOT( \
slotSessionReconnected() ) ); }
ResourceBase::~ResourceBase()
--- trunk/KDE/kdepimlibs/akonadi/resourcebase.h #1207332:1207333
@@ -593,6 +593,7 @@
Q_PRIVATE_SLOT( d_func(), void slotPrepareItemRetrieval( const Akonadi::Item& \
item ) )
Q_PRIVATE_SLOT( d_func(), void slotPrepareItemRetrievalResult( KJob* ) )
Q_PRIVATE_SLOT( d_func(), void changeCommittedResult( KJob* ) )
+ Q_PRIVATE_SLOT( d_func(), void slotSessionReconnected() )
};
}
--- trunk/KDE/kdepimlibs/akonadi/session.cpp #1207332:1207333
@@ -152,6 +152,8 @@
tcpSocket->connectToHost( serverAddress, port );
}
#endif
+
+ emit mParent->reconnected();
}
void SessionPrivate::socketError( QLocalSocket::LocalSocketError )
--- trunk/KDE/kdepimlibs/akonadi/session.h #1207332:1207333
@@ -95,6 +95,15 @@
*/
void clear();
+ Q_SIGNALS:
+ /**
+ * This signal is emitted whenever the session has been reconnected
+ * to the server (e.g. after a server crash).
+ *
+ * @since 4.6
+ */
+ void reconnected();
+
protected:
/**
* Creates a new session with shared private object.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic