Results 1 to 4 of 4

Thread: How to list the external devices using QT Dbus?

  1. #1
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question How to list the external devices using QT Dbus?

    I want to create a file dialog which can list the only external devices connected to the system,like USB.
    I am using QDBusAbstractInterface class. I am calling the function
    FindDeviceByCapability("storage"); but this function list me all the storage devices. But i am only interested in external USB devices. Is there some other parameter to pass.
    Also what i am getting as output is something like

    /org/freedesktop/Hal/devices/storage_serial_Kingston_DataTraveler_102_001372982 955A9C0E6C50103_0_0

    But i want the path of the mounted devices,so that when it is displayed in the file dialog user can browse it.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to list the external devices using QT Dbus?

    Have a look at fstab & getmntent.htm

    But even with those, it's going to be difficult to detect if a device is connected via USB or not, as to an application, it's transparent.

  3. #3
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to list the external devices using QT Dbus?

    Can't i do it with out using the unix system commands?

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to list the external devices using QT Dbus?

    Qt has no support for what you want to do, so you need to use OS-specific commands to do it.

Similar Threads

  1. Replies: 1
    Last Post: 13th December 2010, 22:58
  2. How to Display only external devices in QtFiledialog
    By vjsharma_30 in forum Qt Programming
    Replies: 6
    Last Post: 18th February 2010, 19:27
  3. External devices control
    By tiho_bg in forum Qt Programming
    Replies: 1
    Last Post: 29th October 2009, 07:48
  4. Using QImage/QPixmap with external capture devices
    By schan117 in forum Qt Programming
    Replies: 2
    Last Post: 11th September 2009, 10:30
  5. Qt 4.5.0 win opensource and <dbus/dbus.h>
    By YaK in forum Installation and Deployment
    Replies: 2
    Last Post: 22nd March 2009, 11:06

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.