diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-06-20 01:58:34 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-06-20 01:58:34 (GMT) |
commit | e71892d99cbe99e2335aa6eb3771ffbb72c5303f (patch) | |
tree | e2250aa3f12c0019911e366c660dbfa0e285e8a5 /src | |
parent | 2cdb04cc1e33308d6a414f792093bf4abf6b9f93 (diff) | |
download | fluxbox_paul-e71892d99cbe99e2335aa6eb3771ffbb72c5303f.zip fluxbox_paul-e71892d99cbe99e2335aa6eb3771ffbb72c5303f.tar.bz2 |
allow restart with no argument from fluxbox-remote
Diffstat (limited to 'src')
-rw-r--r-- | src/FbCommands.cc | 9 | ||||
-rw-r--r-- | src/FbCommands.hh | 2 |
2 files changed, 10 insertions, 1 deletions
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() { | |||
243 | Fluxbox::instance()->save_rc(); | 243 | Fluxbox::instance()->save_rc(); |
244 | } | 244 | } |
245 | 245 | ||
246 | REGISTER_UNTRUSTED_COMMAND_WITH_ARGS(restart, FbCommands::RestartFluxboxCmd, void); | 246 | REGISTER_COMMAND_PARSER(restart, RestartFluxboxCmd::parse, void); |
247 | |||
248 | FbTk::Command<void> *RestartFluxboxCmd::parse(const string &command, | ||
249 | const string &args, bool trusted) { | ||
250 | if (!trusted && !args.empty()) | ||
251 | return 0; | ||
252 | return new RestartFluxboxCmd(args); | ||
253 | } | ||
247 | 254 | ||
248 | RestartFluxboxCmd::RestartFluxboxCmd(const string &cmd):m_cmd(cmd){ | 255 | RestartFluxboxCmd::RestartFluxboxCmd(const string &cmd):m_cmd(cmd){ |
249 | } | 256 | } |
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<void> { | |||
77 | public: | 77 | public: |
78 | RestartFluxboxCmd(const std::string &cmd); | 78 | RestartFluxboxCmd(const std::string &cmd); |
79 | void execute(); | 79 | void execute(); |
80 | static FbTk::Command<void> *parse(const std::string &command, | ||
81 | const std::string &args, bool trusted); | ||
80 | private: | 82 | private: |
81 | std::string m_cmd; | 83 | std::string m_cmd; |
82 | }; | 84 | }; |