diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2019-07-10 17:06:00 +0300 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2019-08-22 11:49:19 +0000 |
commit | b3eaeb178299c4c847d38969f095ac1ce3c0545f (patch) | |
tree | 934b062604a45ddd90ed436f9b3cae41713fb113 /src/libs/installer/remoteserver.cpp | |
parent | 8efb76dc0a9121732b924c10de70b97185cf140d (diff) |
Enable support for Qt 5.12 in installer framework
Workaround issues of IFW not being able to work on elevated mode
caused by changes in qtbase, namely when initializing socket
connection between remote installer client and server, and writing
maintenance tool binary.
Switch to using unbuffered mode for QFSFileEngine instances as
buffered mode support has been dropped. Fix calls to QFile::copy()
when running elevated installer process. Make minor modifications
for unit tests to pass. Explicitly fail and return when performing
CreateLocalRepositoryOperation on non-owned directory.
Task-number: QTIFW-1312
Change-Id: I3db72547ee95c87d8c02d27e5b31c7b30e793431
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/remoteserver.cpp')
-rw-r--r-- | src/libs/installer/remoteserver.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libs/installer/remoteserver.cpp b/src/libs/installer/remoteserver.cpp index ddf4d6ecf..66cfefebb 100644 --- a/src/libs/installer/remoteserver.cpp +++ b/src/libs/installer/remoteserver.cpp @@ -93,7 +93,17 @@ void RemoteServer::start() void RemoteServer::init(const QString &socketName, const QString &key, Protocol::Mode mode) { Q_D(RemoteServer); + + // Since Qt 5.12.0, we should determince the full socket path on Unix + // platforms before calling QLocalSocketPrivate::_q_connectToSocket(). + // Otherwise the new canonical implementation of QDir::tempPath() + // presents unintended usage of RemoteFileEngine. + +#if QT_VERSION >= QT_VERSION_CHECK(5,12,0) && defined(Q_OS_UNIX) + d->m_socketName = socketPathName(socketName); +#else d->m_socketName = socketName; +#endif d->m_key = key; d->m_mode = mode; } @@ -116,6 +126,18 @@ QString RemoteServer::authorizationKey() const return d->m_key; } +QString RemoteServer::socketPathName(const QString &socketName) const +{ + QString socketPathName; + if (socketName.startsWith(QLatin1Char('/'))) { + socketPathName = socketName; + } else { + socketPathName = QDir::tempPath(); + socketPathName += QLatin1Char('/') + socketName; + } + return socketPathName; +} + /*! Restarts the watchdog that tries to kill the server. */ |