PDA

View Full Version : Connect to QTDbus on login - validity of interface.. QTDbus initialization bug???



noa l
9th January 2011, 10:06
Hi

I want to connect to a dbus interface when user login.

Basically - when doing login - it seems that it takes few seconds before the interface is valid, so if my application looks like this -> app1.cpp attached
And I have a "mine.sh" file in /etc/profile.d directory that contains the foloowing line:

/usr/bin/app1 noa0 &

Then when login, i get a /tmp/noa0 file with "no valid" result...

But if it the same application - I add "sleep (10)" before the QApplication constructor, I get "valid"...

So - it is only reasonable that I can have a loop that will sleep and try again to check for validity - right? well, wrong...
Apparently - after trying once and getting "not valid" -> i keep getting "no valid" no matter what.

Can someone shed light ? Is there soem "cleaning" that i need to do in order to be able to check for validity again in the same process ?

------
I wanted to try and bypass the probelm and tying the following:

See attached app2.cpp that recheck validity in different processes. Trying to run this application upon login will result with 4 files in /tmp diretory - the "noalseep1" contains "no valid" , and the rest contains "valid".

But it i remove the "sleep(30)" line (the line is marked wite *** noa ***), then all 4 files contain "not valid" status .. which strangely enough emplys that the first check somehow affects the others, only because they somehow run at the same time...

If I try to check again later on, i get a "valid" reuslt.


TIA

Noa