gui/filebrowser: don't show progressbar unless directories were added

Origin commit data
------------------
Branch: ni/coolstream
Commit: e98336658d
Author: martii <m4rtii@gmx.de>
Date: 2014-08-02 (Sat, 02 Aug 2014)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
martii
2014-08-02 16:34:29 +02:00
committed by [CST] Focus
parent 24f9a990b4
commit 29d571c988

View File

@@ -1060,13 +1060,16 @@ bool CFileBrowser::exec(const char * const dirname)
if(res && Multi_Select) if(res && Multi_Select)
{ {
CProgressWindow * progress = new CProgressWindow(); CProgressWindow * progress = NULL;
progress->setTitle(LOCALE_FILEBROWSER_SCAN);
progress->exec(NULL,"");
for(unsigned int i = 0; i < filelist.size();i++) for(unsigned int i = 0; i < filelist.size();i++)
if(filelist[i].Marked) if(filelist[i].Marked)
{ {
if(S_ISDIR(filelist[i].Mode)) { if(S_ISDIR(filelist[i].Mode)) {
if (!progress) {
progress = new CProgressWindow();
progress->setTitle(LOCALE_FILEBROWSER_SCAN);
progress->exec(NULL,"");
}
#ifdef ENABLE_INTERNETRADIO #ifdef ENABLE_INTERNETRADIO
if (m_Mode == ModeSC) if (m_Mode == ModeSC)
addRecursiveDir(&selected_filelist,filelist[i].Url, true, progress); addRecursiveDir(&selected_filelist,filelist[i].Url, true, progress);
@@ -1076,8 +1079,10 @@ bool CFileBrowser::exec(const char * const dirname)
} else } else
selected_filelist.push_back(filelist[i]); selected_filelist.push_back(filelist[i]);
} }
progress->hide(); if (progress) {
delete progress; progress->hide();
delete progress;
}
} }
return res; return res;