Changeset View
Changeset View
Standalone View
Standalone View
src/core/connection.cpp
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 44 | Connection::Connection(ConnectionType connType, const QByteArray &sessionId, | |||
---|---|---|---|---|---|
49 | , mCommandBuffer(commandBuffer) | 49 | , mCommandBuffer(commandBuffer) | ||
50 | { | 50 | { | ||
51 | qRegisterMetaType<Protocol::CommandPtr>(); | 51 | qRegisterMetaType<Protocol::CommandPtr>(); | ||
52 | qRegisterMetaType<QAbstractSocket::SocketState>(); | 52 | qRegisterMetaType<QAbstractSocket::SocketState>(); | ||
53 | 53 | | |||
54 | const QByteArray sessionLogFile = qgetenv("AKONADI_SESSION_LOGFILE"); | 54 | const QByteArray sessionLogFile = qgetenv("AKONADI_SESSION_LOGFILE"); | ||
55 | if (!sessionLogFile.isEmpty()) { | 55 | if (!sessionLogFile.isEmpty()) { | ||
56 | mLogFile = new QFile(QStringLiteral("%1.%2.%3.%4-%5").arg(QString::fromLatin1(sessionLogFile)) | 56 | mLogFile = new QFile(QStringLiteral("%1.%2.%3.%4-%5").arg(QString::fromLatin1(sessionLogFile)) | ||
57 | .arg(QString::number(QApplication::applicationPid())) | 57 | .arg(QApplication::applicationPid()) | ||
58 | .arg(QString::number(reinterpret_cast<qulonglong>(this), 16)) | 58 | .arg(QString::number(reinterpret_cast<qulonglong>(this), 16), | ||
59 | .arg(QString::fromLatin1(mSessionId.replace('/', '_'))) | 59 | QString::fromLatin1(mSessionId.replace('/', '_')), | ||
60 | .arg(connType == CommandConnection ? QStringLiteral("Cmd") : QStringLiteral("Ntf"))); | 60 | connType == CommandConnection ? QStringLiteral("Cmd") : QStringLiteral("Ntf"))); | ||
61 | if (!mLogFile->open(QIODevice::WriteOnly | QIODevice::Truncate)) { | 61 | if (!mLogFile->open(QIODevice::WriteOnly | QIODevice::Truncate)) { | ||
62 | qCWarning(AKONADICORE_LOG) << "Failed to open Akonadi Session log file" << mLogFile->fileName(); | 62 | qCWarning(AKONADICORE_LOG) << "Failed to open Akonadi Session log file" << mLogFile->fileName(); | ||
63 | delete mLogFile; | 63 | delete mLogFile; | ||
64 | mLogFile = nullptr; | 64 | mLogFile = nullptr; | ||
65 | } | 65 | } | ||
66 | } | 66 | } | ||
67 | } | 67 | } | ||
68 | 68 | | |||
▲ Show 20 Lines • Show All 266 Lines • Show Last 20 Lines |