Complement to commit 'allow to delete all marked movies'

Origin commit data
------------------
Branch: ni/coolstream
Commit: d7c4335bff
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2015-09-29 (Tue, 29 Sep 2015)


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

------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2015-09-29 08:00:00 +02:00
committed by vanhofen
parent a483b5e187
commit 8d79a9931e

View File

@@ -1829,6 +1829,10 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg)
movielist.push_back(m_movieSelectionHandler); movielist.push_back(m_movieSelectionHandler);
} }
MI_MOVIE_LIST dellist;
MI_MOVIE_LIST::iterator dellist_it;
dellist.clear();
bool skipAsk = false;
for (filelist_it = filelist.begin(); filelist_it != filelist.end(); ++filelist_it) for (filelist_it = filelist.begin(); filelist_it != filelist.end(); ++filelist_it)
{ {
unsigned int idx = filelist_it - filelist.begin(); unsigned int idx = filelist_it - filelist.begin();
@@ -1837,7 +1841,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg)
if ((!m_vMovieInfo.empty()) && (movieinfo != NULL)) { if ((!m_vMovieInfo.empty()) && (movieinfo != NULL)) {
bool onDelete = true; bool onDelete = true;
bool skipAsk = false; skipAsk = false;
CRecordInstance* inst = CRecordManager::getInstance()->getRecordInstance(movieinfo->file.Name); CRecordInstance* inst = CRecordManager::getInstance()->getRecordInstance(movieinfo->file.Name);
if (inst != NULL) { if (inst != NULL) {
std::string delName = movieinfo->epgTitle; std::string delName = movieinfo->epgTitle;
@@ -1858,9 +1862,15 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg)
} }
} }
if (onDelete) if (onDelete)
onDeleteFile(movieinfo, skipAsk); dellist.push_back(*movieinfo);
} }
} }
if (!dellist.empty()) {
for (dellist_it = dellist.begin(); dellist_it != dellist.end(); ++dellist_it)
onDeleteFile((MI_MOVIE_INFO *)&(*dellist_it), skipAsk);
dellist.clear();
loadMovies();
}
} }
else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info)
{ {
@@ -2167,6 +2177,7 @@ void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk)
delete hintBox; delete hintBox;
g_RCInput->clearRCMsg(); g_RCInput->clearRCMsg();
#if 0
m_vMovieInfo.erase((std::vector<MI_MOVIE_INFO>::iterator)movieinfo); m_vMovieInfo.erase((std::vector<MI_MOVIE_INFO>::iterator)movieinfo);
TRACE("List size: %d\n", (int)m_vMovieInfo.size()); TRACE("List size: %d\n", (int)m_vMovieInfo.size());
@@ -2176,6 +2187,7 @@ void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk)
refreshLastRecordList(); refreshLastRecordList();
refreshMovieInfo(); refreshMovieInfo();
refresh(); refresh();
#endif
} }
} }