Skip to content

Conversation

@hebasto
Copy link
Member

@hebasto hebasto commented Apr 13, 2022

qDBusRegisterMetaType returns:

@hebasto
Copy link
Member Author

hebasto commented Apr 13, 2022

Friendly ping @laanwj :)

`qDBusRegisterMetaType` returns:
 - `int` in Qt 5
 - `QMetaType` in Qt 6
@hebasto hebasto added the Qt 6 Transition to Qt 6 label Apr 13, 2022
@laanwj
Copy link
Member

laanwj commented Apr 15, 2022

I have no idea whether this is correct. But as we don't use custom icons for notifications at all, I think we could get rid of the entire icon data, as well as FreedesktopIcon? so

hints["icon_data"] =…

and everything that it depend on, including any const QIcon &icon parameters.

This is less invasive than removing dbus support completely as in #575, but will still allow deleting this code.

@hebasto
Copy link
Member Author

hebasto commented Apr 16, 2022

@laanwj

I have no idea whether this is correct. But as we don't use custom icons for notifications at all, I think we could get rid of the entire icon data, as well as FreedesktopIcon? so

hints["icon_data"] =…

and everything that it depend on, including any const QIcon &icon parameters.

This is less invasive than removing dbus support completely as in #575, but will still allow deleting this code.

On my Ubuntu 22.04 with a custom testing patch:

Screenshot from 2022-04-16 11-43-42

With the following diff

--- a/src/qt/notificator.cpp
+++ b/src/qt/notificator.cpp
@@ -193,7 +193,6 @@ void Notificator::notifyDBus(Class cls, const QString &title, const QString &tex
     {
         tmpicon = icon;
     }
-    hints["icon_data"] = FreedesktopImage::toVariant(tmpicon.pixmap(FREEDESKTOP_NOTIFICATION_ICON_SIZE).toImage());
     args.append(hints);
 
     // Timeout (in msec)

Screenshot from 2022-04-16 11-42-22

As an Ubuntu user, I'd like to keep the current functionality.

@laanwj
Copy link
Member

laanwj commented Apr 16, 2022

Doesn't the latter icon convey the same information but integrate much better into your desktop theme?

But I guess ideally you'd want notifications to have the icon of the program that emits them? Like, a bitcoin icon instead of the standard issue traffic sign? So yeah if that's what you want then keeping the custom icon functionality (and actually using it) would make sense.

@laanwj
Copy link
Member

laanwj commented Apr 16, 2022

At some point we actually used to have different custom icons for notifications, even different ones for incoming/sent/etc transactions I don't know what happened to that. But as it's been removed my first reaction was to rip it out completely.

Anyhow code review ACK 6cf4dc7

@hebasto
Copy link
Member Author

hebasto commented Apr 16, 2022

Doesn't the latter icon convey the same information but integrate much better into your desktop theme?

The same icon for message / warning / critical notification.

But I guess ideally you'd want notifications to have the icon of the program that emits them?

Probably. macOS does like that.

So yeah if that's what you want then keeping the custom icon functionality (and actually using it) would make sense.

Yes. Let's keep it for now.

@hebasto
Copy link
Member Author

hebasto commented Apr 16, 2022

@luke-jr @jarolrod @prusnak

Mind looking into this PR?

@prusnak
Copy link
Contributor

prusnak commented Apr 16, 2022

Concept ACK

Copy link
Contributor

@w0xlt w0xlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK 6cf4dc7 on Ubuntu 21.10, Qt 5.15.2.

@hebasto hebasto merged commit 254f3cc into bitcoin-core:master Apr 19, 2022
@hebasto hebasto deleted the 220413-metatype branch April 19, 2022 17:37
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 19, 2022
…e `qDBusRegisterMetaType` return type

6cf4dc7 qt: Do not assume `qDBusRegisterMetaType` return type (Hennadii Stepanov)

Pull request description:

  `qDBusRegisterMetaType` returns:
  - [`int`](https://doc.qt.io/qt-5/qdbusargument.html#qDBusRegisterMetaType) in Qt 5
  - [`QMetaType`](https://doc.qt.io/qt-6/qdbusargument.html#qDBusRegisterMetaType) in Qt 6

ACKs for top commit:
  laanwj:
    Anyhow code review ACK 6cf4dc7
  w0xlt:
    tACK bitcoin-core/gui@6cf4dc7 on Ubuntu 21.10, Qt 5.15.2.

Tree-SHA512: 17d43e191d31a6f927d19550c52471ed3b9222f492a23cee2e553f2c679cf37125e00637b00ea9f4ee3e37dfcf5278171be9a5e1e2e899592516291c7b5cd942
@bitcoin-core bitcoin-core locked and limited conversation to collaborators Apr 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Qt 6 Transition to Qt 6

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants