mirror of https://github.com/odrling/Aegisub
Make cmd::Command::name const
Originally committed to SVN as r5769.
This commit is contained in:
parent
4e1e68c88b
commit
7f7aba1bcf
|
@ -257,7 +257,7 @@ namespace Automation4 {
|
||||||
public:
|
public:
|
||||||
~LuaCommand();
|
~LuaCommand();
|
||||||
|
|
||||||
const char* name() { return cmd_name.c_str(); }
|
const char* name() const { return cmd_name.c_str(); }
|
||||||
wxString StrMenu(const agi::Context *) const { return display; }
|
wxString StrMenu(const agi::Context *) const { return display; }
|
||||||
wxString StrDisplay(const agi::Context *) const { return display; }
|
wxString StrDisplay(const agi::Context *) const { return display; }
|
||||||
wxString StrHelp() const { return help; }
|
wxString StrHelp() const { return help; }
|
||||||
|
|
|
@ -36,7 +36,7 @@ DEFINE_SIMPLE_EXCEPTION_NOINNER(CommandNotFound, CommandError, "command/notfound
|
||||||
DEFINE_SIMPLE_EXCEPTION_NOINNER(CommandIconNone, CommandError, "command/icon")
|
DEFINE_SIMPLE_EXCEPTION_NOINNER(CommandIconNone, CommandError, "command/icon")
|
||||||
DEFINE_SIMPLE_EXCEPTION_NOINNER(CommandIconInvalid, CommandError, "command/icon/invalid")
|
DEFINE_SIMPLE_EXCEPTION_NOINNER(CommandIconInvalid, CommandError, "command/icon/invalid")
|
||||||
|
|
||||||
#define CMD_NAME(a) const char* name() { return a; }
|
#define CMD_NAME(a) const char* name() const { return a; }
|
||||||
#define STR_MENU(a) wxString StrMenu(const agi::Context *) const { return a; }
|
#define STR_MENU(a) wxString StrMenu(const agi::Context *) const { return a; }
|
||||||
#define STR_DISP(a) wxString StrDisplay(const agi::Context *) const { return a; }
|
#define STR_DISP(a) wxString StrDisplay(const agi::Context *) const { return a; }
|
||||||
#define STR_HELP(a) wxString StrHelp() const { return a; }
|
#define STR_HELP(a) wxString StrHelp() const { return a; }
|
||||||
|
@ -86,7 +86,7 @@ namespace cmd {
|
||||||
class Command {
|
class Command {
|
||||||
public:
|
public:
|
||||||
/// Command name
|
/// Command name
|
||||||
virtual const char* name()=0;
|
virtual const char* name() const=0;
|
||||||
/// String for menu purposes including accelerators, but not hotkeys
|
/// String for menu purposes including accelerators, but not hotkeys
|
||||||
virtual wxString StrMenu(const agi::Context *) const=0;
|
virtual wxString StrMenu(const agi::Context *) const=0;
|
||||||
/// Plain string for display purposes; should normally be the same as StrMenu
|
/// Plain string for display purposes; should normally be the same as StrMenu
|
||||||
|
|
|
@ -124,7 +124,7 @@ class mru_wrapper : public T {
|
||||||
int id;
|
int id;
|
||||||
std::string full_name;
|
std::string full_name;
|
||||||
public:
|
public:
|
||||||
const char *name() { return full_name.c_str(); }
|
const char *name() const { return full_name.c_str(); }
|
||||||
void operator()(agi::Context *c) {
|
void operator()(agi::Context *c) {
|
||||||
T::operator()(c, id);
|
T::operator()(c, id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue