fixed: ticket #10486 - [Python] xbmcgui ListItem thumbnailImage and iconImage should...
authorspiff_ <spiff_@svn>
Tue, 12 Oct 2010 21:50:59 +0000 (21:50 +0000)
committerspiff_ <spiff_@svn>
Tue, 12 Oct 2010 21:50:59 +0000 (21:50 +0000)
(cherry picked from commit 919de574a378f1d037ab7a0d4bb2a96bbcff10a7)

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/Dharma@34718 568bbfeb-2a22-0410-94d2-cc84cf5bfa90

xbmc/lib/libPython/xbmcmodule/listitem.cpp

index dbfa136..984bfc6 100644 (file)
@@ -246,14 +246,18 @@ namespace PYXBMC
 
   PyObject* ListItem_SetIconImage(ListItem *self, PyObject *args)
   {
-    char *cLine = NULL;
+    PyObject* unicodeLine = NULL;
     if (!self->item) return NULL;
 
-    if (!PyArg_ParseTuple(args, (char*)"s", &cLine)) return NULL;
+    if (!PyArg_ParseTuple(args, (char*)"O", &unicodeLine)) return NULL;
+
+    string utf8Line;
+    if (unicodeLine && !PyXBMCGetUnicodeString(utf8Line, unicodeLine, 1))
+      return NULL;
 
     // set label
     PyXBMCGUILock();
-    self->item->SetIconImage(cLine ? cLine : "");
+    self->item->SetIconImage(utf8Line);
     PyXBMCGUIUnlock();
 
     Py_INCREF(Py_None);
@@ -270,14 +274,18 @@ namespace PYXBMC
 
   PyObject* ListItem_SetThumbnailImage(ListItem *self, PyObject *args)
   {
-    char *cLine = NULL;
+    PyObject* unicodeLine = NULL;
     if (!self->item) return NULL;
 
-    if (!PyArg_ParseTuple(args, (char*)"s", &cLine)) return NULL;
+    if (!PyArg_ParseTuple(args, (char*)"O", &unicodeLine)) return NULL;
+
+    string utf8Line;
+    if (unicodeLine && !PyXBMCGetUnicodeString(utf8Line, unicodeLine, 1))
+      return NULL;
 
     // set label
     PyXBMCGUILock();
-    self->item->SetThumbnailImage(cLine ? cLine : "");
+    self->item->SetThumbnailImage(utf8Line);
     PyXBMCGUIUnlock();
 
     Py_INCREF(Py_None);