This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[SOLVED] QDBus VisualNotifications

Tags: None
(comma "," separated)
User avatar
LBL
Registered Member
Posts
131
Karma
0
OS

[SOLVED] QDBus VisualNotifications

Tue Jun 09, 2009 5:13 pm
I'm trying to write a little programm for myself in Qt. I wanted to include some cool stuff like using the notifications from KDE instead of the QSystemTrayIcon ones...

But the QDBus call seems to fail. I can connect to the Notify object but the call itself fails with no further notification.

I managed to call the method via qdbusviewer and could call other methods but this one simply fails.

Here's my code:
Code: Select all
QDBusInterface knotify("org.kde.VisualNotifications","/VisualNotifications", "org.kde.VisualNotifications");
QVariantList list;
list reply=knotify.callWithArgumentList(QDBus::AutoDetect,"Notify",list);
qDebug() callWithArgumentList
)
The output is: dbus true false
Nothing more.

I hope I'm at the right place here and someone can help me.


42: There is no other answer. There are only different ways to express it.
0x2A
0o52
0b101010
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

[SOLVED] QDBus VisualNotifications

Wed Jun 10, 2009 5:10 am
You do not need to use Visual Notifications manually, it will be done for you automatically if you are using KNotification.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
anda_skoa
KDE Developer
Posts
783
Karma
4
OS

[SOLVED] QDBus VisualNotifications

Wed Jun 10, 2009 12:58 pm
The problem could be the second parameter since "0" might just be interpreted as an int and you need an uint.

My recommendation is to get the D-Bus introspection data[1] and then let qdbusxml2cpp generate an interface class for you.

[1]
Code: Select all
qdbus org.kde.VisualNotifications /VisualNotifications org.freedesktop.DBus.Introspectable.Introspect


Cheers,
_


anda_skoa, proud to be a member of KDE forums since 2008-Oct.
User avatar
LBL
Registered Member
Posts
131
Karma
0
OS

[SOLVED] QDBus VisualNotifications

Wed Jun 10, 2009 9:26 pm
yeah, that did the trick.

i had some probles with the parameter -c which should have named the class. i named all classes the same which caused erros but without it everything worked just fine. thanks :)

You do not need to use Visual Notifications manually, it will be done for you automatically if you are using KNotification.

I tried to do this but it didn't worked as the header file couldn't be found... the dev files aren't installed, so tried the second solution.

Thanks to both of you


42: There is no other answer. There are only different ways to express it.
0x2A
0o52
0b101010


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]