PDA

View Full Version : DBus daemon not starting



Khal Drogo
4th August 2008, 13:02
Greetings.

Excuse me if i posted this question in the wrong place.
I've been using the DBus windows port provided by winkde.org.

I added the dll's and the several exe's and configuration files that come along with the package to the qt bin directory.

dbus-launch.exe --com.something.nice works perfectly, when i start it from the qt bin directory.

However, when i move the package to a new directory (the same my own exe is, i want to run dbus-launch at startup with a qprocess from my application) the dbus daemon is not started.

What can be the problem?

Thank you.

jacek
5th August 2008, 00:11
It might be missing some libraries that were present in the previous directory.

Khal Drogo
5th August 2008, 06:29
Thanks for taking the time to read through and respond, however, that does not solve the problem.
Subsequently, i tried copying the entire qt bin directory to another location and start it from there, still unsuccessfully.
There might be some settings, dependencies, etc. which i'm not aware of?

jacek
5th August 2008, 15:10
If not the libs, then maybe it needs some plugins?

wysota
5th August 2008, 18:50
Thanks for taking the time to read through and respond, however, that does not solve the problem.
Subsequently, i tried copying the entire qt bin directory to another location and start it from there, still unsuccessfully.
There might be some settings, dependencies, etc. which i'm not aware of?

Did you try using a dependency walker?


If not the libs, then maybe it needs some plugins?

I don't think DBus has any (mandatory) plugins.

Khal Drogo
7th August 2008, 15:12
Yes i've tried using a dependancy walker, everything needed was there.

(btw. the port is here: http://winkde.org/pub/kde/ports/win32/repository/win32libs/ )

Maybe someone who used DBus under windows can tell me what are the must-needed files to run dbus-daemon from command prompt from a particular location? eg. E:/Deploy/PR1
I would appreciate it very much.

I have another DBus related question. Please advise whether i should make a new thread about this.
I intend to use a signal like the following with DBus:

void start(int id, const QString &name, Stuff stuff);

The structure Stuff:

typedef struct
{
QString a;
QString b;
MY_TYPE type;
} Stuff;

I used dbusxml2cpp to achieve my needed interface and adaptor files. My problem is, that the slot connected to this signal does not get called. The problem must lie somewhere in the marshalling of my custom type, because the signal-slot mechanism through DBus works perfectly with Qt types.

I declared my struct and enum with Q_DECLARE_METATYPE. I also registered them on the DBus:

qDBusRegisterMetaType<Stuff>();
qDBusRegisterMetaType<MY_TYPE>();

I've also overridden the QDBusArgument << and >> operators, thusly:

QDBusArgument &operator << (QDBusArgument &arg, const Stuff& stuff)
{
arg.beginStructure();
arg << stuff.a << stuff.b << stuff.type;
arg.endStructure();

return arg;
}

QDBusArgument &operator << (QDBusArgument &arg, const MY_TYPE& ct)
{
arg.beginStructure();
arg << static_cast<int>(ct);
arg.endStructure();

return arg;
}
Similarly, the other way around.

I am trying to emit a signal the following way:

QDBusMessage msg;

msg = QDBusMessage::createSignal("/Pr1", "com.trolltech.pr1", "start");
msg << m_ID;
msg << m_name;
msg << QVariant::fromValue<Stuff>(m_stuff);

QDBusConnection::sessionBus().send(msg);

The slot in my other process doesn't get called.

What did i miss/done wrong?

Thanks in advance, there isn't an abundance of info or examples for using custom types with DBus, so i would appreciate any assistance.