From ad6e5b2569dd9a2a497f77742ab384bc24c99d72 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 27 Mar 2022 22:06:29 +0200 Subject: [PATCH] Revert "plugins.cpp: fix show *_hint.svg" This reverts commit 6dfa04689c0de1b30e160bf48397531a378de54e. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f78f8cbd372b87c20232ebb82e8b319db7ee725c Author: vanhofen Date: 2022-03-27 (Sun, 27 Mar 2022) --- src/gui/plugins.cpp | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index 4c7eb6301..4a50b4ea1 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -198,8 +198,9 @@ bool CPlugins::parseCfg(plugin *plugin_data) plugin_data->integration = PLUGIN_INTEGRATION_DISABLED; plugin_data->hinticon = NEUTRINO_ICON_HINT_PLUGIN; - std::string hintIcon = ""; - std::string _hintIconfile = plugin_data->plugindir + "/" + plugin_data->filename + "_hint.png"; + std::string _hintIcon = plugin_data->plugindir + "/" + plugin_data->filename + "_hint.png"; + if (access(_hintIcon.c_str(), F_OK) == 0) + plugin_data->hinticon = _hintIcon; for (int i = 0; i < linecount; i++) { @@ -242,7 +243,7 @@ bool CPlugins::parseCfg(plugin *plugin_data) } else if (cmd == "hinticon") { - hintIcon = parm; + plugin_data->hinticon = parm; } else if (cmd == "type") { @@ -282,20 +283,9 @@ bool CPlugins::parseCfg(plugin *plugin_data) if (plugin_data->name.empty()) plugin_data->name = plugin_data->filename; - std::string _hintIconCfg = plugin_data->plugindir + "/" + hintIcon; - - if (!hintIcon.empty() && access((_hintIconCfg + ".svg").c_str() , F_OK) == 0) - { - plugin_data->hinticon = _hintIconCfg + ".svg"; - } - else if (!hintIcon.empty() && access((_hintIconCfg + ".png").c_str(), F_OK) == 0) - { - plugin_data->hinticon = _hintIconCfg + ".png"; - } - else if (access(_hintIconfile.c_str(), F_OK) == 0) - { - plugin_data->hinticon = _hintIconfile; - } + _hintIcon = plugin_data->plugindir + "/" + plugin_data->hinticon + ".png"; + if (access(_hintIcon.c_str(), F_OK) == 0) + plugin_data->hinticon = _hintIcon; overrideType(plugin_data, g_settings.plugins_disabled, P_TYPE_DISABLED) || overrideType(plugin_data, g_settings.plugins_game, P_TYPE_GAME) ||