diff options
author | Alex Trotsenko <alex1973tr@gmail.com> | 2020-12-17 18:28:54 +0200 |
---|---|---|
committer | Alex Trotsenko <alex1973tr@gmail.com> | 2020-12-17 21:33:17 +0200 |
commit | 7a4e68624094216844134fe86a167444b25d2894 (patch) | |
tree | 555bbdaff40c57382392af6a5dcd2b266e907255 /src/corelib/kernel/qsocketnotifier.cpp | |
parent | 1649137b9311a5ee3d12bc8824f5453294bd6fe9 (diff) |
QSocketNotifier: hone setSocket() API
Remove a second argument to the setSocket(qintptr, bool) function as
it makes the API harder to understand.
Change-Id: Ib1852a4e9d96adde35bfbf0fe03b386d9ded395a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'src/corelib/kernel/qsocketnotifier.cpp')
-rw-r--r-- | src/corelib/kernel/qsocketnotifier.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/corelib/kernel/qsocketnotifier.cpp b/src/corelib/kernel/qsocketnotifier.cpp index 0e360342e9..8070d70a92 100644 --- a/src/corelib/kernel/qsocketnotifier.cpp +++ b/src/corelib/kernel/qsocketnotifier.cpp @@ -235,20 +235,19 @@ QSocketNotifier::~QSocketNotifier() /*! \since 6.1 - Assigns the \a socket to this notifier. The \a enable argument is - passed to the setEnabled() function. + Assigns the \a socket to this notifier. + + \note The notifier will be disabled as a side effect and needs + to be re-enabled. \sa setEnabled(), isValid() */ -void QSocketNotifier::setSocket(qintptr socket, bool enable) +void QSocketNotifier::setSocket(qintptr socket) { Q_D(QSocketNotifier); - if (d->sockfd != QSocketDescriptor(socket)) { - setEnabled(false); - d->sockfd = socket; - } - setEnabled(enable); + setEnabled(false); + d->sockfd = socket; } /*! |