new command to set offline-storage-path
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user