Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jb53879_move_socket_path' into 'master'
Move socket path. See merge request mer-core/messagingframework!57
- Loading branch information
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Tomi=20Lepp=C3=A4nen?= <tomi.leppanen@jolla.com> | ||
Date: Mon, 12 Apr 2021 17:09:15 +0300 | ||
Subject: [PATCH] Store socket in RuntimeLocation | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
Signed-off-by: Tomi Leppänen <tomi.leppanen@jolla.com> | ||
--- | ||
src/libraries/qmfclient/support/qcopchannel.cpp | 5 +++-- | ||
src/libraries/qmfclient/support/qcopserver.cpp | 4 +++- | ||
2 files changed, 6 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/src/libraries/qmfclient/support/qcopchannel.cpp b/src/libraries/qmfclient/support/qcopchannel.cpp | ||
index 2e1d67af..e921e070 100644 | ||
--- a/src/libraries/qmfclient/support/qcopchannel.cpp | ||
+++ b/src/libraries/qmfclient/support/qcopchannel.cpp | ||
@@ -48,6 +48,7 @@ | ||
#include "qcoreevent.h" | ||
#include "qmetaobject.h" | ||
#include "qmaillog.h" | ||
+#include "qstandardpaths.h" | ||
|
||
QCopServerRegexp::QCopServerRegexp(const QString& ch, QCopClient *cl) | ||
: channel(ch), client(cl) | ||
@@ -1095,8 +1096,8 @@ void QCopClient::disconnectFromServer() | ||
|
||
QString QCopThreadData::socketPath() | ||
{ | ||
- //return (Qtopia::inline tempDir() + "qcop-server").toUtf8(); | ||
- return QString::fromLatin1("qcop-server-0"); | ||
+ return QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation) | ||
+ + QStringLiteral("/messageserver/qcop-server-0"); | ||
} | ||
|
||
#else | ||
diff --git a/src/libraries/qmfclient/support/qcopserver.cpp b/src/libraries/qmfclient/support/qcopserver.cpp | ||
index 39def5aa..1b212e24 100644 | ||
--- a/src/libraries/qmfclient/support/qcopserver.cpp | ||
+++ b/src/libraries/qmfclient/support/qcopserver.cpp | ||
@@ -37,6 +37,7 @@ | ||
#include "qcopchannelmonitor_p.h" | ||
#include <QtCore/qfile.h> | ||
#include <QtCore/qdir.h> | ||
+#include <QtCore/qfileinfo.h> | ||
|
||
QCopServerPrivate::QCopServerPrivate() | ||
: QCopLocalServer() | ||
@@ -44,6 +45,7 @@ QCopServerPrivate::QCopServerPrivate() | ||
bool ok; | ||
#ifndef QT_NO_QCOP_LOCAL_SOCKET | ||
QString path = QCopThreadData::socketPath(); | ||
+ QFileInfo(path).dir().mkpath("."); | ||
ok = listen(path); | ||
#ifdef Q_OS_UNIX | ||
if (!ok) { | ||
@@ -56,7 +58,7 @@ QCopServerPrivate::QCopServerPrivate() | ||
socket->connectToServer(path); | ||
if (!socket->waitForConnected()) { | ||
delete socket; | ||
- QFile::remove(QDir::tempPath() + QChar::fromLatin1('/') + path); | ||
+ QFile::remove(path); | ||
ok = listen(path); | ||
} else { | ||
delete socket; | ||
-- | ||
2.30.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters