From: Abdelrazak Younes Date: Thu, 5 Jun 2008 08:49:19 +0000 (+0000) Subject: * InsetInfo: use Application::iconName(). X-Git-Tag: 1.6.10~4500 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e0602189865d81a370b7b5059d58036dd34fcae5;p=features.git * InsetInfo: use Application::iconName(). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25140 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp index 0f7b2f46a1..271539b4b6 100644 --- a/src/insets/InsetInfo.cpp +++ b/src/insets/InsetInfo.cpp @@ -251,18 +251,12 @@ void InsetInfo::updateInfo() } case ICON_INFO: { FuncRequest func = lyxaction.lookupFunc(name_); - if (func.action == LFUN_UNKNOWN_ACTION) - break; - // We do not try to find icon for LFUN_MATH_* here because these icons are difficult - // to locate (see GuiToolbar.cpp) and if they are needed, they can be inserted more - // easily as mathed. - string name = lyxaction.getActionName(func.action); - if (!func.argument().empty()) { - name += " " + to_utf8(func.argument()); - name = subst(name, ' ', '_'); - } - FileName file = libFileSearch("images", name, "png"); - if (file.empty()) + docstring icon_name = theApp()->iconName(func, true); + //FIXME: We should use the icon directly instead of going through + // FileName. The code below won't work if the icon is embedded in the + // executable through the Qt resource system. + FileName file(to_utf8(icon_name)); + if (!file.exists()) break; InsetGraphicsParams igp; igp.filename = file;