diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2009-02-19 13:57:54 +0100 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2009-02-19 13:57:54 +0100 |
| commit | 0abd3c974bc5f2c79948972a3f10f6c968e42016 (patch) | |
| tree | 1ca153b818ac1a550617ad02a9a61ab14a4b7942 /lib | |
| parent | 44fd8be83300affa4321aded6f5734f3b6f2001b (diff) | |
| download | enigma2-0abd3c974bc5f2c79948972a3f10f6c968e42016.tar.gz enigma2-0abd3c974bc5f2c79948972a3f10f6c968e42016.zip | |
allow {text,pixmap}=None, without warning or error, to allow more flexible layout options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gui/elistboxcontent.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp index 44973af7..bf183f99 100644 --- a/lib/gui/elistboxcontent.cpp +++ b/lib/gui/elistboxcontent.cpp @@ -779,6 +779,10 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c if (PyInt_Check(pstring) && data) /* if the string is in fact a number, it refers to the 'data' list. */ pstring = PyTuple_GetItem(data, PyInt_AsLong(pstring)); + /* don't do anything if we have 'None' as string */ + if (pstring == Py_None) + continue; + const char *string = (PyString_Check(pstring)) ? PyString_AsString(pstring) : "<not-a-string>"; int x = PyInt_AsLong(px) + offset.x(); int y = PyInt_AsLong(py) + offset.y(); @@ -945,6 +949,10 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c if (PyInt_Check(ppixmap) && data) /* if the pixemap is in fact a number, it refers to the 'data' list. */ ppixmap = PyTuple_GetItem(data, PyInt_AsLong(ppixmap)); + /* don't do anything if we have 'None' as pixmap */ + if (ppixmap == Py_None) + continue; + int x = PyInt_AsLong(px) + offset.x(); int y = PyInt_AsLong(py) + offset.y(); int width = PyInt_AsLong(pwidth); |
