enum
{
PROP_0,
- PROP_DIRNAME
+ PROP_DIRNAME,
+ PROP_FLAGS
};
static gboolean g_local_directory_monitor_cancel (GFileMonitor *monitor);
case PROP_DIRNAME:
/* Do nothing */
break;
+ case PROP_FLAGS:
+ /* Do nothing */
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
GLocalDirectoryMonitorClass *klass;
GObjectClass *parent_class;
GLocalDirectoryMonitor *local_monitor;
+ GFileMonitorFlags flags = 0;
const gchar *dirname = NULL;
gint i;
{
g_warn_if_fail (G_VALUE_HOLDS_STRING (construct_properties[i].value));
dirname = g_value_get_string (construct_properties[i].value);
- break;
+ }
+ if (strcmp ("flags", g_param_spec_get_name (construct_properties[i].pspec)) == 0)
+ {
+ g_warn_if_fail (G_VALUE_HOLDS_FLAGS (construct_properties[i].value));
+ flags = g_value_get_flags (construct_properties[i].value);
}
}
local_monitor->dirname = g_strdup (dirname);
+ local_monitor->flags = flags;
- if (!klass->mount_notify)
+ if (!klass->mount_notify &&
+ (flags & G_FILE_MONITOR_WATCH_MOUNTS))
{
#ifdef G_OS_WIN32
/*claim everything was mounted */
G_PARAM_CONSTRUCT_ONLY|
G_PARAM_WRITABLE|
G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
+ g_object_class_install_property (gobject_class,
+ PROP_FLAGS,
+ g_param_spec_flags ("flags",
+ P_("Monitor flags"),
+ P_("Monitor flags"),
+ G_TYPE_FILE_MONITOR_FLAGS,
+ 0,
+ G_PARAM_CONSTRUCT_ONLY|
+ G_PARAM_WRITABLE|
+ G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
klass->mount_notify = FALSE;
}
monitor = NULL;
if (type != G_TYPE_INVALID)
- monitor = G_FILE_MONITOR (g_object_new (type, "dirname", dirname, NULL));
+ monitor = G_FILE_MONITOR (g_object_new (type, "dirname", dirname, "flags", flags, NULL));
else
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
_("Unable to find default local directory monitor type"));