-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A little bit ot KF5 integration #2717
Conversation
This was causing clashes between KF5 and KDE4. For sure, KF5 headers are the source of problem, but let's work around it
I don't want to integrate with any specific DE. About the colors. I am going to change them for v3.2.0. For light backgrounds the color scheme will be the ones shown here: http://qbforums.shiki.hu/index.php/topic,2509.msg14715.html#msg14715 |
Many users use qbt under XFCE, GNOME and LXDE.
The color scheme is very similar to new color scheme I pushed. What are your thoughts on that?
Can you point me to the FDO specification? |
@sledgehammer999 |
True. But I have a hard time believing that distro packagers will provide multiple packages. They will either enable KF5 support altogether or not enable it at all. |
It's still nice for those who build qBittorrent on their own. EDIT: OK, maybe this case is a bit different, but what's important is that qBittorrent does not depend on the KF5. |
IMO, since we can use d-bus there is no need for KF5 libs. |
Here is a draft of the spec: https://developer.gnome.org/notification-spec/ |
We already support that spec in the current code. Maybe knotify doesn't support it? |
Yes, but partially. You do not support actions, for example. |
I am ok with extending it then. |
While rebasing on top of the current qBittorrent master branch I encountered problems with the new TorrentHandle class. Excuse me if this is not right place to ask questions, but could, please, someone explain to me what is the purpose of the following: class TorrentHandle : public QObject, public TorrentHandlePrivate In particular:
Thank you in advance |
I think @glassez is the right person to answer those questions. |
I used this model (unlike libtorrent). Each torrent will only match a single instance of the class TorrentHandle. Therefore, the objects themselves cannot be copied. Session manages these objects, and we can only get pointers to them.
It uses QObject parent-child relationship.
TorrentHandlePrivate is an interface between TorrentHandle and Session (to avoid c++ friendship). Session object need to use some methods of TorrentHandle class, which in this case should be kept private to the outside world. Therefore, it accesses this methods through TorrentHandlePrivate interface. This may not be a good idea, but I have not found another yet.
Why? |
Using qBittorrent in Plasma 5 brought two displeasures for me. With dark colour scheme rows with special status in the torrents list are almost unreadable (downloading, green, is a good example of this). qBittorrent shows desktop notifications, but they are not as nice as Plasma ones.
Since KDE Frameworks 5 (KF5) supply QMake modules, it is easy to use them from qBittorrent. Here I've tried to address these problems by reading KDE colour scheme (and using its colours for the torrent list) and by using KF5 notifications component.
As a result this greatly improved the look of the main window, made lines with any status readable (depends on the colour scheme, of course). Notifications in Plasma became more functional: important ones stay visible until a user close them, "download finished" notification contains an action to open the torrent contents, and details of the notification can be tuned via standard KDE settings. Notification action is possible with pure DBus, of course, but KF5 interface is much simpler to work with.
The code shall, in principle, work with KDE4 too (maybe with minor changes), but I do not know how to hook KDE4 into the build system.
I've not implemented configure checks for KF5 (do not know how to do that), but QMake fails if KF5 modules are not found, and I hope this is enough.