MhpApplicationMenuItem::MhpApplicationMenuItem(ApplicationInfo::cApplication::Ptr a) : app(a) { char *buffer = NULL;  const char *name; if (app->GetNumberOfNames()) name=app->GetName(0)->name.c_str(); else name=tr("<No name available>");  if (app->GetTransportProtocol()->GetProtocol() == ApplicationInfo::cTransportProtocol::Local) asprintf(&buffer, "%s", name); else { cChannel *chan=app->GetChannel(); asprintf(&buffer, "%s - %s", chan ? chan->Name() : tr("Unknown channel"), name); }  SetText(buffer,false); }
class MhpApplicationMenuItem : public cOsdItem { public: MhpApplicationMenuItem(ApplicationInfo::cApplication::Ptr a, bool selectable = true); ApplicationInfo::cApplication::Ptr GetApplication() { return app; } private: ApplicationInfo::cApplication::Ptr app; };
MhpApplicationMenuItem::MhpApplicationMenuItem(ApplicationInfo::cApplication::Ptr a) : app(a) {   char *buffer = NULL;      const char *name;   if (app->GetNumberOfNames())      name=app->GetName(0)->name.c_str();   else      name=tr("<No name available>");         if (app->GetTransportProtocol()->GetProtocol() == ApplicationInfo::cTransportProtocol::Local)      asprintf(&buffer, "%s", name);   else {      cChannel *chan=app->GetChannel();      asprintf(&buffer, "%s - %s", chan ? chan->Name() : tr("Unknown channel"), name);   }      SetText(buffer,false);}