new command to set offline-storage-path

master
Marc Wäckerlin 8 years ago
parent bb4e88fa3d
commit 9716b1dd1d
  1. 11
      ChangeLog
  2. 31
      src/commands.hxx

@ -1,3 +1,14 @@
2015-11-16 12:37 marc
* doc/doxyfile.in: SVG must not be interactive for embedding in
redmine
2015-11-09 22:33 marc
* ChangeLog, bootstrap.sh, src/commands.hxx, src/exceptions.hxx,
src/webpage.hxx: allow local storage; prevent crash if line is
missing
2015-11-07 10:47 marc
* bootstrap.sh, debian/control.in: there is no qt4-default

@ -2348,6 +2348,36 @@ class Echo: public Command {
QString _text;
};
class OfflineStoragePath: public Command {
public:
QString tag() const {
return "offline-storage-path";
}
QString description() const {
return
tag()+" <path>"
"\n\n"
"Set offline storage path. Defaults to /tmp.";
}
QString command() const {
return tag()+" "+_path;
}
std::shared_ptr<Command> parse(Script*, QString args,
QStringList&, QString, int, int) {
std::shared_ptr<OfflineStoragePath> cmd(new OfflineStoragePath());
cmd->_path = args;
return cmd;
}
bool execute(Script* script, QWebFrame* frame) {
Logger log(this, script);
TestWebPage* page(dynamic_cast<TestWebPage*>(frame->page()));
page->settings()->setOfflineStoragePath(_path);
return true;
}
private:
QString _path;
};
/* Template:
class : public Command {
public:
@ -2477,6 +2507,7 @@ inline void Script::initPrototypes() {
add(new Check);
add(new For);
add(new Echo);
add(new OfflineStoragePath);
}
#endif

Loading…
Cancel
Save