[Xfce4-commits] <thunarx-python:master> Added set_emblem method to ThunarxFileInfo interface

Adam Plumb noreply at xfce.org
Thu May 27 18:14:21 CEST 2010


Updating branch refs/heads/master
         to cace9391e74fd578e4a77e1bfe430abfdc7e47e1 (commit)
       from fbc6677f65fe4bd3cd62f1efeb52d59a89a479c2 (commit)

commit cace9391e74fd578e4a77e1bfe430abfdc7e47e1
Author: Adam Plumb <adamplumb at gmail.com>
Date:   Wed Jan 20 13:49:47 2010 -0500

    Added set_emblem method to ThunarxFileInfo interface

 docs/documentation.py |    6 ++++++
 src/thunarx.override  |   26 ++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/docs/documentation.py b/docs/documentation.py
index 758530d..ab36874 100644
--- a/docs/documentation.py
+++ b/docs/documentation.py
@@ -120,6 +120,12 @@ class FileInfo:
         """
         pass
 
+    def set_emblem(self, emblem):
+        """
+        @type   emblem  string
+        """
+        pass
+
     def changed(self):
         pass
     
diff --git a/src/thunarx.override b/src/thunarx.override
index dd24652..be87b0f 100644
--- a/src/thunarx.override
+++ b/src/thunarx.override
@@ -370,3 +370,29 @@ _wrap_ThunarxRenamer__proxy_do_save(ThunarxRenamer  *self,
     Py_DECREF(py_self);
     pyg_gil_state_release(__py_state);
 }
+%%
+define ThunarxFileInfo.set_emblem args
+static PyObject *
+_wrap_thunarx_file_info_set_emblem(PyGObject *self, PyObject *args)
+{
+    gchar  *emblem;
+    gchar **emblem_names = NULL;
+    static GQuark thunar_file_emblem_names_quark;
+    
+    thunar_file_emblem_names_quark = g_quark_from_static_string ("thunar-file-emblem-names");
+    
+    if (!PyArg_ParseTuple(args, "z:ThunarxFileInfo.set_emblem", &emblem))
+        return;
+
+    if (emblem != NULL)
+    {
+        emblem = g_strconcat("emblem-", emblem);
+        emblem_names = g_strsplit (emblem, ";", -1);
+    }
+    
+    g_object_set_qdata_full (G_OBJECT (self->obj), thunar_file_emblem_names_quark,
+                                  emblem_names, (GDestroyNotify) g_strfreev);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}



More information about the Xfce4-commits mailing list