#include "config.h"
+#include "gioenumtypes.h"
#include "glocalfilemonitor.h"
#include "giomodule-priv.h"
#include "gioerror.h"
enum
{
PROP_0,
- PROP_FILENAME
+ PROP_FILENAME,
+ PROP_FLAGS
};
G_DEFINE_ABSTRACT_TYPE (GLocalFileMonitor, g_local_file_monitor, G_TYPE_FILE_MONITOR)
case PROP_FILENAME:
/* Do nothing */
break;
+ case PROP_FLAGS:
+ /* Do nothing as well */
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
GObjectClass *parent_class;
GLocalFileMonitor *local_monitor;
const gchar *filename = NULL;
+ GFileMonitorFlags flags = 0;
gint i;
klass = G_LOCAL_FILE_MONITOR_CLASS (g_type_class_peek (G_TYPE_LOCAL_FILE_MONITOR));
{
g_warn_if_fail (G_VALUE_HOLDS_STRING (construct_properties[i].value));
filename = g_value_get_string (construct_properties[i].value);
- break;
+ }
+ else 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);
}
}
g_warn_if_fail (filename != NULL);
local_monitor->filename = g_strdup (filename);
+ local_monitor->flags = flags;
return obj;
}
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));
}
static gpointer
monitor = NULL;
if (type != G_TYPE_INVALID)
- monitor = G_FILE_MONITOR (g_object_new (type, "filename", pathname, NULL));
+ monitor = G_FILE_MONITOR (g_object_new (type, "filename", pathname, "flags", flags, NULL));
else
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
_("Unable to find default local file monitor type"));