Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDE PIM Runtime
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
KDE PIM Runtime
Commits
73bd7e57
Commit
73bd7e57
authored
Jun 26, 2014
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it compile
parent
ebe6da2a
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
117 additions
and
111 deletions
+117
-111
resources/CMakeLists.txt
resources/CMakeLists.txt
+6
-6
resources/gmail/CMakeLists.txt
resources/gmail/CMakeLists.txt
+4
-10
resources/gmail/gmailchangeitemslabelstask.cpp
resources/gmail/gmailchangeitemslabelstask.cpp
+3
-3
resources/gmail/gmailconfigdialog.cpp
resources/gmail/gmailconfigdialog.cpp
+4
-4
resources/gmail/gmailconfigdialog.h
resources/gmail/gmailconfigdialog.h
+1
-1
resources/gmail/gmaillabelattribute.h
resources/gmail/gmaillabelattribute.h
+1
-1
resources/gmail/gmaillinkitemstask.cpp
resources/gmail/gmaillinkitemstask.cpp
+8
-8
resources/gmail/gmaillinkitemstask.h
resources/gmail/gmaillinkitemstask.h
+1
-1
resources/gmail/gmailmessagehelper.cpp
resources/gmail/gmailmessagehelper.cpp
+1
-1
resources/gmail/gmailmessagehelper.h
resources/gmail/gmailmessagehelper.h
+1
-1
resources/gmail/gmailpasswordrequester.cpp
resources/gmail/gmailpasswordrequester.cpp
+9
-9
resources/gmail/gmailpasswordrequester.h
resources/gmail/gmailpasswordrequester.h
+1
-1
resources/gmail/gmailresource.cpp
resources/gmail/gmailresource.cpp
+14
-13
resources/gmail/gmailresource.h
resources/gmail/gmailresource.h
+1
-1
resources/gmail/gmailretrievecollectionstask.cpp
resources/gmail/gmailretrievecollectionstask.cpp
+9
-9
resources/gmail/gmailretrieveitemstask.cpp
resources/gmail/gmailretrieveitemstask.cpp
+5
-5
resources/gmail/gmailretrieveitemstask.h
resources/gmail/gmailretrieveitemstask.h
+2
-2
resources/gmail/gmailsettings.cpp
resources/gmail/gmailsettings.cpp
+7
-7
resources/gmail/gmailsettings.h
resources/gmail/gmailsettings.h
+1
-1
resources/gmail/saslplugin/CMakeLists.txt
resources/gmail/saslplugin/CMakeLists.txt
+10
-4
resources/google/calendar/CMakeLists.txt
resources/google/calendar/CMakeLists.txt
+4
-1
resources/google/calendar/defaultreminderattribute.cpp
resources/google/calendar/defaultreminderattribute.cpp
+9
-8
resources/google/common/googleresource.cpp
resources/google/common/googleresource.cpp
+7
-7
resources/google/contacts/CMakeLists.txt
resources/google/contacts/CMakeLists.txt
+2
-1
resources/google/contacts/contactsresource.cpp
resources/google/contacts/contactsresource.cpp
+4
-4
resources/google/contacts/contactsresource.h
resources/google/contacts/contactsresource.h
+2
-2
No files found.
resources/CMakeLists.txt
View file @
73bd7e57
...
...
@@ -41,10 +41,10 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${resources_SOURCE_DIR}")
endif
()
find_package
(
KF5Imap
${
KDEPIMLIBS_LIB_VERSION
}
CONFIG REQUIRED
)
find_package
(
KF5AkonadiCalendar
${
KDEPIMLIBS_LIB_VERSION
}
CONFIG REQUIRED
)
# Extra package
find_package
(
KF5GAPI
"4.
98
.0"
CONFIG
)
find_package
(
KF5GAPI
"4.
70
.0"
CONFIG
)
# Xsltproc
find_package
(
Xsltproc
)
...
...
@@ -126,10 +126,10 @@ add_subdirectory( openxchange )
add_subdirectory
(
pop3
)
#NEED TO REMOVE QSJON SUPPORT
#
if( KF5GAPI_FOUND )
#
add_subdirectory( google )
#
add_subdirectory( gmail )
#
endif()
if
(
KF5GAPI_FOUND
)
add_subdirectory
(
google
)
add_subdirectory
(
gmail
)
endif
()
#if( LibKFbAPI_FOUND )
# add_subdirectory( facebook )
...
...
resources/gmail/CMakeLists.txt
View file @
73bd7e57
add_subdirectory
(
saslplugin
)
# REACTIVATE IT
#add_subdirectory(saslplugin)
...
...
@@ -8,11 +9,9 @@ include_directories(
${
CMAKE_CURRENT_BINARY_DIR
}
/../imap
${
LibKGAPI2_INCLUDE_DIR
}
${
QT_QTDBUS_INCLUDE_DIR
}
${
QJSON_INCLUDE_DIR
}
${
qjson_INCLUDE_DIR
}
)
kde_enable_exceptions
()
########### next target ###############
...
...
@@ -36,18 +35,13 @@ kconfig_add_kcfg_files(gmailresource_SRCS settingsbase.kcfgc)
add_executable
(
akonadi_gmail_resource
${
gmailresource_SRCS
}
)
target_link_libraries
(
akonadi_gmail_resource
KF5::AkonadiCore
KF5::Imap
KF5::MailTransport
KF5::KIOCore
KF5::Mime
KF5::AkonadiMime
KF5::PimIdentities
${
LibKGAPI2_LIBRARY
}
${
QJSON_LIBRARIES
}
KF5::GAPICore
imapresource
folderarchivesettings
)
...
...
resources/gmail/gmailchangeitemslabelstask.cpp
View file @
73bd7e57
...
...
@@ -19,9 +19,9 @@
#include "gmailchangeitemslabelstask.h"
#include <KI
MAP
/Session>
#include <KI
MAP
/StoreJob>
#include <KI
MAP
/SelectJob>
#include <KI
map
/Session>
#include <KI
map
/StoreJob>
#include <KI
map
/SelectJob>
GmailChangeItemsLabelsTask
::
GmailChangeItemsLabelsTask
(
ResourceStateInterface
::
Ptr
resource
,
QObject
*
parent
)
...
...
resources/gmail/gmailconfigdialog.cpp
View file @
73bd7e57
...
...
@@ -27,10 +27,10 @@
#include <kpimidentities/identitymanager.h>
#include <kpimidentities/identitycombo.h>
#include <
akonadi
/resourcesettings.h>
#include <
AkonadiAgentBase
/resourcesettings.h>
#include <
libkgapi2
/account.h>
#include <
libkgapi2
/authjob.h>
#include <
kgapi
/account.h>
#include <
kgapi
/authjob.h>
#include <imap/imapaccount.h>
#include <imap/subscriptiondialog.h>
...
...
@@ -215,7 +215,7 @@ void GmailConfigDialog::slotManageSubscriptions()
QPointer
<
SubscriptionDialog
>
subscriptions
=
new
SubscriptionDialog
(
this
);
subscriptions
->
setCaption
(
i18n
(
"Serverside Subscription"
));
subscriptions
->
setWindowIcon
(
KIcon
(
QLatin1String
(
"network-server"
)));
subscriptions
->
setWindowIcon
(
QIcon
::
fromTheme
(
QLatin1String
(
"network-server"
)));
subscriptions
->
connectAccount
(
account
,
m_account
->
accessToken
());
m_subscriptionsChanged
=
subscriptions
->
isSubscriptionChanged
();
...
...
resources/gmail/gmailconfigdialog.h
View file @
73bd7e57
...
...
@@ -22,7 +22,7 @@
#include <KDialog>
#include <
LibKGAPI2
/Account>
#include <
KGAPI
/Account>
namespace
Ui
{
...
...
resources/gmail/gmaillabelattribute.h
View file @
73bd7e57
...
...
@@ -20,7 +20,7 @@
#ifndef GMAILLABELATTRIBUTE_H
#define GMAILLABELATTRIBUTE_H
#include <Akonadi/Attribute>
#include <Akonadi
Core
/Attribute>
#include <QByteArray>
class
GmailLabelAttribute
:
public
Akonadi
::
Attribute
...
...
resources/gmail/gmaillinkitemstask.cpp
View file @
73bd7e57
...
...
@@ -21,13 +21,13 @@
#include "gmailretrieveitemstask.h"
#include "gmailsettings.h"
#include <
akonadi/collectionpathresolver_p
.h>
#include <Akonadi/AgentBase>
#include <Akonadi/ItemFetchJob>
#include <Akonadi/ItemFetchScope>
#include <Akonadi/CollectionFetchJob>
#include <Akonadi/LinkJob>
#include <Akonadi/UnlinkJob>
#include <
AkonadiCore/collectionpathresolver
.h>
#include <Akonadi
AgentBase
/AgentBase>
#include <Akonadi
Core
/ItemFetchJob>
#include <Akonadi
Core
/ItemFetchScope>
#include <Akonadi
Core
/CollectionFetchJob>
#include <Akonadi
Core
/LinkJob>
#include <Akonadi
Core
/UnlinkJob>
#include <KLocalizedString>
...
...
@@ -122,7 +122,7 @@ void GmailLinkItemsTask::onLabelResolved(KJob *job)
const
QString
collectionName
=
resolver
->
property
(
COLLECTION_NAME_PROPERTY
).
toString
();
const
QByteArray
label
=
resolver
->
property
(
LABEL_PROPERTY
).
toByteArray
();
if
(
resolver
->
error
()
&&
resolver
->
collection
()
<
0
)
{
k
Warning
()
<<
"Failed to resolve collection ID for path"
<<
collectionName
<<
":"
<<
resolver
->
errorString
();
q
Warning
()
<<
"Failed to resolve collection ID for path"
<<
collectionName
<<
":"
<<
resolver
->
errorString
();
return
;
}
const
Akonadi
::
Collection
collection
(
resolver
->
collection
());
...
...
resources/gmail/gmaillinkitemstask.h
View file @
73bd7e57
...
...
@@ -23,7 +23,7 @@
#include <QObject>
#include <QMultiHash>
#include <Akonadi/Collection>
#include <Akonadi
Core
/Collection>
class
GmailRetrieveItemsTask
;
class
KJob
;
...
...
resources/gmail/gmailmessagehelper.cpp
View file @
73bd7e57
...
...
@@ -39,7 +39,7 @@ Akonadi::Item GmailMessageHelper::createItemFromMessage(KMime::Message::Ptr mess
{
Akonadi
::
Item
item
=
MessageHelper
::
createItemFromMessage
(
message
,
uid
,
size
,
attrs
,
flags
,
scope
,
ok
);
if
(
!
ok
)
{
k
Warning
()
<<
"Failed to read imap message"
;
q
Warning
()
<<
"Failed to read imap message"
;
return
item
;
}
...
...
resources/gmail/gmailmessagehelper.h
View file @
73bd7e57
...
...
@@ -22,7 +22,7 @@
#include <imap/messagehelper.h>
#include <Akonadi/Collection>
#include <Akonadi
Core
/Collection>
class
ResourceTask
;
...
...
resources/gmail/gmailpasswordrequester.cpp
View file @
73bd7e57
...
...
@@ -20,10 +20,10 @@
#include "gmailpasswordrequester.h"
#include "gmailsettings.h"
#include <
libkgapi2
/account.h>
#include <
libkgapi2
/authjob.h>
#include <
kgapi
/account.h>
#include <
kgapi
/authjob.h>
#include <
qjson/parser.h
>
#include <
QJsonDocument
>
#include <KDebug>
...
...
@@ -56,16 +56,16 @@ void GmailPasswordRequester::requestPassword(PasswordRequesterInterface::Request
bool
GmailPasswordRequester
::
isTokenExpired
(
const
QString
&
serverError
)
{
QJson
::
Parser
parser
;
QString
base64Error
=
serverError
.
mid
(
7
,
serverError
.
length
()
-
9
);
const
QByteArray
decoded
=
QByteArray
::
fromBase64
(
base64Error
.
toLatin1
());
bool
ok
=
false
;
const
QVariant
json
=
parser
.
parse
(
decoded
,
&
ok
);
if
(
!
ok
)
{
QJsonDocument
document
=
QJsonDocument
::
fromJson
(
decoded
);
if
(
document
.
isNull
())
{
return
false
;
}
const
QVariant
json
=
document
.
toVariant
();
if
(
!
json
.
isValid
())
{
return
false
;
}
const
QVariantMap
map
=
json
.
toMap
();
if
(
map
[
QLatin1String
(
"status"
)].
toString
().
toInt
()
==
KGAPI2
::
Unauthorized
)
{
return
true
;
...
...
resources/gmail/gmailpasswordrequester.h
View file @
73bd7e57
...
...
@@ -22,7 +22,7 @@
#include <imap/passwordrequesterinterface.h>
#include <
LibKGAPI2
/Types>
#include <
KGAPI
/Types>
class
GmailPasswordRequester
:
public
PasswordRequesterInterface
{
...
...
resources/gmail/gmailresource.cpp
View file @
73bd7e57
...
...
@@ -31,22 +31,23 @@
#include <KLocalizedString>
#include <KWindowSystem>
#include <Akonadi/LinkJob>
#include <Akonadi/CollectionFetchJob>
#include <
akonadi/collectionpathresolver_p
.h>
#include <Akonadi/ItemFetchJob>
#include <Akonadi/ItemFetchScope>
#include <Akonadi/AttributeFactory>
#include <Akonadi
Core
/LinkJob>
#include <Akonadi
Core
/CollectionFetchJob>
#include <
AkonadiCore/collectionpathresolver
.h>
#include <Akonadi
Core
/ItemFetchJob>
#include <Akonadi
Core
/ItemFetchScope>
#include <Akonadi
Core
/AttributeFactory>
#include <imap/sessionpool.h>
#include <imap/sessionuiproxy.h>
#include <KLocale>
#include <QIcon>
GmailResource
::
GmailResource
(
const
QString
&
id
)
:
ImapResourceBase
(
id
)
{
KGlobal
::
locale
()
->
insertCatalog
(
"akonadi_imap_resource"
);
//QT5
KGlobal::locale()->insertCatalog("akonadi_imap_resource");
setSeparatorCharacter
(
'/'
);
m_pool
->
setPasswordRequester
(
new
GmailPasswordRequester
(
m_pool
));
...
...
@@ -68,7 +69,7 @@ KDialog *GmailResource::createConfigureDialog(WId windowId)
{
GmailConfigDialog
*
dlg
=
new
GmailConfigDialog
(
this
,
windowId
);
KWindowSystem
::
setMainWindow
(
dlg
,
windowId
);
dlg
->
setWindowIcon
(
KIcon
(
QLatin1String
(
"network-server"
)));
dlg
->
setWindowIcon
(
QIcon
::
fromTheme
(
QLatin1String
(
"network-server"
)));
connect
(
dlg
,
SIGNAL
(
finished
(
int
)),
this
,
SLOT
(
onConfigurationDone
(
int
)));;
return
dlg
;
}
...
...
@@ -80,7 +81,7 @@ void GmailResource::onConfigurationDone(int result)
if
(
dlg
->
shouldClearCache
()
)
{
clearCache
();
}
GmailSettings
::
self
()
->
writeConfig
();
GmailSettings
::
self
()
->
save
();
}
dlg
->
deleteLater
();
}
...
...
@@ -103,7 +104,7 @@ void GmailResource::retrieveCollections()
void
GmailResource
::
retrieveItems
(
const
Akonadi
::
Collection
&
col
)
{
k
Debug
()
<<
col
.
id
()
<<
col
.
remoteId
()
<<
col
.
name
();
q
Debug
()
<<
col
.
id
()
<<
col
.
remoteId
()
<<
col
.
name
();
// We can't sync the virtual collections - instead we get ID of "All Mail" and
// we schedule it's sync
//
...
...
@@ -142,7 +143,7 @@ void GmailResource::onRetrieveItemsCollectionRetrieved(KJob *job)
Akonadi
::
CollectionFetchJob
*
fetch
=
qobject_cast
<
Akonadi
::
CollectionFetchJob
*>
(
job
);
if
(
fetch
->
collections
().
count
()
!=
1
)
{
k
Warning
()
<<
"Got"
<<
fetch
->
collections
().
count
()
<<
"collections, expected only one!"
;
q
Warning
()
<<
"Got"
<<
fetch
->
collections
().
count
()
<<
"collections, expected only one!"
;
cancelTask
();
return
;
}
...
...
@@ -155,7 +156,7 @@ void GmailResource::onRetrieveItemsCollectionRetrieved(KJob *job)
void
GmailResource
::
itemsLinked
(
const
Akonadi
::
Item
::
List
&
items
,
const
Akonadi
::
Collection
&
collection
)
{
if
(
!
collection
.
hasAttribute
<
GmailLabelAttribute
>
())
{
k
Warning
()
<<
"Collection is missing GmailLabelAttribute! IMPOSSIBRU!"
;
q
Warning
()
<<
"Collection is missing GmailLabelAttribute! IMPOSSIBRU!"
;
cancelTask
();
return
;
}
...
...
@@ -169,7 +170,7 @@ void GmailResource::itemsLinked(const Akonadi::Item::List &items, const Akonadi:
void
GmailResource
::
itemsUnlinked
(
const
Akonadi
::
Item
::
List
&
items
,
const
Akonadi
::
Collection
&
collection
)
{
if
(
!
collection
.
hasAttribute
<
GmailLabelAttribute
>
())
{
k
Warning
()
<<
"Collection is missing GmailLabelAttribute! IMPOSSIBRU!"
;
q
Warning
()
<<
"Collection is missing GmailLabelAttribute! IMPOSSIBRU!"
;
cancelTask
();
return
;
}
...
...
resources/gmail/gmailresource.h
View file @
73bd7e57
...
...
@@ -22,7 +22,7 @@
#include <imap/imapresourcebase.h>
#include <Akonadi/AgentBase>
#include <Akonadi
AgentBase
/AgentBase>
class
GmailResource
:
public
ImapResourceBase
{
...
...
resources/gmail/gmailretrievecollectionstask.cpp
View file @
73bd7e57
...
...
@@ -23,14 +23,14 @@
#include <imap/noselectattribute.h>
#include <imap/noinferiorsattribute.h>
#include <Akonadi/CachePolicy>
#include <Akonadi/EntityDisplayAttribute>
#include <Akonadi
Core
/CachePolicy>
#include <Akonadi
Core
/EntityDisplayAttribute>
#include <Akonadi/KMime/MessageParts>
#include <Akonadi/EntityHiddenAttribute>
#include <Akonadi
Core
/EntityHiddenAttribute>
#include <KMime/Message>
#include <KI
MAP
/ListJob>
#include <KI
map
/ListJob>
#include <KLocalizedString>
...
...
@@ -56,7 +56,7 @@ void GmailRetrieveCollectionsTask::onMailBoxesReceived(const QList<KIMAP::MailBo
// skip phantom mailboxes contained in LSUB but not LIST
if
(
isSubscriptionEnabled
()
&&
!
m_fullReportedCollections
.
contains
(
descriptor
.
name
))
{
k
Debug
()
<<
"Got phantom mailbox: "
<<
descriptor
.
name
;
q
Debug
()
<<
"Got phantom mailbox: "
<<
descriptor
.
name
;
continue
;
}
...
...
@@ -76,7 +76,7 @@ void GmailRetrieveCollectionsTask::onMailBoxesReceived(const QList<KIMAP::MailBo
if
(
m_reportedCollections
.
contains
(
currentPath
))
{
if
(
m_dummyCollections
.
contains
(
currentPath
)
&&
!
isDummy
)
{
k
Debug
()
<<
"Received the real collection for a dummy one : "
<<
currentPath
;
q
Debug
()
<<
"Received the real collection for a dummy one : "
<<
currentPath
;
//set the correct attributes for the collection, eg. noselect needs to be removed
Akonadi
::
Collection
c
=
m_reportedCollections
.
value
(
currentPath
);
c
.
setContentMimeTypes
(
contentTypes
);
...
...
@@ -146,7 +146,7 @@ void GmailRetrieveCollectionsTask::onMailBoxesReceived(const QList<KIMAP::MailBo
// If this folder is a noselect folder, make some special settings.
if
(
currentFlags
.
contains
(
"
\\
noselect"
))
{
k
Debug
()
<<
"Dummy collection created: "
<<
currentPath
;
q
Debug
()
<<
"Dummy collection created: "
<<
currentPath
;
c
.
addAttribute
(
new
NoSelectAttribute
(
true
));
c
.
setContentMimeTypes
(
QStringList
()
<<
Akonadi
::
Collection
::
mimeType
());
c
.
setRights
(
Akonadi
::
Collection
::
ReadOnly
);
...
...
@@ -157,12 +157,12 @@ void GmailRetrieveCollectionsTask::onMailBoxesReceived(const QList<KIMAP::MailBo
// If this folder is a noinferiors folder, it is not allowed to create subfolders inside.
if
(
currentFlags
.
contains
(
"
\\
noinferiors"
))
{
//
k
Debug() << "Noinferiors: " << currentPath;
//
q
Debug() << "Noinferiors: " << currentPath;
c
.
addAttribute
(
new
NoInferiorsAttribute
(
true
));
c
.
setRights
(
c
.
rights
()
&
~
Akonadi
::
Collection
::
CanCreateCollection
);
}
k
Debug
()
<<
currentPath
<<
currentFlags
;
q
Debug
()
<<
currentPath
<<
currentFlags
;
// Special treating of Gmail system collections (and INBOX)
if
(
currentPath
==
QLatin1String
(
"/INBOX"
)
||
currentFlags
.
contains
(
"
\\
drafts"
)
||
...
...
resources/gmail/gmailretrieveitemstask.cpp
View file @
73bd7e57
...
...
@@ -22,15 +22,15 @@
#include <imap/batchfetcher.h>
#include <Akonadi/CollectionFetchJob>
#include <Akonadi/LinkJob>
#include <Akonadi
Core
/CollectionFetchJob>
#include <Akonadi
Core
/LinkJob>
#include <KI
MAP
/Session>
#include <KI
map
/Session>
GmailRetrieveItemsTask
::
GmailRetrieveItemsTask
(
ResourceStateInterface
::
Ptr
resource
,
QObject
*
parent
)
:
RetrieveItemsTask
(
resource
,
parent
)
{
k
Debug
();
q
Debug
();
dynamic_cast
<
GmailResourceState
*>
(
resource
.
get
())
->
setCurrentTask
(
this
);
}
...
...
@@ -45,7 +45,7 @@ BatchFetcher *GmailRetrieveItemsTask::createBatchFetcher(MessageHelper::Ptr mess
int
batchSize
,
KIMAP
::
Session
*
session
)
{
k
Debug
();
q
Debug
();
KIMAP
::
FetchJob
::
FetchScope
gmailScope
=
scope
;
BatchFetcher
*
batchFetcher
=
new
BatchFetcher
(
messageHelper
,
set
,
gmailScope
,
batchSize
,
session
);
batchFetcher
->
setGmailExtensionsEnabled
(
true
);
...
...
resources/gmail/gmailretrieveitemstask.h
View file @
73bd7e57
...
...
@@ -22,8 +22,8 @@
#include <imap/retrieveitemstask.h>
#include <KI
MAP
/ImapSet>
#include <KI
MAP
/FetchJob>
#include <KI
map
/ImapSet>
#include <KI
map
/FetchJob>
class
GmailRetrieveItemsTask
:
public
RetrieveItemsTask
{
...
...
resources/gmail/gmailsettings.cpp
View file @
73bd7e57
...
...
@@ -32,12 +32,12 @@ using KWallet::Wallet;
#include <QDBusConnection>
#include <
KDE/Akonadi
/Collection>
#include <
KDE/Akonadi
/CollectionFetchJob>
#include <
KDE/Akonadi
/CollectionModifyJob>
#include <
AkonadiCore
/Collection>
#include <
AkonadiCore
/CollectionFetchJob>
#include <
AkonadiCore
/CollectionModifyJob>
#include <
LibKGAPI2
/Account>
#include <
LibKGAPI2
/AuthJob>
#include <
KGAPI
/Account>
#include <
KGAPI
/AuthJob>
class
SettingsHelper
{
...
...
@@ -237,7 +237,7 @@ void GmailSettings::saveAccountToKWallet()
map
[
QLatin1String
(
"accessToken"
)]
=
mAccount
->
accessToken
();
map
[
QLatin1String
(
"refreshToken"
)]
=
mAccount
->
refreshToken
();
wallet
->
writeMap
(
config
()
->
name
(),
map
);
k
Debug
()
<<
"Wallet save: "
<<
wallet
->
sync
();
q
Debug
()
<<
"Wallet save: "
<<
wallet
->
sync
();
}
delete
wallet
;
}
...
...
@@ -303,7 +303,7 @@ void GmailSettings::setRefreshToken(const QString &refreshToken)
void
GmailSettings
::
loadAccount
(
ImapAccount
*
account
)
const
{
k
Debug
()
<<
userName
();
q
Debug
()
<<
userName
();
account
->
setServer
(
QLatin1String
(
"imap.gmail.com"
));
account
->
setPort
(
993
);
...
...
resources/gmail/gmailsettings.h
View file @
73bd7e57
...
...
@@ -22,7 +22,7 @@
#include "settingsbase.h"
#include <
LibKGAPI2
/Types>
#include <
KGAPI
/Types>
namespace
KGAPI2
{
class
Job
;
...
...
resources/gmail/saslplugin/CMakeLists.txt
View file @
73bd7e57
...
...
@@ -3,8 +3,8 @@ set_package_properties(Sasl2 PROPERTIES DESCRIPTION "cyrus-sasl" URL "http://asg
add_definitions
(
-D_POSIX_SOURCE
)
include_directories
(
${
S
ASL2_INCLUDE_DIR
}
${
S
ASL
2_INCLUDE_DIR
}
/sasl
)
include_directories
(
${
S
asl2_INCLUDE_DIRS
}
${
S
asl
2_INCLUDE_DIR
}
/sasl
)
set
(
kdexoauth2sasl_SRCS
plugin_common.c
...
...
@@ -12,7 +12,13 @@ set(kdexoauth2sasl_SRCS
xoauth2plugin_init.c
)
add_library
(
kdexoauth2
${
kdexoauth2sasl_SRCS
}
)
if
(
Sasl2_FOUND
)
set
(
kdexoauth2sasl_EXTRA_LIBS
${
Sasl2_LIBRARIES
}
)
endif
()
add_library
(
kdexoauth2
${
kdexoauth2sasl_SRCS
}
${
kdexoauth2sasl_EXTRA_LIBS
}
)
set_target_properties
(
kdexoauth2 PROPERTIES SOVERSION 3 VERSION 3.0.0
)
install
(
TARGETS kdexoauth2 DESTINATION
${
LIB_INSTALL_DIR
}
/sasl2
)
\ No newline at end of file
install
(
TARGETS kdexoauth2 DESTINATION
${
LIB_INSTALL_DIR
}
/sasl2
)
resources/google/calendar/CMakeLists.txt
View file @
73bd7e57
kde_enable_exceptions
()
set
(
calendarresource_SRCS
calendarresource.cpp
...
...
@@ -44,10 +44,13 @@ endif()
target_link_libraries
(
akonadi_googlecalendar_resource
KF5::AkonadiCore
KF5::CalendarCore
KF5::AkonadiCalendar
KF5::Mime
KF5::GAPICalendar
KF5::GAPICore
KF5::GAPITasks
KF5::AkonadiAgentBase
KF5::Wallet
)
if
(
${
AccountsQt_FOUND
}
AND
${
SignOnQt_FOUND
}
)
...
...
resources/google/calendar/defaultreminderattribute.cpp
View file @
73bd7e57
...
...
@@ -18,9 +18,7 @@
#include "defaultreminderattribute.h"
#include <QVariant>
//#include <qjson/parser.h>
//#include <qjson/serializer.h>
#include <QJsonDocument>
#include <KGAPI/Calendar/Reminder>
...
...
@@ -45,10 +43,14 @@ void DefaultReminderAttribute::setReminders( const RemindersList &reminders )
void
DefaultReminderAttribute
::
deserialize
(
const
QByteArray
&
data
)
{
QJson
::
Parser
parser
;
QJsonDocument
json
=
QJsonDocument
::
fromJson
(
data
);
if
(
json
.
isNull
())
return
;
QVariant
var
=
json
.
toVariant
();
QVariantList
list
;
list
=
parser
.
parse
(
data
)
.
toList
();
list
=
var
.
toList
();
Q_FOREACH
(
const
QVariant
&
l
,
list
)
{
QVariantMap
reminder
=
l
.
toMap
();
...
...
@@ -84,9 +86,8 @@ QByteArray DefaultReminderAttribute::serialized() const
list
<<
reminder
;
}
QJson
::
Serializer
serializer
;
return
serializer
.
serialize
(
list
);
QJsonDocument
serialized
=
QJsonDocument
::
fromVariant
(
list
);
return
serialized
.
toJson
();
}
KCalCore
::
Alarm
::
List
DefaultReminderAttribute
::
alarms
(
KCalCore
::
Incidence
*
incidence
)
const
...
...
resources/google/common/googleresource.cpp
View file @
73bd7e57
...
...
@@ -26,8 +26,8 @@
#include <KDE/KLocale>
#include <KGAPI/Account>
#include <KGAPI/AccountInfo
/AccountInfo
FetchJob>
#include <KGAPI/AccountInfo
/AccountInfo
>
#include <KGAPI/AccountInfoFetchJob>
#include <KGAPI/AccountInfo>
#include <KGAPI/AuthJob>
#include <KLocale>
...
...
@@ -242,7 +242,7 @@ void GoogleResource::slotKAccountsAccountInfoReceived( KGAPI2::Job *job )
const
AccountPtr
account
=
job
->
account
();
if
(
aiJob
->
items
().
count
()
!=
1
)
{
k
Warning
()
<<
"AccountInfoFetchJob returned unexpected amount of results"
;
q
Warning
()
<<
"AccountInfoFetchJob returned unexpected amount of results"
;
emit
error
(
i18n
(
"Invalid reply"
)
);
cancelTask
(
i18n
(
"Failed to refresh tokens"
)
);
return
;
...
...
@@ -289,7 +289,7 @@ void GoogleResource::slotAccountManagerReady( bool ready )
return
;
}
k
Debug
()
<<
ready
;
q
Debug
()
<<
ready
;
if
(
!
ready
)
{
emit
status
(
Broken
,
i18n
(
"Can't access KWallet"
)
);
return
;
...
...
@@ -344,7 +344,7 @@ bool GoogleResource::handleError( KGAPI2::Job *job )
}
if
(
job
->
error
()
==
KGAPI2
::
Unauthorized
)
{
k
Debug
()
<<
job
<<
job
->
errorString
();
q
Debug
()
<<
job
<<
job
->
errorString
();
const
QList
<
QUrl
>
resourceScopes
=
scopes
();
Q_FOREACH
(
const
QUrl
&
scope
,
resourceScopes
)
{
...
...
@@ -375,7 +375,7 @@ bool GoogleResource::canPerformTask()
void
GoogleResource
::
slotAuthJobFinished
(
KGAPI2
::
Job
*
job
)
{
k
Debug
();
q
Debug
();
if
(
job
->
error
()
!=
KGAPI2
::
NoError
)
{
cancelTask
(
i18n
(
"Failed to refresh tokens"
)
);
...
...
@@ -385,7 +385,7 @@ void GoogleResource::slotAuthJobFinished( KGAPI2::Job *job )
AuthJob
*
authJob
=
qobject_cast
<
AuthJob
*>
(
job
);
m_account
=
authJob
->
account
();
if
(
!
m_accountMgr
->
storeAccount
(
m_account
)
)
{
k
Warning
()
<<
"Failed to store account in KWallet"
;
q
Warning
()
<<
"Failed to store account in KWallet"
;
}
KGAPI2
::
Job
*
otherJob
=
job
->
property
(
JOB_PROPERTY
).
value
<
KGAPI2
::
Job
*>
();
...
...
resources/google/contacts/CMakeLists.txt
View file @
73bd7e57
kde_enable_exceptions
()
set
(
contactsresource_SRCS