aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspiff_ <spiff_@svn>2010-10-12 21:50:59 +0000
committerspiff_ <spiff_@svn>2010-10-12 21:50:59 +0000
commit6933fc79f42ee2d8ae7c3ce5724119556b4eb440 (patch)
tree36364a7bb87163275f45fa73499abae7ca014dfe
parent124332c06b8e3a5b5927d895ce0c436d4a06c7eb (diff)
fixed: ticket #10486 - [Python] xbmcgui ListItem thumbnailImage and iconImage should accept unicode
(cherry picked from commit 919de574a378f1d037ab7a0d4bb2a96bbcff10a7) git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/Dharma@34718 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r--xbmc/lib/libPython/xbmcmodule/listitem.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/xbmc/lib/libPython/xbmcmodule/listitem.cpp b/xbmc/lib/libPython/xbmcmodule/listitem.cpp
index dbfa136445..984bfc6c49 100644
--- a/xbmc/lib/libPython/xbmcmodule/listitem.cpp
+++ b/xbmc/lib/libPython/xbmcmodule/listitem.cpp
@@ -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);