From 9716b1dd1d2b1adc77493f6aae8d16e812b04d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Mon, 21 Dec 2015 21:27:06 +0000 Subject: [PATCH] new command to set offline-storage-path --- ChangeLog | 11 +++++++++++ src/commands.hxx | 31 +++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/ChangeLog b/ChangeLog index 95e6057..f9a7fd2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/src/commands.hxx b/src/commands.hxx index f430ed1..852d3a9 100644 --- a/src/commands.hxx +++ b/src/commands.hxx @@ -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()+" " + "\n\n" + "Set offline storage path. Defaults to /tmp."; + } + QString command() const { + return tag()+" "+_path; + } + std::shared_ptr parse(Script*, QString args, + QStringList&, QString, int, int) { + std::shared_ptr cmd(new OfflineStoragePath()); + cmd->_path = args; + return cmd; + } + bool execute(Script* script, QWebFrame* frame) { + Logger log(this, script); + TestWebPage* page(dynamic_cast(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