Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 20 lines (16 sloc) 0.644 kb
63366bf @jferris Implemented Node#text; refactored Node commands so that they can be easi...
jferris authored
1 #include "Node.h"
2 #include "WebPage.h"
f80125e @mhoran Pass the WebPageManager to each command
mhoran authored
3 #include "WebPageManager.h"
63366bf @jferris Implemented Node#text; refactored Node commands so that they can be easi...
jferris authored
4
95732ad @jferris Split Command into more abstract Command and concrete SocketCommand
jferris authored
5 Node::Node(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
63366bf @jferris Implemented Node#text; refactored Node commands so that they can be easi...
jferris authored
6 }
7
85dcc72 @jferris Pass command arguments to the constructor
jferris authored
8 void Node::start() {
9 QStringList functionArguments(arguments());
63366bf @jferris Implemented Node#text; refactored Node commands so that they can be easi...
jferris authored
10 QString functionName = functionArguments.takeFirst();
11 QVariant result = page()->invokeCapybaraFunction(functionName, functionArguments);
12 QString attributeValue = result.toString();
cc74875 @jferris Created a Response object for the success/message pair
jferris authored
13 emit finished(new Response(true, attributeValue));
63366bf @jferris Implemented Node#text; refactored Node commands so that they can be easi...
jferris authored
14 }
15
d9b1898 @jferris Command to enable a more useful debug log
jferris authored
16 QString Node::toString() const {
17 QStringList functionArguments(arguments());
18 return QString("Node.") + functionArguments.takeFirst();
19 }
Something went wrong with that request. Please try again.