Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
fixed: ticket xbmc#10486 - [Python] xbmcgui ListItem thumbnailImage a…
Browse files Browse the repository at this point in the history
…nd 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
  • Loading branch information
spiff_ committed Oct 12, 2010
1 parent 124332c commit 6933fc7
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions xbmc/lib/libPython/xbmcmodule/listitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 6933fc7

Please sign in to comment.