akonadi
session.cpp
47 // ### FIXME pipelining got broken by switching result emission in JobPrivate::handleResponse to delayed emission
48 // in order to work around exec() deadlocks. As a result of that Session knows to late about a finished job and still
96 foreach (const QString &entry, QString::fromLatin1(serverAddressEnvVar.mid(pos + 1)).split(QLatin1Char(','))) {
129 serverAddress = connectionSettings.value(QLatin1String("Data/NamedPipe"), QLatin1String("Akonadi")).toString();
132 serverAddress = connectionSettings.value(QLatin1String("Data/UnixPath"), QString(defaultSocketDir + QLatin1String("/akonadiserver.socket"))).toString();
136 // create sockets if not yet done, note that this does not yet allow changing socket types on the fly
141 mParent->connect(localSocket, SIGNAL(error(QLocalSocket::LocalSocketError)), SLOT(socketError(QLocalSocket::LocalSocketError)));
144 mParent->connect(tcpSocket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(socketError(QAbstractSocket::SocketError)));
192 const QByteArray data = socket->read(qMin(socket->bytesAvailable(), parser->continuationSize() - 1));
292 job->setErrorText(i18n("Protocol version %1 found, expected at least %2", protocolVersion, minimumProtocolVersion()));
306 // ### careful, this method can be called from the QObject dtor of job (see jobDestroyed() below)
342 QObject::connect(job, SIGNAL(writeFinished(Akonadi::Job*)), mParent, SLOT(jobWriteFinished(Akonadi::Job*)));
383 void SessionPrivate::itemRevisionChanged(Akonadi::Item::Id itemId, int oldRevision, int newRevision)
447 socket->disconnect(mParent); // prevent signal emitted from close() causing mayhem - we might be called from ~QThreadStorage!
451 QMetaObject::invokeMethod(mParent, "reconnect", Qt::QueuedConnection); // avoids reconnecting in the dtor
bool flush()
SocketState state() const
The server protocol version is too old or too new.
Definition: job.h:106
QObject * sender() const
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
void forceReconnect()
Disconnects a previously existing connection and tries to reconnect.
Definition: session.cpp:442
QString fileName() const
bool isEmpty() const
static ServerManager * self()
Returns the singleton instance of this class, for connecting to its signals.
Definition: servermanager.cpp:161
static void createDefaultSession(const QByteArray &sessionId)
Creates a new default session for this thread with the given sessionId.
Definition: session.cpp:481
static void setDefaultSession(Session *session)
Sets the default session.
Definition: session.cpp:491
virtual void close()
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
static Session * defaultSession()
Returns the default session for this thread.
Definition: session.cpp:496
int size() const
void connectToHost(const QString &hostName, quint16 port, QFlags< QIODevice::OpenModeFlag > openMode)
int indexOf(char ch, int from) const
QString number(int n, int base)
bool isEmpty() const
QByteArray number(int n, int base)
qint64 read(char *data, qint64 maxSize)
qint64 applicationPid()
QCoreApplication * instance()
Definition: session_p.h:42
T & first()
Server is not running, could be no one started it yet or it failed to start.
Definition: servermanager.h:51
QByteArray mid(int pos, int len) const
virtual bool open(QFlags< QIODevice::OpenModeFlag > mode)
virtual qint64 bytesAvailable() const
void endJob(Job *job)
virtual void addJob(Job *job)
Associates the given Job object with this session.
void reconnected()
This signal is emitted whenever the session has been reconnected to the server (e.g.
bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9)
virtual void reconnect()
Attemps to establish a connections to the Akonadi server.
void itemRevisionChanged(Akonadi::Item::Id itemId, int oldRevision, int newRevision)
Propagate item revision changes to following jobs.
QByteArray left(int len) const
T & last()
static QString connectionFile()
Default location for akonadiconnectionrc.
void connectToServer(const QString &name, QFlags< QIODevice::OpenModeFlag > openMode)
qint64 write(const char *data, qint64 maxSize)
QString fromLatin1(const char *str, int size)
iterator insert(const Key &key, const T &value)
Session(const QByteArray &sessionId=QByteArray(), QObject *parent=0)
Creates a new session.
Definition: session.cpp:454
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
virtual bool canReadLine() const
LocalSocketState state() const
bool endsWith(const QByteArray &ba) const
Server is not operational and an error has been detected.
Definition: servermanager.h:55
applicationName
qint64 readLine(char *data, qint64 maxSize)
uint toUInt(bool *ok, int base) const
singleShot
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.