diff options
Diffstat (limited to 'zarb-ml/mageia-dev/attachments/20120610/530d3e57')
-rw-r--r-- | zarb-ml/mageia-dev/attachments/20120610/530d3e57/attachment-0001.obj | 34 | ||||
-rw-r--r-- | zarb-ml/mageia-dev/attachments/20120610/530d3e57/attachment.obj | 34 |
2 files changed, 68 insertions, 0 deletions
diff --git a/zarb-ml/mageia-dev/attachments/20120610/530d3e57/attachment-0001.obj b/zarb-ml/mageia-dev/attachments/20120610/530d3e57/attachment-0001.obj new file mode 100644 index 000000000..0fb6dac57 --- /dev/null +++ b/zarb-ml/mageia-dev/attachments/20120610/530d3e57/attachment-0001.obj @@ -0,0 +1,34 @@ +Index: a/libkgoogle/authdialog.cpp +=================================================================== +--- a/libkgoogle/authdialog.cpp ++++ b/libkgoogle/authdialog.cpp 2012-06-10 07:59:32.053613556 -0300 +@@ -102,13 +102,19 @@ + } + + if (url.host() == "accounts.google.com" && url.path() == "/o/oauth2/approval") { +- QWebElement el = m_webiew->page()->mainFrame()->findFirstElement("textarea"); +- if (el.isNull()) { ++ QString title = m_webiew->title(); ++ QString token; ++ ++ ++ if (title.startsWith(QLatin1String("success"), Qt::CaseInsensitive)) { ++ int pos = title.indexOf(QLatin1String("code=")); ++ /* Skip the 'code=' string as well */ ++ token = title.mid (pos + 5); ++ } else { + emitError(KGoogle::AuthError, i18n("Parsing token page failed.")); + return; + } + +- QString token = el.toInnerXml(); + if (token.isEmpty()) { + emitError(KGoogle::AuthError, i18n("Failed to obtain token.")); + return; +@@ -292,4 +298,4 @@ + { + m_username = QString(); + m_password = QString(); +-} +\ Pas de fin de ligne à la fin du fichier ++}
\ No newline at end of file diff --git a/zarb-ml/mageia-dev/attachments/20120610/530d3e57/attachment.obj b/zarb-ml/mageia-dev/attachments/20120610/530d3e57/attachment.obj new file mode 100644 index 000000000..0fb6dac57 --- /dev/null +++ b/zarb-ml/mageia-dev/attachments/20120610/530d3e57/attachment.obj @@ -0,0 +1,34 @@ +Index: a/libkgoogle/authdialog.cpp +=================================================================== +--- a/libkgoogle/authdialog.cpp ++++ b/libkgoogle/authdialog.cpp 2012-06-10 07:59:32.053613556 -0300 +@@ -102,13 +102,19 @@ + } + + if (url.host() == "accounts.google.com" && url.path() == "/o/oauth2/approval") { +- QWebElement el = m_webiew->page()->mainFrame()->findFirstElement("textarea"); +- if (el.isNull()) { ++ QString title = m_webiew->title(); ++ QString token; ++ ++ ++ if (title.startsWith(QLatin1String("success"), Qt::CaseInsensitive)) { ++ int pos = title.indexOf(QLatin1String("code=")); ++ /* Skip the 'code=' string as well */ ++ token = title.mid (pos + 5); ++ } else { + emitError(KGoogle::AuthError, i18n("Parsing token page failed.")); + return; + } + +- QString token = el.toInnerXml(); + if (token.isEmpty()) { + emitError(KGoogle::AuthError, i18n("Failed to obtain token.")); + return; +@@ -292,4 +298,4 @@ + { + m_username = QString(); + m_password = QString(); +-} +\ Pas de fin de ligne à la fin du fichier ++}
\ No newline at end of file |