[nautilus-python] Implemented the NautilusInfoProvider.cancel_update() method



commit 560c639b095dcb3f9048e52cfab2402cf6607287
Author: Adam Plumb <adamplumb gmail com>
Date:   Tue Apr 27 13:29:13 2010 -0400

    Implemented the NautilusInfoProvider.cancel_update() method

 examples/documentation.py    |    8 ++++++++
 src/nautilus-python-object.c |   15 ++++++++++++++-
 2 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/examples/documentation.py b/examples/documentation.py
index 940c67e..a93b37d 100644
--- a/examples/documentation.py
+++ b/examples/documentation.py
@@ -70,6 +70,14 @@ class InfoProvider:
         as a parameter.
         """
 
+    def cancel_update(self, handle):
+        """
+        @param  handle  unique handle for determining which file update call
+                        has been canceled
+        @type   handle  gpointer
+
+        """
+
     def update_complete_invoke(self, info):
         """
         @param  info    unique data for each update_file_info call
diff --git a/src/nautilus-python-object.c b/src/nautilus-python-object.c
index 329f4fb..3967e75 100644
--- a/src/nautilus-python-object.c
+++ b/src/nautilus-python-object.c
@@ -357,7 +357,20 @@ static void
 nautilus_python_object_cancel_update (NautilusInfoProvider 		*provider,
 									  NautilusOperationHandle 	*handle)
 {
+	NautilusPythonObject *object = (NautilusPythonObject*)provider;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+
   	debug_enter();
+
+	CHECK_OBJECT(object);
+	CHECK_METHOD_NAME(object->instance);
+
+    PyObject_CallMethod(object->instance,
+								 METHOD_PREFIX METHOD_NAME, "(N)",
+								 pyg_pointer_new(G_TYPE_POINTER, handle));
+
+ beach:
+	pyg_gil_state_release(state);
 }
 #undef METHOD_NAME
 
@@ -370,7 +383,7 @@ nautilus_python_object_update_file_info (NautilusInfoProvider 		*provider,
 {
 	NautilusPythonObject *object = (NautilusPythonObject*)provider;
     NautilusOperationResult ret = NAUTILUS_OPERATION_COMPLETE;
-    
+
     PyObject *py_ret = NULL;
 	PyGILState_STATE state = pyg_gil_state_ensure();                                    \
 	PyObject *info = NULL;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]