Test whether a GFile is already mounted?



Hey,

let's say I want to browse for available hosts in a workgroup (smb), I
create a GFile and list its children, like:

file = g_file_new_for_uri("smb://workgroup");

enumeration = g_file_enumerate_children(file,
G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, G_FILE_QUERY_INFO_NONE, NULL,
&error);
...

To get this working, "smb://workgroup" must be mounted before.
So, I have to call g_file_mount_enclosing_volume() before enumerating
the children.

Is there any way to determine whether "smb://workgroup" was already
mounted before to save the attempt to mount it.
Or is just not necessary because g_file_mount_enclosing_volume() does
this implicitly without big performance loss?

Or am I doing something completely wrong?


Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc

Attachment: pgpddBGOcfk6P.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]