Python plugin: Folder: Let path return the absolute path
authorHolger Berndt <hb@claws-mail.org>
Tue, 20 Aug 2013 19:30:50 +0000 (21:30 +0200)
committerHolger Berndt <hb@claws-mail.org>
Tue, 20 Aug 2013 19:30:50 +0000 (21:30 +0200)
src/plugins/python/foldertype.c

index 2a8c2e4..faf108c 100644 (file)
@@ -132,13 +132,6 @@ static PyObject* get_name(clawsmail_FolderObject *self, void *closure)
   Py_RETURN_NONE;
 }
 
-static PyObject* get_path(clawsmail_FolderObject *self, void *closure)
-{
-  if(self->folderitem && self->folderitem->path)
-    return PyString_FromString(self->folderitem->path);
-  Py_RETURN_NONE;
-}
-
 static PyObject* get_mailbox_name(clawsmail_FolderObject *self, void *closure)
 {
   if(self->folderitem && self->folderitem->folder && self->folderitem->folder->name)
@@ -169,6 +162,21 @@ static PyObject* get_identifier(clawsmail_FolderObject *self, void *closure)
   Py_RETURN_NONE;
 }
 
+static PyObject* get_path(clawsmail_FolderObject *self, void *closure)
+{
+  if(self->folderitem) {
+    gchar *path;
+    path = folder_item_get_path(self->folderitem);
+    if(path) {
+      PyObject *retval;
+      retval = PyString_FromString(path);
+      g_free(path);
+      return retval;
+    }
+  }
+  Py_RETURN_NONE;
+}
+
 
 static PyObject* get_properties(clawsmail_FolderObject *self, void *closure)
 {