From d74f982adcbf9170b85e1e5bc17238eebbb47d1b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 29 Oct 2021 20:01:01 +0200 Subject: [PATCH] fb_generic: formatting getIconPath() using astyle Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4a7e0510eca4dfaf0b30a1f242ebea71cb068d64 Author: vanhofen Date: 2021-10-29 (Fri, 29 Oct 2021) Origin message was: ------------------ - fb_generic: formatting getIconPath() using astyle --- src/driver/fb_generic.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index c24ab3cfe..27a5d9142 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -698,7 +698,7 @@ void CFrameBuffer::setIconBasePath(const std::string & iconPath) std::string CFrameBuffer::getIconPath(std::string icon_name, std::string file_type) { - // why search when we have an absolut path ? + // why search when we have an absolut path? if (icon_name.find("/", 0) != std::string::npos) return icon_name; @@ -707,11 +707,14 @@ std::string CFrameBuffer::getIconPath(std::string icon_name, std::string file_ty std::string::size_type pos = icon_name.find_last_of("."); if (pos != std::string::npos && file_type.empty()) + { if (std::find(filetypes.begin(), filetypes.end(), icon_name.substr(pos)) != filetypes.end()) { - icon_name = path.substr(0,pos); - file_type = path.substr(pos+1); + icon_name = path.substr(0, pos); + file_type = path.substr(pos + 1); } + } + if (!file_type.empty()) { filetypes.clear(); @@ -726,9 +729,9 @@ std::string CFrameBuffer::getIconPath(std::string icon_name, std::string file_ty iconBasePath }; - for(unsigned int t=0; t