diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-04-14 13:46:12 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-04-14 13:46:12 +0000 |
commit | 1be510f9529cb082f802408b472a77d074b394c0 (patch) | |
tree | b175f9d5fcb107576dabc768e7bd04d4a3e491a0 /zarb-ml/mageia-dev/attachments/20120610/530d3e57 | |
parent | fa5098cf210b23ab4f419913e28af7b1b07dafb2 (diff) | |
download | archives-master.tar archives-master.tar.gz archives-master.tar.bz2 archives-master.tar.xz archives-master.zip |
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 |