glib r7145 - in trunk: docs/reference docs/reference/gio gio
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: glib r7145 - in trunk: docs/reference docs/reference/gio gio
- Date: Wed, 2 Jul 2008 17:19:17 +0000 (UTC)
Author: matthiasc
Date: Wed Jul 2 17:19:16 2008
New Revision: 7145
URL: http://svn.gnome.org/viewvc/glib?rev=7145&view=rev
Log:
Add g_file_monitor
Modified:
trunk/docs/reference/ChangeLog
trunk/docs/reference/gio/gio-sections.txt
trunk/gio/ChangeLog
trunk/gio/gfile.c
trunk/gio/gfile.h
trunk/gio/gio.symbols
Modified: trunk/docs/reference/gio/gio-sections.txt
==============================================================================
--- trunk/docs/reference/gio/gio-sections.txt (original)
+++ trunk/docs/reference/gio/gio-sections.txt Wed Jul 2 17:19:16 2008
@@ -115,6 +115,7 @@
g_file_mount_enclosing_volume_finish
g_file_monitor_directory
g_file_monitor_file
+g_file_monitor
g_file_load_contents
g_file_load_contents_async
g_file_load_contents_finish
Modified: trunk/gio/gfile.c
==============================================================================
--- trunk/gio/gfile.c (original)
+++ trunk/gio/gfile.c Wed Jul 2 17:19:16 2008
@@ -3896,6 +3896,36 @@
return monitor;
}
+/**
+ * g_file_monitor:
+ * @file: input #GFile
+ * @flags: a set of #GFileMonitorFlags
+ * @cancellable: optional #GCancellable object, %NULL to ignore
+ * @error: a #GError, or %NULL
+ *
+ * Obtains a file or directory monitor for the given file, depending
+ * on the type of the file.
+ *
+ * If @cancellable is not %NULL, then the operation can be cancelled by
+ * triggering the cancellable object from another thread. If the operation
+ * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
+ *
+ * Returns: a #GFileMonitor for the given @file.
+ *
+ * Since: 2.18
+ */
+GFileMonitor*
+g_file_monitor (GFile *file,
+ GFileMonitorFlags flags,
+ GCancellable *cancellable,
+ GError **error)
+{
+ if (g_file_query_file_type (file, 0, cancellable) == G_FILE_TYPE_DIRECTORY)
+ return g_file_monitor_directory (file, flags, cancellable, error);
+ else
+ return g_file_monitor_file (file, flags, cancellable, error);
+}
+
/********************************************
* Default implementation of async ops *
********************************************/
Modified: trunk/gio/gfile.h
==============================================================================
--- trunk/gio/gfile.h (original)
+++ trunk/gio/gfile.h Wed Jul 2 17:19:16 2008
@@ -749,6 +749,10 @@
GFileMonitorFlags flags,
GCancellable *cancellable,
GError **error);
+GFileMonitor* g_file_monitor (GFile *file,
+ GFileMonitorFlags flags,
+ GCancellable *cancellable,
+ GError **error);
/* Utilities */
Modified: trunk/gio/gio.symbols
==============================================================================
--- trunk/gio/gio.symbols (original)
+++ trunk/gio/gio.symbols Wed Jul 2 17:19:16 2008
@@ -300,6 +300,7 @@
g_file_copy_attributes
g_file_monitor_directory
g_file_monitor_file
+g_file_monitor
g_file_query_default_handler
g_file_load_contents
g_file_load_contents_async
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]