X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gio%2Fgunionvolumemonitor.c;h=93b74e5248c0e0b1d43c5ff6ad7884f3c709b979;hb=3751706729c090c34d59c5284c3f80063a337afc;hp=eeb4c5ffccc9aa9a6263de118a6e5aaaa3445024;hpb=85ef543166f81464323d083c9a21096cc634cad0;p=platform%2Fupstream%2Fglib.git diff --git a/gio/gunionvolumemonitor.c b/gio/gunionvolumemonitor.c index eeb4c5f..93b74e5 100644 --- a/gio/gunionvolumemonitor.c +++ b/gio/gunionvolumemonitor.c @@ -423,58 +423,9 @@ g_union_volume_monitor_remove_monitor (GUnionVolumeMonitor *union_monitor, static GType get_default_native_class (gpointer data) { - GNativeVolumeMonitorClass *klass, *native_class, **native_class_out; - const char *use_this; - GIOExtensionPoint *ep; - GIOExtension *extension; - GList *l; - - native_class_out = data; - - use_this = g_getenv ("GIO_USE_VOLUME_MONITOR"); - - /* Ensure vfs in modules loaded */ - _g_io_modules_ensure_loaded (); - - ep = g_io_extension_point_lookup (G_NATIVE_VOLUME_MONITOR_EXTENSION_POINT_NAME); - - native_class = NULL; - if (use_this) - { - extension = g_io_extension_point_get_extension_by_name (ep, use_this); - if (extension) - { - klass = G_NATIVE_VOLUME_MONITOR_CLASS (g_io_extension_ref_class (extension)); - if (G_VOLUME_MONITOR_CLASS (klass)->is_supported()) - native_class = klass; - else - g_type_class_unref (klass); - } - } - - if (native_class == NULL) - { - for (l = g_io_extension_point_get_extensions (ep); l != NULL; l = l->next) - { - extension = l->data; - klass = G_NATIVE_VOLUME_MONITOR_CLASS (g_io_extension_ref_class (extension)); - if (G_VOLUME_MONITOR_CLASS (klass)->is_supported()) - { - native_class = klass; - break; - } - else - g_type_class_unref (klass); - } - } - - if (native_class) - { - *native_class_out = native_class; - return G_TYPE_FROM_CLASS (native_class); - } - else - return G_TYPE_INVALID; + return _g_io_module_get_default_type (G_NATIVE_VOLUME_MONITOR_EXTENSION_POINT_NAME, + "GIO_USE_VOLUME_MONITOR", + G_STRUCT_OFFSET (GVolumeMonitorClass, is_supported)); } /* We return the class, with a ref taken.