Compare commits

...
This repository has been archived on 2026-01-16. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.

2 commits

Author SHA1 Message Date
Rex Dieter
56fd9c057d fix/rebase patch 2012-06-20 11:46:05 -05:00
Rex Dieter
053c2d0057 Parsing token page failed (kde#301240) 2012-06-20 11:23:36 -05:00
2 changed files with 39 additions and 5 deletions

View file

@ -0,0 +1,25 @@
diff -up akonadi-google/libkgoogle/authdialog.cpp.auth_token akonadi-google/libkgoogle/authdialog.cpp
--- akonadi-google/libkgoogle/authdialog.cpp.auth_token 2012-04-27 08:19:17.000000000 -0500
+++ akonadi-google/libkgoogle/authdialog.cpp 2012-06-20 11:44:03.179406253 -0500
@@ -102,13 +102,18 @@ void AuthDialog::webviewFinished()
}
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;

View file

@ -1,6 +1,6 @@
Name: akonadi-google
Version: 0.3.1
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Akonadi Resources for accessing Google services
License: GPLv3
@ -16,6 +16,10 @@ URL: http://projects.kde.org/akonadi-google
# master
Source0: akonadi-google-0.3.1.tar.gz
## backported upstream patches
# https://projects.kde.org/projects/kdereview/libkgoogle/repository/revisions/5c92e2fb5ced528a20fd1d8723fd7a8d7ba686a3
Patch100: akonadi-google-auth_token.patch
BuildRequires: cmake
BuildRequires: qt-devel
BuildRequires: kdepimlibs-devel
@ -24,7 +28,7 @@ BuildRequires: akonadi-devel
BuildRequires: qjson-devel
BuildRequires: libxslt-devel
Requires: libkgoogle = %{version}-%{release}
Requires: libkgoogle%{?_isa} = %{version}-%{release}
Requires: %{name}-calendar = %{version}-%{release}
Requires: %{name}-contacts = %{version}-%{release}
@ -44,13 +48,13 @@ Group: System Environment/Libraries
%package -n libkgoogle-devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: libkgoogle = %{version}-%{release}
Requires: libkgoogle%{?_isa} = %{version}-%{release}
%description -n libkgoogle-devel
Libraries and header files for developing applications that use %{name}.
%package calendar
Summary: Akonadi resource for Google Calendar and Tasks
Requires: libkgoogle = %{version}-%{release}
Requires: libkgoogle%{?_isa} = %{version}-%{release}
Obsoletes: akonadi-google-tasks < 0.3
Provides: akonadi-google-tasks = %{version}-%{release}
%description calendar
@ -58,13 +62,15 @@ Provides: akonadi-google-tasks = %{version}-%{release}
%package contacts
Summary: Akonadi resource for Google Contacts
Requires: libkgoogle = %{version}-%{release}
Requires: libkgoogle%{?_isa} = %{version}-%{release}
%description contacts
%{summary}.
%prep
%setup -q -n %{name}
%patch100 -p1 -b .auth_token
%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
@ -104,6 +110,9 @@ make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
%{_datadir}/akonadi/agents/googlecontactsresource.desktop
%changelog
* Wed Jun 20 2012 Rex Dieter <rdieter@fedoraproject.org> 0.3.1-2
- Parsing token page failed (kde#301240)
* Mon Apr 30 2012 Mario Santagiuliana <fedora@marionline.it> 0.3.1-1
- New version 0.3.1