×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    32

    Harmattan DBUS problem...

    Hi guys,

    I want to capture the dbus signal which is emitted, when the N9 camera application is closed. This is my example code:

    Code:
    from PySide import QtCore
    from PySide.QtCore import QTimer
    
    class NewFotoCheck:
        def __init__(self):
    
            dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
            self.bus = dbus.SessionBus()
            try:
                # Get the remote object
                self.remote_object = self.bus.get_object('com.nokia.maemo.CameraService','/')
    
                # Get the remote interface for the remote object
                self.iface = dbus.Interface(self.remote_object, 'com.nokia.maemo.meegotouch.CameraInterface')
    
            except dbus.DBusException:
                print_exc()
                sys.exit(1)
    
            self.iface.connect_to_signal('cameraClosed', self.test_dbus)
    
        def test_dbus(self, arg1='', arg2=''):
            print "1,2 Test, 1,2 Test"
    
    
    if __name__ == '__main__':
        app = QtCore.QCoreApplication(sys.argv)
        start = NewFotoCheck()
        sys.exit(app.exec_())

    But my problem is the following: when I start the camera app the first time it works as expected and very well, but if I close the camera app (completely) and reopen it, it's not working. It seems that my code hang up or stop or something like this. Whats wrong?



    Very much thanks in advance!

    AlphaX2

  2. #2
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Harmattan DBUS problem...

    Hi,

    Hope you have already solved the problem with the dbus connection method - get_object(...)

    You can post the snippet here for others for future help, thanks in advance.

  3. #3
    Registered User
    Join Date
    Feb 2012
    Posts
    32

    Re: Harmattan DBUS problem...

    Jepp, it's solved and you are right, it's may be helpful.

    It needs only on line to be changed:

    Code:
                
    self.remote_object = self.bus.get_object('com.nokia.maemo.CameraService', '/', follow_name_owner_changes=true)
    AlphaX2

  4. #4
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Harmattan DBUS problem...

    Thanks AlphaX2!!

Similar Threads

  1. Problem running Qt Creator 2.4.1 on CentOS 5.8 - dbus
    By drappo in forum [Archived] Qt SDKs and Tools
    Replies: 1
    Last Post: 2012-05-08, 12:50
  2. Replies: 5
    Last Post: 2012-03-23, 12:49
  3. QtComponents with MeeGo Harmattan problem - InfoBanner
    By molbal in forum [Archived] Qt Quick
    Replies: 3
    Last Post: 2011-08-02, 19:41
  4. Demo dbus with mce
    By bs86 in forum Nokia N9
    Replies: 1
    Last Post: 2010-10-04, 18:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •