allow restart with no argument from fluxbox-remote
Mark Tiefenbruck mark@fluxbox.org
2 files changed,
10 insertions(+),
1 deletions(-)
M
src/FbCommands.cc
→
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<void> *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){ }
M
src/FbCommands.hh
→
src/FbCommands.hh
@@ -77,6 +77,8 @@ class RestartFluxboxCmd: public FbTk::Command<void> {
public: RestartFluxboxCmd(const std::string &cmd); void execute(); + static FbTk::Command<void> *parse(const std::string &command, + const std::string &args, bool trusted); private: std::string m_cmd; };