Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 19 lines (16 sloc) 0.537 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include "Find.h"
#include "SocketCommand.h"
#include "WebPage.h"
#include "WebPageManager.h"

Find::Find(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}

void Find::start() {
  QString message;
  QVariant result = page()->invokeCapybaraFunction("find", arguments());

  if (result.isValid()) {
    message = result.toString();
    emit finished(new Response(true, message));
  } else {
    emit finished(new Response(false, QString("Invalid XPath expression")));
  }
}
Something went wrong with that request. Please try again.