diff options
author | Katja Marttila <katja.marttila@theqtcompany.com> | 2016-05-20 09:01:57 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2016-05-20 11:22:49 +0000 |
commit | dce1c562562266cff98ccede3bc10371b14a207b (patch) | |
tree | 19e5bf3d25b6faf290fc1a67ac5b6ad93e344fae | |
parent | 80a655749ffbce4ec6328541e194e08d60b34639 (diff) |
Revert "Windows: Fix crashes in elevated installation"
This reverts commit 95ae661cba931a982d12cd68d8b4da392d74bdd0.
As we now require at least Qt5.5.0 we don't need this workaround
Change-Id: I6ab930886bc9af0716a61a8e21b12db83018b0c2
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
-rw-r--r-- | src/libs/installer/installer.pro | 1 | ||||
-rw-r--r-- | src/libs/installer/keepaliveobject.cpp | 4 | ||||
-rw-r--r-- | src/libs/installer/localsocket.h | 73 | ||||
-rw-r--r-- | src/libs/installer/remoteobject.cpp | 3 | ||||
-rw-r--r-- | src/libs/installer/remoteserverconnection.cpp | 3 |
5 files changed, 4 insertions, 80 deletions
diff --git a/src/libs/installer/installer.pro b/src/libs/installer/installer.pro index ed27d61d6..9447108ee 100644 --- a/src/libs/installer/installer.pro +++ b/src/libs/installer/installer.pro @@ -125,7 +125,6 @@ HEADERS += packagemanagercore.h \ serverauthenticationdialog.h \ keepaliveobject.h \ systeminfo.h \ - localsocket.h \ packagesource.h \ lib7z_guid.h \ lib7z_create.h \ diff --git a/src/libs/installer/keepaliveobject.cpp b/src/libs/installer/keepaliveobject.cpp index 72227548c..4e1d01896 100644 --- a/src/libs/installer/keepaliveobject.cpp +++ b/src/libs/installer/keepaliveobject.cpp @@ -33,8 +33,8 @@ #include "keepaliveobject.h" #include "remoteclient.h" -#include "localsocket.h" +#include <QLocalSocket> #include <QTimer> namespace QInstaller { @@ -48,7 +48,7 @@ KeepAliveObject::KeepAliveObject() void KeepAliveObject::start() { m_timer = new QTimer(this); - m_socket = new LocalSocket(this); + m_socket = new QLocalSocket(this); connect(m_timer, &QTimer::timeout, [this]() { if (m_socket->state() != QLocalSocket::UnconnectedState) diff --git a/src/libs/installer/localsocket.h b/src/libs/installer/localsocket.h deleted file mode 100644 index 5b5e462f9..000000000 --- a/src/libs/installer/localsocket.h +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Installer Framework. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -**************************************************************************/ - -#ifndef LOCALSOCKET_H -#define LOCALSOCKET_H - -#include <QLocalSocket> - -#if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(5,5,0) - -// This is a crude hack to work around QLocalSocket::waitForReadyRead returning instantly -// if there are still bytes left in the buffer. This has been fixed in Qt 5.5.0 ... -class LocalSocket : public QLocalSocket -{ -public: - LocalSocket(QObject *parent = 0) : QLocalSocket(parent), inReadyRead(false) - { - } - - qint64 bytesAvailable() const { - if (inReadyRead) - return 0; - return QLocalSocket::bytesAvailable(); - } - - bool waitForReadyRead(int msecs = 30000) { - inReadyRead = true; - bool result = QLocalSocket::waitForReadyRead(msecs); - inReadyRead = false; - return result; - } - -private: - bool inReadyRead; -}; - -#else - -typedef QLocalSocket LocalSocket; - -#endif - -#endif // LOCALSOCKET_H diff --git a/src/libs/installer/remoteobject.cpp b/src/libs/installer/remoteobject.cpp index 3255833f2..e9c0e1632 100644 --- a/src/libs/installer/remoteobject.cpp +++ b/src/libs/installer/remoteobject.cpp @@ -35,7 +35,6 @@ #include "protocol.h" #include "remoteclient.h" -#include "localsocket.h" #include <QCoreApplication> #include <QElapsedTimer> @@ -73,7 +72,7 @@ bool RemoteObject::authorize() if (m_socket) delete m_socket; - m_socket = new LocalSocket; + m_socket = new QLocalSocket; m_socket->connectToServer(RemoteClient::instance().socketName()); if (m_socket->waitForConnected()) { diff --git a/src/libs/installer/remoteserverconnection.cpp b/src/libs/installer/remoteserverconnection.cpp index 665958bee..b8b815599 100644 --- a/src/libs/installer/remoteserverconnection.cpp +++ b/src/libs/installer/remoteserverconnection.cpp @@ -38,7 +38,6 @@ #include "remoteserverconnection_p.h" #include "utils.h" #include "permissionsettings.h" -#include "localsocket.h" #include <QCoreApplication> #include <QDataStream> @@ -71,7 +70,7 @@ private: void RemoteServerConnection::run() { - LocalSocket socket; + QLocalSocket socket; socket.setSocketDescriptor(m_socketDescriptor); QScopedPointer<PermissionSettings> settings; |