Active Topics

 


Reply
Thread Tools
Posts: 51 | Thanked: 15 times | Joined on Apr 2009 @ ChengDu, SiChuan, P.R.C
#1
Hello,

I have a simple qt example would like working with D-Bus, but i got error when i launch it. some detail as following
Code:
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtCore/QStringList>
#include <QtDBus>

void method_1()
{
	qDebug() << "Demo_1 Method 1(in): ";

	QDBusConnection bus = QDBusConnection::sessionBus();
	QDBusInterface dbus_iface("org.freedesktop.Telepathy.ConnectionManager", "org/freedesktop/Telepathy/ConnectionManager", 
			"org.freedesktop.Telepathy.ConnectionManager", bus);
	QDBusReply<QStringList> reply = dbus_iface.call("ListProtocols");
	foreach (QString name, reply.value())
		qDebug() << name;
	qDebug() << "Demo_1 Method 1(out): ";
}

int main(int argc, char **argv)
{
	QCoreApplication app(argc, argv);

	if( !QDBusConnection::sessionBus().isConnected())
	{
		fprintf(stderr, "Cannot connect to the D-Bus session bus.\n"
				"To start it, run:\n"
				"\teval 'dbus-launch --auto-syntax'\n");
		return -1;
	}

	method_1();

	return 0;
}
and i run dbus-launch like this
Code:
dbus-launch --auto-syntax
then, i run that example and got the error like this
Code:
[sbox-DIABLO_X86: ~/qt_tmp/demo_1] > run-standalone.sh ./demo_1
Cannot connect to the D-Bus session bus.
To start it, run:
	eval 'dbus-launch --auto-syntax'
[sbox-DIABLO_X86: ~/qt_tmp/demo_1] >
Why the session bus is not connected? Dose anyone know how could qt working with D-Bus successful?

Last edited by funpig; 2009-05-06 at 14:23.
 
Posts: 432 | Thanked: 645 times | Joined on Mar 2009
#2
Hi funpig,

the problem is not on the Qt side, but a SDK-problem. We tried it here with the Fremantle SDK and it worked. I will try to figure out how to solve that issue.

Cheers Daniel
 
Posts: 432 | Thanked: 645 times | Joined on Mar 2009
#3
The problem can be most likely solved by export the dbus session bus address manually. you can do this by following these steps:

Code:
> eval $(dbus-launch --sh-syntax)
> export BUS_SESSION_BUS_ADDRESS
> export DBUS_SESSION_BUS_PID
Please try it out with your application. At least the dbus-monitor works then for me. If this does not work let me know.

Cheers Daniel
 

The Following 2 Users Say Thank You to danielwilms For This Useful Post:
Posts: 51 | Thanked: 15 times | Joined on Apr 2009 @ ChengDu, SiChuan, P.R.C
#4
Originally Posted by danielwilms View Post
The problem can be most likely solved by export the dbus session bus address manually. you can do this by following these steps:

Code:
> eval $(dbus-launch --sh-syntax)
> export BUS_SESSION_BUS_ADDRESS
> export DBUS_SESSION_BUS_PID
Please try it out with your application. At least the dbus-monitor works then for me. If this does not work let me know.

Cheers Daniel
Hi, Daniel

thank you for your reply. i tried your way like following:
Code:
[sbox-DIABLO_X86: ~/qt_tmp/demo_1] > eval $(dbus-launch --sh-syntax)
[sbox-DIABLO_X86: ~/qt_tmp/demo_1] > export BUS_SESSION_BUS_ADDRESS
[sbox-DIABLO_X86: ~/qt_tmp/demo_1] > export DBUS_SESSION_BUS_PID
[sbox-DIABLO_X86: ~/qt_tmp/demo_1] > run-standalone.sh ./demo_1
Cannot connect to the D-Bus session bus.
To start it, run:
	eval 'dbus-launch --auto-syntax'
[sbox-DIABLO_X86: ~/qt_tmp/demo_1] > dbus-monitor --session
signal sender=org.freedesktop.DBus -> dest=:1.0 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.0"
method call sender=:1.0 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='method_call'"
method call sender=:1.0 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='method_return'"
method call sender=:1.0 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='error'"
^Z
[1]+  Stopped                 dbus-monitor --session
[sbox-DIABLO_X86: ~/qt_tmp/demo_1] >
it looks dbus-monitor working fine. but my app still can't connected to D-bus. is it only way to fix this issue that's i update my Maemo SDK to fremantle??

Br funpig

Last edited by funpig; 2009-05-07 at 15:41.
 
Posts: 51 | Thanked: 15 times | Joined on Apr 2009 @ ChengDu, SiChuan, P.R.C
#5
Hi, Daniel

Do you have other solution could fix this problem in Maemo SDK 4.5?

Br
funpig
 
Posts: 432 | Thanked: 645 times | Joined on Mar 2009
#6
Hi funpig,

hmmm...the error message of your application is still the same as before??

But what do you need your application for? If you want to run it on your tablet then just updating to fremantle wouldn't be a solution. I will try to investigate more on it...

Cheers Daniel
 
Posts: 51 | Thanked: 15 times | Joined on Apr 2009 @ ChengDu, SiChuan, P.R.C
#7
Hi, Daniel

Because i'm focus on mid-software relate with SIP in nokia phone, So, i want write a simple QT app like VoIP that working with telepathy and run it in Maemo.
i'll update my Maemo SDK to Fremantle tonight. hope everything is ok!
thanks for your help!

Br
funpig
 
Posts: 51 | Thanked: 15 times | Joined on Apr 2009 @ ChengDu, SiChuan, P.R.C
#8
yesterday night, i just updated the scratchbox because the internet speed is too slow. it looks my app still can't connect to D-Bus just only updated the scratchbox. I'll continue to updating Maemo SDK tonight. let's see what's happened.
 
Posts: 51 | Thanked: 15 times | Joined on Apr 2009 @ ChengDu, SiChuan, P.R.C
#9
It's too bad. my hard disk is too small in VM. i can't install anything because that's no free space in my hard disk after i installed the new scratchbox.
I'll resize the hard disk in VM for get more space for continue working with VM.
 
Posts: 51 | Thanked: 15 times | Joined on Apr 2009 @ ChengDu, SiChuan, P.R.C
#10
my app is works fine after i upgrage to fremantle. but i got some error when i run
Code:
Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac &

unrecognised device identifier!
(EE) config/hal: NewInputDeviceRequest failed
after i run Xephyr, i launch the maemo simulator. it looks have many warning. but simulator could be use.

PS: i'm not like the theme in this fremantle simulator.
 
Reply


 
Forum Jump


All times are GMT. The time now is 19:58.