Changeset View
Changeset View
Standalone View
Standalone View
src/server/akonadi.cpp
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Line(s) | 134 | if (!mNtfServer->listen(ntfPipe)) { | |||
---|---|---|---|---|---|
137 | return false; | 137 | return false; | ||
138 | } | 138 | } | ||
139 | 139 | | |||
140 | connectionSettings.setValue(QStringLiteral("Data/Method"), QStringLiteral("NamedPipe")); | 140 | connectionSettings.setValue(QStringLiteral("Data/Method"), QStringLiteral("NamedPipe")); | ||
141 | connectionSettings.setValue(QStringLiteral("Data/NamedPipe"), cmdPipe); | 141 | connectionSettings.setValue(QStringLiteral("Data/NamedPipe"), cmdPipe); | ||
142 | connectionSettings.setValue(QStringLiteral("Notifications/Method"), QStringLiteral("NamedPipe")); | 142 | connectionSettings.setValue(QStringLiteral("Notifications/Method"), QStringLiteral("NamedPipe")); | ||
143 | connectionSettings.setValue(QStringLiteral("Notifications/NamedPipe"), ntfPipe); | 143 | connectionSettings.setValue(QStringLiteral("Notifications/NamedPipe"), ntfPipe); | ||
144 | #else | 144 | #else | ||
145 | const QString socketDir = Utils::preferredSocketDirectory(StandardDirs::saveDir("data")); | 145 | const QString cmdSocketName = QStringLiteral("akonadiserver-cmd.socket"); | ||
146 | const QString cmdSocketFile = socketDir % QStringLiteral("/akonadiserver-cmd.socket"); | 146 | const QString ntfSocketName = QStringLiteral("akonadiserver-ntf.socket"); | ||
147 | const QString socketDir = Utils::preferredSocketDirectory(StandardDirs::saveDir("data"), | ||||
148 | qMax(cmdSocketName.length(), ntfSocketName.length())); | ||||
149 | const QString cmdSocketFile = socketDir % QLatin1Char('/') % cmdSocketName; | ||||
147 | QFile::remove(cmdSocketFile); | 150 | QFile::remove(cmdSocketFile); | ||
148 | if (!mCmdServer->listen(cmdSocketFile)) { | 151 | if (!mCmdServer->listen(cmdSocketFile)) { | ||
149 | qCCritical(AKONADISERVER_LOG) << "Unable to listen on Unix socket" << cmdSocketFile << ":" << mCmdServer->errorString(); | 152 | qCCritical(AKONADISERVER_LOG) << "Unable to listen on Unix socket" << cmdSocketFile << ":" << mCmdServer->errorString(); | ||
150 | quit(); | 153 | quit(); | ||
151 | return false; | 154 | return false; | ||
152 | } | 155 | } | ||
153 | 156 | | |||
154 | const QString ntfSocketFile = socketDir % QStringLiteral("/akonadiserver-ntf.socket"); | 157 | const QString ntfSocketFile = socketDir % QLatin1Char('/') % ntfSocketName; | ||
155 | QFile::remove(ntfSocketFile); | 158 | QFile::remove(ntfSocketFile); | ||
156 | if (!mNtfServer->listen(ntfSocketFile)) { | 159 | if (!mNtfServer->listen(ntfSocketFile)) { | ||
157 | qCCritical(AKONADISERVER_LOG) << "Unable to listen on Unix socket" << ntfSocketFile << ":" << mNtfServer->errorString(); | 160 | qCCritical(AKONADISERVER_LOG) << "Unable to listen on Unix socket" << ntfSocketFile << ":" << mNtfServer->errorString(); | ||
158 | quit(); | 161 | quit(); | ||
159 | return false; | 162 | return false; | ||
160 | } | 163 | } | ||
161 | 164 | | |||
162 | connectionSettings.setValue(QStringLiteral("Data/Method"), QStringLiteral("UnixPath")); | 165 | connectionSettings.setValue(QStringLiteral("Data/Method"), QStringLiteral("UnixPath")); | ||
▲ Show 20 Lines • Show All 265 Lines • Show Last 20 Lines |