src/FindModal.cpp in capybara-webkit-1.3.0 vs src/FindModal.cpp in capybara-webkit-1.3.1

- old
+ new

@@ -3,27 +3,24 @@ #include "WebPage.h" #include "WebPageManager.h" #include "ErrorMessage.h" FindModal::FindModal(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) { - m_modalId = 0; } void FindModal::start() { - m_modalId = arguments()[0].toInt(); - if (page()->modalCount() < m_modalId) { - connect(page(), SIGNAL(modalReady(int)), SLOT(handleModalReady(int))); + if (page()->modalCount() == 0) { + connect(page(), SIGNAL(modalReady()), SLOT(handleModalReady())); } else { - handleModalReady(m_modalId); + handleModalReady(); } } -void FindModal::handleModalReady(int modalId) { - if (modalId == m_modalId) { - sender()->disconnect(SIGNAL(modalReady(int)), this, SLOT(handleModalReady(int))); - if (page()->modalMessage(m_modalId).isNull()) { - finish(false, new ErrorMessage("ModalNotFound", "")); - } else { - finish(true, page()->modalMessage(m_modalId)); - } +void FindModal::handleModalReady() { + sender()->disconnect(SIGNAL(modalReady()), this, SLOT(handleModalReady())); + QString message = page()->modalMessage(); + if (message.isNull()) { + finish(false, new ErrorMessage("ModalNotFound", "")); + } else { + finish(true, message); } }