Results 1 to 1 of 1

Thread: Connect to QTDbus on login - validity of interface.. QTDbus initialization bug???

  1. #1
    Join Date
    Dec 2010
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Connect to QTDbus on login - validity of interface.. QTDbus initialization bug???

    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
    Attached Files Attached Files

Similar Threads

  1. QtDBus Qt Creator
    By sngskunk in forum Qt Programming
    Replies: 2
    Last Post: 22nd August 2019, 08:15
  2. How do i connect to QDbus signal in QTDbus ?
    By noa l in forum Qt Programming
    Replies: 6
    Last Post: 19th December 2010, 14:31
  3. Help with QtDBus signals
    By zuck in forum Qt Programming
    Replies: 3
    Last Post: 20th May 2009, 05:33
  4. QtDBus on Windows
    By ManuMies in forum Qt Programming
    Replies: 9
    Last Post: 26th January 2009, 13:02
  5. cannot find -QtDBus
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 1st August 2007, 15:08

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.