Compare commits

..

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
5 changed files with 173 additions and 3 deletions

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
/akonadi-google-0.2-git11bf6ad.tar.gz
/akonadi-google-0.2-gitbe021c6.tar.gz
/akonadi-google-0.2-git41cd7c5.tar.gz
/akonadi-google-0.3-git3e0a93e.tar.gz
/akonadi-google-0.3.1.tar.gz

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;

142
akonadi-google.spec Normal file
View file

@ -0,0 +1,142 @@
Name: akonadi-google
Version: 0.3.1
Release: 2%{?dist}
Summary: Akonadi Resources for accessing Google services
License: GPLv3
URL: http://projects.kde.org/akonadi-google
# Package from git snapshots, create example:
# git clone git://anongit.kde.org/akonadi-google
# cd akonadi-google
# git archive \\
# --format=tar.gz \\
# --prefix=akonadi-google/ \\
# -o ../akonadi-google-0.2-git754771b.tar.gz \\
# 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
BuildRequires: kdelibs-devel
BuildRequires: akonadi-devel
BuildRequires: qjson-devel
BuildRequires: libxslt-devel
Requires: libkgoogle%{?_isa} = %{version}-%{release}
Requires: %{name}-calendar = %{version}-%{release}
Requires: %{name}-contacts = %{version}-%{release}
%{?_kde4_macros_api:Requires: kde4-macros(api) = %{_kde4_macros_api} }
%description
Akonadi Resources for accessing Google services, like Google Calendar, Google
Tasks and Google Contacts.
%package -n libkgoogle
Summary: Library to access to Google services
Group: System Environment/Libraries
%description -n libkgoogle
%{summary}.
%package -n libkgoogle-devel
Summary: Development files for %{name}
Group: Development/Libraries
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%{?_isa} = %{version}-%{release}
Obsoletes: akonadi-google-tasks < 0.3
Provides: akonadi-google-tasks = %{version}-%{release}
%description calendar
%{summary}.
%package contacts
Summary: Akonadi resource for Google Contacts
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}
%{cmake_kde4} ..
popd
make %{?_smp_mflags} -C %{_target_platform}
%install
rm -rf %{buildroot}
make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
%post -n libkgoogle -p /sbin/ldconfig
%postun -n libkgoogle -p /sbin/ldconfig
%files
%files -n libkgoogle
%doc README TODO CHANGELOG LICENSE
%{_libdir}/libkgoogle.so.0*
%files -n libkgoogle-devel
%{_kde4_includedir}/libkgoogle/*
%{_libdir}/pkgconfig/*.pc
%{_libdir}/*.so
%{_datadir}/kde4/apps/cmake/modules/FindLibKGoogle.cmake
%files calendar
%{_bindir}/akonadi_googlecalendar*
%{_datadir}/akonadi/agents/googlecalendarresource.desktop
%files contacts
%{_bindir}/akonadi_googlecontacts*
%{_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
* Thu Apr 01 2012 Mario Santagiuliana <fedora@marionline.it> 0.3-1.20120402git3e0a93e
- New version 0.3
- Update to git snapshot 3e0a93e1b24cd7b6e394cf76d153c428246f9fa9
- Obsolete akonadi-google-tasks
- Fix error in changelog
* Thu Mar 01 2012 Mario Santagiuliana <fedora@marionline.it> 0.2-12.20120301git41cd7c5
- Update to git snapshot 41cd7c5d6e9cfb62875fd21f8a920a235b7a7d9c
* Wed Jan 20 2012 Mario Santagiuliana <fedora@marionline.it> 0.2-11.20120121gitbe021c6
- Update to git snapshot be021c6f12e6804976dcac203a1864686a219c26
* Wed Jan 20 2012 Mario Santagiuliana <fedora@marionline.it> 0.2-10.20120120git11bf6ad
- Update spec file follow comment 1:
https://bugzilla.redhat.com/show_bug.cgi?id=783317#c1
- Update to git snapshot 11bf6ad40dd93eda1f880a99d592009ea3ff47ac
- Include LICENSE
* Thu Jan 19 2012 Mario Santagiuliana <fedora@marionline.it> 0.2-9.20120119git754771b
- Create spec file for Fedora Review
- Source package create from git snapshot 754771b6081b194aedf750fac76a9af2709a5de3
* Wed Nov 16 2011 Dan Vratil <dan@progdan.cz> 0.2-8.1
- Initial SPEC

View file

@ -1,3 +0,0 @@
Package is retired
Obsoleted by libkgapi and kdepim-runtime >= 4.8.80+

1
sources Normal file
View file

@ -0,0 +1 @@
917129191be3c4497afca33a877c12f3 akonadi-google-0.3.1.tar.gz