- webtv-setup: init filebrowser only if needed

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2018-09-21 18:18:50 +02:00
committed by Thilo Graf
parent aacca740d5
commit ac90cb5f17

View File

@@ -88,12 +88,6 @@ int CWebTVSetup::exec(CMenuTarget *parent, const std::string &actionKey)
} }
if (actionKey == "c" /* change */) if (actionKey == "c" /* change */)
{ {
CFileBrowser fileBrowser;
CFileFilter fileFilter;
fileFilter.addFilter("xml");
fileFilter.addFilter("tv");
fileFilter.addFilter("m3u");
fileBrowser.Filter = &fileFilter;
selected = m->getSelected(); selected = m->getSelected();
CMenuItem *item = m->getItem(selected); CMenuItem *item = m->getItem(selected);
CMenuForwarder *f = static_cast<CMenuForwarder *>(item); CMenuForwarder *f = static_cast<CMenuForwarder *>(item);
@@ -114,6 +108,12 @@ int CWebTVSetup::exec(CMenuTarget *parent, const std::string &actionKey)
} }
else else
{ {
CFileBrowser fileBrowser;
CFileFilter fileFilter;
fileFilter.addFilter("xml");
fileFilter.addFilter("tv");
fileFilter.addFilter("m3u");
fileBrowser.Filter = &fileFilter;
dirname = dirname.substr(0, dirname.rfind('/')); dirname = dirname.substr(0, dirname.rfind('/'));
if (fileBrowser.exec(dirname.c_str())) if (fileBrowser.exec(dirname.c_str()))