From e71892d99cbe99e2335aa6eb3771ffbb72c5303f Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Thu, 19 Jun 2008 18:58:34 -0700 Subject: allow restart with no argument from fluxbox-remote --- src/FbCommands.cc | 9 ++++++++- src/FbCommands.hh | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/FbCommands.cc b/src/FbCommands.cc index e70cc61..8875ec2 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc @@ -243,7 +243,14 @@ void SaveResources::execute() { Fluxbox::instance()->save_rc(); } -REGISTER_UNTRUSTED_COMMAND_WITH_ARGS(restart, FbCommands::RestartFluxboxCmd, void); +REGISTER_COMMAND_PARSER(restart, RestartFluxboxCmd::parse, void); + +FbTk::Command *RestartFluxboxCmd::parse(const string &command, + const string &args, bool trusted) { + if (!trusted && !args.empty()) + return 0; + return new RestartFluxboxCmd(args); +} RestartFluxboxCmd::RestartFluxboxCmd(const string &cmd):m_cmd(cmd){ } diff --git a/src/FbCommands.hh b/src/FbCommands.hh index 811fb78..b6b1f7f 100644 --- a/src/FbCommands.hh +++ b/src/FbCommands.hh @@ -77,6 +77,8 @@ class RestartFluxboxCmd: public FbTk::Command { public: RestartFluxboxCmd(const std::string &cmd); void execute(); + static FbTk::Command *parse(const std::string &command, + const std::string &args, bool trusted); private: std::string m_cmd; }; -- cgit v0.11.2