From b7f6e8afb114db91240913c64a7d05c80b25d73f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 25 Dec 2019 23:07:04 +0100 Subject: [PATCH] moviebrowser: fix display of control chars in movieinfo Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ce11bd1fd884c12013cbefd50dc8bc8ebdda018f Author: vanhofen Date: 2019-12-25 (Wed, 25 Dec 2019) Origin message was: ------------------ - moviebrowser: fix display of control chars in movieinfo ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 12 +++++++++++- src/gui/moviebrowser/mb.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 7d2ccb2d9..25ca87e10 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3913,6 +3913,16 @@ bool CMovieBrowser::isFiltered(MI_MOVIE_INFO& movie_info) return (result); } +std::string CMovieBrowser::replaceInGUI(std::string text) +{ + std::string t(text); + + t = str_replace("\u000a", ", ", t); + t = str_replace("\u000d", ", ", t); + + return t; +} + bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM item, std::string* item_string) { #define MAX_STR_TMP 100 @@ -3947,7 +3957,7 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = movie_info.serieName; break; case MB_INFO_INFO1: // = 4, - *item_string = movie_info.epgInfo1; + *item_string = replaceInGUI(movie_info.epgInfo1); break; case MB_INFO_MAJOR_GENRE: // = 5, snprintf(str_tmp, sizeof(str_tmp),"%2d",movie_info.genreMajor); diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index af5fa972e..7cf213de5 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -373,6 +373,7 @@ class CMovieBrowser : public CMenuTarget, public CProgressSignals void showHelp(void); bool isFiltered(MI_MOVIE_INFO& movie_info); bool isParentalLock(MI_MOVIE_INFO& movie_info); + std::string replaceInGUI(std::string text); bool getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM item, std::string* item_string); void updateMovieSelection(void); void updateInfoSelection(void);