add support for listing satellites and providers
[enigma2.git] / lib / service / listboxservice.cpp
index e336dc175dc670291d1bcd5f959d1f88a7b1c7f2..0b2e621c5ca2fedf24dd0183e5609a2aac851d47 100644 (file)
@@ -55,8 +55,18 @@ int eListboxServiceContent::getNextBeginningWithChar(char c)
                m_service_center->info(*i, service_info);
                service_info->getName(*i, text);
 //             printf("%c\n", text.c_str()[0]);
-               if (text.c_str()[0] == c)
-                       return index;
+               int idx=0;
+               int len=text.length();
+               while ( idx <= len )
+               {
+                       char cc = text[idx++];
+                       if ( cc >= 33 && cc < 127)
+                       {
+                               if (cc == c)
+                                       return index;
+                               break;
+                       }
+               }
        }
        return 0;
 }
@@ -142,8 +152,8 @@ void eListboxServiceContent::setElementFont(int element, gFont *font)
 void eListboxServiceContent::sort()
 {
        ePtr<iListableService> lst;
-  if (!m_service_center->list(m_root, lst))
-  {
+       if (!m_service_center->list(m_root, lst))
+       {
                m_list.sort(iListableServiceCompare(lst));
                        /* FIXME: is this really required or can we somehow keep the current entry? */
                cursorHome();
@@ -288,7 +298,6 @@ int eListboxServiceContent::cursorSet(int n)
 {
        cursorHome();
        cursorMove(n);
-       
        return 0;
 }