[Kde-hardware-devel] How to get Solid::Device having device path only

Ben Cooksley sourtooth at gmail.com
Thu Sep 17 07:18:46 CEST 2009


2009/9/17 Rafał Miłecki <zajec5 at gmail.com>:
> Hi,
>
> I play with kio_sysinfo, kdecore and kdelibs to get (un)mounting
> working "everywhere" (not just in DeviceNotifier).

Nice, this is something that was present in KDE 3 I believe.

>
> Could you help me getting Solid::Device when I have device path (ex.
> /dev/sdb1) only? Is this possible?
>
> I guess I've to use findDevicesFromQuery with some magic predicate,
> but don't know that predicate. Tried to browse results from
> http://lxr.kde.org/ident?i=listFromQuery but it didn't help.

You may wish to look at the Device Actions editor in System Settings,
which provides an interface to create Solid Predicates. It knows about
all possible combinations for devices. The types Storage Access,
Storage Drive and Storage Volume are likely to be most helpful, in
particular their properties.

Please make sure to use Trunk, since it is more enhanced compared to
the previous version.
Storage Access appears to have a property "File Path" which seems to
be what you are looking for.

However you may find that the Udi will be of more help

>
> --
> Rafał
> _______________________________________________
> Kde-hardware-devel mailing list
> Kde-hardware-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kde-hardware-devel
>

Ben


More information about the Kde-hardware-devel mailing list