summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/reference/ChangeLog1
-rw-r--r--docs/reference/gio/gio-sections.txt1
-rw-r--r--gio/ChangeLog8
-rw-r--r--gio/gfile.c30
-rw-r--r--gio/gfile.h4
-rw-r--r--gio/gio.symbols1
6 files changed, 45 insertions, 0 deletions
diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog
index ab426e21f..4100a0323 100644
--- a/docs/reference/ChangeLog
+++ b/docs/reference/ChangeLog
@@ -1,6 +1,7 @@
2008-07-02 Matthias Clasen <mclasen@redhat.com>
* gio/gio-sections.txt: Add g_desktop_app_info_new_from_keyfile
+ and g_file_monitor
2008-07-01 Matthias Clasen <mclasen@redhat.com>
diff --git a/docs/reference/gio/gio-sections.txt b/docs/reference/gio/gio-sections.txt
index 3e07ce9ab..52a148204 100644
--- a/docs/reference/gio/gio-sections.txt
+++ b/docs/reference/gio/gio-sections.txt
@@ -115,6 +115,7 @@ g_file_mount_enclosing_volume
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
diff --git a/gio/ChangeLog b/gio/ChangeLog
index 723a216a9..13ea0e3dd 100644
--- a/gio/ChangeLog
+++ b/gio/ChangeLog
@@ -1,5 +1,13 @@
2008-07-02 Matthias Clasen <mclasen@redhat.com>
+ Bug 536160 – Add g_file_monitor()
+
+ * gio.symbols:
+ * gfile.[hc]: Add g_file_monitor which can return either
+ a file or a directory monitor. Proposed by Behdad Esfahbod
+
+2008-07-02 Matthias Clasen <mclasen@redhat.com>
+
536733 – gio build failure on Irix
* glocalfile.c: Use a configure check for structfs.f_bavail.
diff --git a/gio/gfile.c b/gio/gfile.c
index da793d0bb..7ba610894 100644
--- a/gio/gfile.c
+++ b/gio/gfile.c
@@ -3896,6 +3896,36 @@ g_file_monitor_file (GFile *file,
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 *
********************************************/
diff --git a/gio/gfile.h b/gio/gfile.h
index 9bb5b4465..58b29923e 100644
--- a/gio/gfile.h
+++ b/gio/gfile.h
@@ -749,6 +749,10 @@ GFileMonitor* g_file_monitor_file (GFile
GFileMonitorFlags flags,
GCancellable *cancellable,
GError **error);
+GFileMonitor* g_file_monitor (GFile *file,
+ GFileMonitorFlags flags,
+ GCancellable *cancellable,
+ GError **error);
/* Utilities */
diff --git a/gio/gio.symbols b/gio/gio.symbols
index 6c5738ad0..9a890f460 100644
--- a/gio/gio.symbols
+++ b/gio/gio.symbols
@@ -300,6 +300,7 @@ g_file_eject_mountable_finish
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