From 8d79a9931e4a7ab379964c6c0e914ceba911a3e8 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 29 Sep 2015 08:00:00 +0200 Subject: [PATCH] Complement to commit 'allow to delete all marked movies' Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d7c4335bffb9a97d3748b8b2667124efe2b74ba2 Author: Michael Liebmann Date: 2015-09-29 (Tue, 29 Sep 2015) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 7bbd89e19..feb686899 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1829,6 +1829,10 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) 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) { unsigned int idx = filelist_it - filelist.begin(); @@ -1837,7 +1841,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) if ((!m_vMovieInfo.empty()) && (movieinfo != NULL)) { bool onDelete = true; - bool skipAsk = false; + skipAsk = false; CRecordInstance* inst = CRecordManager::getInstance()->getRecordInstance(movieinfo->file.Name); if (inst != NULL) { std::string delName = movieinfo->epgTitle; @@ -1858,9 +1862,15 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } } 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) { @@ -2167,6 +2177,7 @@ void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk) delete hintBox; g_RCInput->clearRCMsg(); +#if 0 m_vMovieInfo.erase((std::vector::iterator)movieinfo); TRACE("List size: %d\n", (int)m_vMovieInfo.size()); @@ -2176,6 +2187,7 @@ void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk) refreshLastRecordList(); refreshMovieInfo(); refresh(); +#endif } }