/**
- * \file Toolbar_pimpl.C
+ * \file qt2/Toolbar_pimpl.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
#include "support/filetools.h"
#include "support/lstrings.h"
-#include "QtView.h"
-
-#include "Toolbar_pimpl.h"
+#include "ControlMath.h"
#include <boost/tuple/tuple.hpp>
+#include "QtView.h"
+#include "Toolbar_pimpl.h"
+
#include <qtoolbar.h>
#include <qcombobox.h>
#include <qtooltip.h>
{
FuncRequest f = lyxaction.retrieveActionArg(action);
- string xpm_name;
+ string fullname;
if (f.action == LFUN_INSERT_MATH && !f.argument.empty()) {
- xpm_name = "math/" + subst(f.argument.substr(1), ' ', '_');
+ fullname = find_xpm(f.argument.substr(1));
} else {
string const name = lyxaction.getActionName(f.action);
+ string xpm_name(name);
+
if (!f.argument.empty())
xpm_name = subst(name + ' ' + f.argument, ' ','_');
- else
- xpm_name = name;
+
+ fullname = LibFileSearch("images", xpm_name, "xpm");
}
- string fullname = LibFileSearch("images", xpm_name, "xpm");
if (!fullname.empty()) {
lyxerr[Debug::GUI] << "Full icon name is `"
- << fullname << "'" << endl;
+ << fullname << '\'' << endl;
return QPixmap(fullname.c_str());
}
- lyxerr << "Unable to find icon `" << xpm_name << "'" << endl;
+ lyxerr << "Unable to find icon `" << fullname << '\'' << endl;
fullname = LibFileSearch("images", "unknown", "xpm");
if (!fullname.empty()) {
lyxerr[Debug::GUI] << "Using default `unknown' icon"
- << endl;
+ << endl;
}
return QPixmap(fullname.c_str());
}
string const & name = _(tc[layout]->name());
- int i;
-
- for (i = 0; i < combo_->count(); ++i) {
+ int i = 0;
+ for (; i < combo_->count(); ++i) {
if (name == combo_->text(i).latin1())
break;
}