diff --git a/.gitignore b/.gitignore index 6d780e9..8eb6cb8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /libkgapi-0.4.0.tar.bz2 +/libkgapi-0.4.1.tar.bz2 diff --git a/libkgapi-0.4.0-auth_token.patch b/libkgapi-0.4.0-auth_token.patch deleted file mode 100644 index d91c93d..0000000 --- a/libkgapi-0.4.0-auth_token.patch +++ /dev/null @@ -1,40 +0,0 @@ -commit 5c92e2fb5ced528a20fd1d8723fd7a8d7ba686a3 -Author: Dan Vrátil -Date: Wed Jun 6 00:36:46 2012 +0200 - - Parse OAuth code from page title instead of body - - The OAuth code used for obtaining access tokens is provided - in webpage as a string. The title is guaranteed not to change - syntax, while the body of the page, from which we were parsing the token - before, can change anytime, which breaks the authentication process. - - BUG: 301240 - FIXED-IN: 0.4.1 - -diff --git a/libkgapi/ui/authwidget_p.cpp b/libkgapi/ui/authwidget_p.cpp -index 57d914c..55e77cb 100644 ---- a/libkgapi/ui/authwidget_p.cpp -+++ b/libkgapi/ui/authwidget_p.cpp -@@ -147,13 +147,18 @@ void AuthWidgetPrivate::webviewFinished() - } - - if (url.host() == "accounts.google.com" && url.path() == "/o/oauth2/approval") { -- QWebElement el = webview->page()->mainFrame()->findFirstElement("textarea"); -- if (el.isNull()) { -+ QString title = webview->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(KGAPI::AuthError, i18n("Parsing token page failed.")); - return; - } - -- QString token = el.toInnerXml(); - if (token.isEmpty()) { - emitError(KGAPI::AuthError, i18n("Failed to obtain token.")); - return; diff --git a/libkgapi.spec b/libkgapi.spec index 913bbe9..ec3baf3 100644 --- a/libkgapi.spec +++ b/libkgapi.spec @@ -1,30 +1,25 @@ #%%global git_commit f18d699 Name: libkgapi -Version: 0.4.0 +Version: 0.4.1 #Release: 1.20120530git%%{git_commit}%%{?dist} -Release: 6%{?dist} +Release: 1%{?dist} Summary: Library to access to Google services Group: Development/Libraries License: GPLv2+ -#URL: http://projects.kde.org/libkgoogle -URL: http://www.progdan.cz/2012/05/libkgoogle-libkgapi +URL: https://projects.kde.org/projects/extragear/libs/%{name} # Package from git snapshots, create example: -# git clone git://anongit.kde.org/libkgoogle +# git clone git://anongit.kde.org/%%{name} # cd libkgoogle # git archive \\ # --format=tar.gz \\ -# --prefix=libkgoogle/ \\ -# -o ../libkgoogle-0.3.1-git754771b.tar.gz \\ +# --prefix=%%{name}/ \\ +# -o ../%%{name}-%%{version}-git%%{git_commit}.tar.gz \\ # master #Source0: %%{name}-%%{version}-git%%{git_commit}.tar.gz Source0: http://download.kde.org/stable/%{name}/%{version}/src/%{name}-%{version}.tar.bz2 -## upstream patches -# https://projects.kde.org/projects/kdereview/libkgoogle/repository/revisions/5c92e2fb5ced528a20fd1d8723fd7a8d7ba686a3 -Patch100: libkgapi-0.4.0-auth_token.patch - BuildRequires: kdepimlibs-devel BuildRequires: kdelibs4-devel BuildRequires: pkgconfig(QJson) @@ -54,7 +49,6 @@ resources. %prep %setup -q -%patch100 -p1 -b .auth_token %build mkdir -p %{_target_platform} @@ -86,6 +80,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform} %changelog +* Sat Aug 11 2012 Mario Santagiuliana <fedora@marionline.it> 0.4.1-1 +- Update to new version 0.4.1 + * Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild diff --git a/sources b/sources index 56fc45c..e79f26e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -90c44fd9456a6e34a8375f98250ad7cc libkgapi-0.4.0.tar.bz2 +b4cefa643e95f5670997b5001547988f libkgapi-0.4.1.tar.bz2