D29391: Introduce setWindow and CloseWhenWindowActivated

Anthony Fieroni noreply at phabricator.kde.org
Tue May 19 05:41:43 BST 2020


anthonyfieroni added inline comments.

INLINE COMMENTS

> knotification.cpp:263
>      d->needUpdate = true;
>      d->flags = flags;
>      if (d->id >= 0) {

Flags can be changed, disconnect window, if present and activation flags is not set, connect in opposite.

> knotification.cpp:585
> +
> +    d->window = window;
> +    connect(window, &QWindow::activeChanged, this, [this, window]{

Disconnect previously window to this, if present

> knotification.cpp:586-590
> +    connect(window, &QWindow::activeChanged, this, [this, window]{
> +        if (window->isActive() && (d->flags &  CloseWhenWidgetActivated)) {
> +            close();
> +        }
> +    });

Connect if flag present.

REPOSITORY
  R289 KNotifications

REVISION DETAIL
  https://phabricator.kde.org/D29391

To: nicolasfella, #frameworks, broulik
Cc: anthonyfieroni, kossebau, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200519/f47c8267/attachment.htm>


More information about the Kde-frameworks-devel mailing list