I stumbled across a small block on the road. Apparently there is no neat way to get the "type" of storage device in GIO from a gio.Drive or gio.Volume. It can certainly give me the right icon, but for some reasson the categorizing logic is not exposed as public API.
Not having the storage type in the log would suck pretty bad. Without it we can only show a dialog like:
In order to open the file foobar.jpg please insert the volume FOOBAR
Which seems pretty useless to me. If we had proper storage types stored then we could say:
In order to open the file foobar.jpg please insert the CD labelled FOOBAR
The solutions:
1) Implement our own heuristics via *ugly* hacks. Like inferring the type from the icon name (volume.get_icon().to_string())
2) Get the entry under /dev/* and figure out what it is
3) Patch GIO
The purist in me would dive directly at 3). But depending on a trunk GLIB is a big one to swallow for new coming devs... Any ideas?
I stumbled across a small block on the road. Apparently there is no neat way to get the "type" of storage device in GIO from a gio.Drive or gio.Volume. It can certainly give me the right icon, but for some reasson the categorizing logic is not exposed as public API.
Not having the storage type in the log would suck pretty bad. Without it we can only show a dialog like:
In order to open the file foobar.jpg please insert the volume FOOBAR
Which seems pretty useless to me. If we had proper storage types stored then we could say:
In order to open the file foobar.jpg please insert the CD labelled FOOBAR
The solutions: get_icon( ).to_string( ))
1) Implement our own heuristics via *ugly* hacks. Like inferring the type from the icon name (volume.
2) Get the entry under /dev/* and figure out what it is
3) Patch GIO
The purist in me would dive directly at 3). But depending on a trunk GLIB is a big one to swallow for new coming devs... Any ideas?