> +void Clipboard::setMimeData(QMimeData* mimeData, QClipboard::Mode mode)
> + QDBusPendingCall reply = mContentHub->createPaste(*mimeData);
> +
> + // Don't care whether it succeeded
> + auto *watcher = new QDBusPendingCallWatcher(reply, this);
> + connect(watcher, &QDBusPendingCallWatcher::finished,
> + watcher, &QObject::deleteLater);
> if you don't care, why do you do this at all? I would think just calling
> createPaste and throwing away the returned QDBusPendingCall is enough.
I also thought that when I first wrote it. But the destructor of a QDBusPendingCall cancels the call if it's still ongoing and we don't want that. Thus we have to keep a QDBusPendingCall instance around (such as a QDBusPendingCallWatcher) until the remote method call is done.
> +void Clipboard: :setMimeData( QMimeData* mimeData, QClipboard::Mode mode) >createPaste( *mimeData) ; lWatcher( reply, this); llWatcher: :finished, :deleteLater) ;
> + QDBusPendingCall reply = mContentHub-
> +
> + // Don't care whether it succeeded
> + auto *watcher = new QDBusPendingCal
> + connect(watcher, &QDBusPendingCa
> + watcher, &QObject:
> if you don't care, why do you do this at all? I would think just calling
> createPaste and throwing away the returned QDBusPendingCall is enough.
I also thought that when I first wrote it. But the destructor of a QDBusPendingCall cancels the call if it's still ongoing and we don't want that. Thus we have to keep a QDBusPendingCall instance around (such as a QDBusPendingCal lWatcher) until the remote method call is done.