Advertisement
Guest User

Obey-Kun

a guest
Oct 1st, 2009
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.28 KB | None | 0 0
  1. diff --git a/src/qwebplugins/clicktoflash/clicktoflash.cpp b/src/qwebplugins/clicktoflash/clicktoflash.cpp
  2. index 9c193b0..3cb085c 100644
  3. --- a/src/qwebplugins/clicktoflash/clicktoflash.cpp
  4. +++ b/src/qwebplugins/clicktoflash/clicktoflash.cpp
  5. @@ -123,7 +123,7 @@ void ClickToFlash::load(bool loadAll)
  6. QWebElement element;
  7. foreach (element, elements) {
  8. if (!loadAll) {
  9. - if (!element.evaluateJavaScript(QLatin1String("this.swapping")).toBool())
  10. + if (!element.scriptableProperty(QLatin1String("swapping")).toBool())
  11. continue;
  12. }
  13.  
  14. diff --git a/src/webview.cpp b/src/webview.cpp
  15. index 525413a..86fadc8 100644
  16. --- a/src/webview.cpp
  17. +++ b/src/webview.cpp
  18. @@ -431,10 +431,10 @@ void WebView::addSearchEngine()
  19. QUrl searchUrl(page()->mainFrame()->baseUrl().resolved(QUrl(formElement.attribute(QLatin1String("action")))));
  20. QMap<QString, QString> searchEngines;
  21. QList<QWebElement> inputFields = formElement.findAll(QLatin1String("input"));
  22. - foreach (QWebElement inputField, inputFields) {
  23. + foreach (const QWebElement &inputField, inputFields) {
  24. QString type = inputField.attribute(QLatin1String("type"), QLatin1String("text"));
  25. QString name = inputField.attribute(QLatin1String("name"));
  26. - QString value = inputField.evaluateJavaScript(QLatin1String("this.value")).toString();
  27. + QString value = inputField.scriptableProperty(QLatin1String("value")).toString();
  28.  
  29. if (type == QLatin1String("submit")) {
  30. searchEngines.insert(value, name);
  31. @@ -444,7 +444,7 @@ void WebView::addSearchEngine()
  32.  
  33. searchUrl.addQueryItem(name, value);
  34. } else if (type == QLatin1String("checkbox") || type == QLatin1String("radio")) {
  35. - if (inputField.evaluateJavaScript(QLatin1String("this.checked")).toBool()) {
  36. + if (inputField.scriptableProperty(QLatin1String("checked")).toBool()) {
  37. searchUrl.addQueryItem(name, value);
  38. }
  39. } else if (type == QLatin1String("hidden")) {
  40. @@ -453,9 +453,9 @@ void WebView::addSearchEngine()
  41. }
  42.  
  43. QList<QWebElement> selectFields = formElement.findAll(QLatin1String("select"));
  44. - foreach (QWebElement selectField, selectFields) {
  45. + foreach (const QWebElement &selectField, selectFields) {
  46. QString name = selectField.attribute(QLatin1String("name"));
  47. - int selectedIndex = selectField.evaluateJavaScript(QLatin1String("this.selectedIndex")).toInt();
  48. + int selectedIndex = selectField.scriptableProperty(QLatin1String("selectedIndex")).toInt();
  49. if (selectedIndex == -1)
  50. continue;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement