2011-02-25 23:39:29 -05:00
|
|
|
#include "Node.h"
|
|
|
|
#include "WebPage.h"
|
2012-04-04 18:18:17 -04:00
|
|
|
#include "WebPageManager.h"
|
2011-02-25 23:39:29 -05:00
|
|
|
|
2012-07-08 15:04:30 -04:00
|
|
|
Node::Node(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
|
2011-02-25 23:39:29 -05:00
|
|
|
}
|
|
|
|
|
2012-03-16 19:58:58 -04:00
|
|
|
void Node::start() {
|
|
|
|
QStringList functionArguments(arguments());
|
2011-02-25 23:39:29 -05:00
|
|
|
QString functionName = functionArguments.takeFirst();
|
|
|
|
QVariant result = page()->invokeCapybaraFunction(functionName, functionArguments);
|
|
|
|
QString attributeValue = result.toString();
|
2012-12-12 01:47:54 -05:00
|
|
|
emitFinished(true, attributeValue);
|
2011-02-25 23:39:29 -05:00
|
|
|
}
|
|
|
|
|
2012-06-29 12:14:22 -04:00
|
|
|
QString Node::toString() const {
|
|
|
|
QStringList functionArguments(arguments());
|
|
|
|
return QString("Node.") + functionArguments.takeFirst();
|
|
|
|
}
|