summaryrefslogtreecommitdiffstats
path: root/accounts
diff options
context:
space:
mode:
Diffstat (limited to 'accounts')
-rw-r--r--accounts/CMakeLists.txt2
-rw-r--r--accounts/gmail/CMakeLists.txt19
-rw-r--r--accounts/gmail/qmldir3
-rw-r--r--accounts/google/CMakeLists.txt19
-rw-r--r--accounts/google/googleaccountplugin.cpp (renamed from accounts/gmail/gmailaccountplugin.cpp)10
-rw-r--r--accounts/google/googleaccountplugin.h (renamed from accounts/gmail/gmailaccountplugin.h)2
-rw-r--r--accounts/google/googlesettings.cpp (renamed from accounts/gmail/gmailsettings.cpp)18
-rw-r--r--accounts/google/googlesettings.h (renamed from accounts/gmail/gmailsettings.h)4
-rw-r--r--accounts/google/metadata.json (renamed from accounts/gmail/metadata.json)2
-rw-r--r--accounts/google/qml/AccountSettings.qml (renamed from accounts/gmail/qml/AccountSettings.qml)26
-rw-r--r--accounts/google/qml/Login.qml (renamed from accounts/gmail/qml/Login.qml)6
-rw-r--r--accounts/google/qmldir3
12 files changed, 61 insertions, 53 deletions
diff --git a/accounts/CMakeLists.txt b/accounts/CMakeLists.txt
index 76a11c54..0209f00b 100644
--- a/accounts/CMakeLists.txt
+++ b/accounts/CMakeLists.txt
@@ -12,5 +12,5 @@ endmacro(install_qml_account)
12add_subdirectory(maildir) 12add_subdirectory(maildir)
13add_subdirectory(imap) 13add_subdirectory(imap)
14add_subdirectory(kolabnow) 14add_subdirectory(kolabnow)
15add_subdirectory(gmail) 15add_subdirectory(google)
16add_subdirectory(generic) 16add_subdirectory(generic)
diff --git a/accounts/gmail/CMakeLists.txt b/accounts/gmail/CMakeLists.txt
deleted file mode 100644
index f8baee04..00000000
--- a/accounts/gmail/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
1project(kube-accounts-gmail)
2
3set(SRCS
4 gmailsettings.cpp
5 gmailaccountplugin.cpp
6)
7
8add_library(gmailaccountplugin SHARED ${SRCS})
9target_link_libraries(gmailaccountplugin
10 sink
11 frameworkplugin
12 Qt5::Core
13 Qt5::Quick
14 Qt5::Qml
15)
16
17install(TARGETS gmailaccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/gmail)
18install(FILES metadata.json DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/gmail)
19install_qml_account(gmail)
diff --git a/accounts/gmail/qmldir b/accounts/gmail/qmldir
deleted file mode 100644
index 78a9e5b7..00000000
--- a/accounts/gmail/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
1module org.kube.accounts.gmail
2
3plugin gmailaccountplugin
diff --git a/accounts/google/CMakeLists.txt b/accounts/google/CMakeLists.txt
new file mode 100644
index 00000000..3732190d
--- /dev/null
+++ b/accounts/google/CMakeLists.txt
@@ -0,0 +1,19 @@
1project(kube-accounts-google)
2
3set(SRCS
4 googlesettings.cpp
5 googleaccountplugin.cpp
6)
7
8add_library(googleaccountplugin SHARED ${SRCS})
9target_link_libraries(googleaccountplugin
10 sink
11 frameworkplugin
12 Qt5::Core
13 Qt5::Quick
14 Qt5::Qml
15)
16
17install(TARGETS googleaccountplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/google)
18install(FILES metadata.json DESTINATION ${QML_INSTALL_DIR}/org/kube/accounts/google)
19install_qml_account(google)
diff --git a/accounts/gmail/gmailaccountplugin.cpp b/accounts/google/googleaccountplugin.cpp
index 53218939..d419e585 100644
--- a/accounts/gmail/gmailaccountplugin.cpp
+++ b/accounts/google/googleaccountplugin.cpp
@@ -16,14 +16,14 @@
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA. 17 02110-1301, USA.
18*/ 18*/
19#include "gmailaccountplugin.h" 19#include "googleaccountplugin.h"
20 20
21#include "gmailsettings.h" 21#include "googlesettings.h"
22 22
23#include <QtQml> 23#include <QtQml>
24 24
25void GmailAccountPlugin::registerTypes (const char *uri) 25void GoogleAccountPlugin::registerTypes (const char *uri)
26{ 26{
27 Q_ASSERT(uri == QLatin1String("org.kube.accounts.gmail")); 27 Q_ASSERT(uri == QLatin1String("org.kube.accounts.google"));
28 qmlRegisterType<GmailSettings>(uri, 1, 0, "GmailSettings"); 28 qmlRegisterType<GoogleSettings>(uri, 1, 0, "GoogleSettings");
29} 29}
diff --git a/accounts/gmail/gmailaccountplugin.h b/accounts/google/googleaccountplugin.h
index 5876e393..d546c4f9 100644
--- a/accounts/gmail/gmailaccountplugin.h
+++ b/accounts/google/googleaccountplugin.h
@@ -21,7 +21,7 @@
21#include <QQmlEngine> 21#include <QQmlEngine>
22#include <QQmlExtensionPlugin> 22#include <QQmlExtensionPlugin>
23 23
24class GmailAccountPlugin : public QQmlExtensionPlugin 24class GoogleAccountPlugin : public QQmlExtensionPlugin
25{ 25{
26 Q_OBJECT 26 Q_OBJECT
27 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") 27 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
diff --git a/accounts/gmail/gmailsettings.cpp b/accounts/google/googlesettings.cpp
index a50668b8..6c4c32de 100644
--- a/accounts/gmail/gmailsettings.cpp
+++ b/accounts/google/googlesettings.cpp
@@ -16,14 +16,14 @@
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA. 17 02110-1301, USA.
18*/ 18*/
19#include "gmailsettings.h" 19#include "googlesettings.h"
20 20
21GmailSettings::GmailSettings(QObject *parent) 21GoogleSettings::GoogleSettings(QObject *parent)
22 : AccountSettings(parent) 22 : AccountSettings(parent)
23{ 23{
24} 24}
25 25
26void GmailSettings::load() 26void GoogleSettings::load()
27{ 27{
28 loadAccount(); 28 loadAccount();
29 loadImapResource(); 29 loadImapResource();
@@ -31,7 +31,7 @@ void GmailSettings::load()
31 loadIdentity(); 31 loadIdentity();
32} 32}
33 33
34void GmailSettings::save() 34void GoogleSettings::save()
35{ 35{
36 mImapServer = "imaps://imap.gmail.com:993"; 36 mImapServer = "imaps://imap.gmail.com:993";
37 mImapUsername = mEmailAddress; 37 mImapUsername = mEmailAddress;
@@ -39,13 +39,21 @@ void GmailSettings::save()
39 mSmtpServer = "smtps://smtp.gmail.com:587"; 39 mSmtpServer = "smtps://smtp.gmail.com:587";
40 mSmtpUsername = mEmailAddress; 40 mSmtpUsername = mEmailAddress;
41 41
42 mCardDavServer = QStringLiteral("https://www.googleapis.com/carddav/v1/principals/") + mEmailAddress + "/";
43 mCardDavUsername = mEmailAddress;
44
45 mCalDavServer = QStringLiteral("https://www.google.com/calendar/dav/") + mEmailAddress + "/";
46 mCalDavUsername = mEmailAddress;
47
42 saveAccount(); 48 saveAccount();
43 saveImapResource(); 49 saveImapResource();
44 saveMailtransportResource(); 50 saveMailtransportResource();
51 saveCardDavResource();
52 saveCalDavResource();
45 saveIdentity(); 53 saveIdentity();
46} 54}
47 55
48void GmailSettings::remove() 56void GoogleSettings::remove()
49{ 57{
50 removeResource(mMailtransportIdentifier); 58 removeResource(mMailtransportIdentifier);
51 removeResource(mImapIdentifier); 59 removeResource(mImapIdentifier);
diff --git a/accounts/gmail/gmailsettings.h b/accounts/google/googlesettings.h
index 708cb94b..ac7ae61f 100644
--- a/accounts/gmail/gmailsettings.h
+++ b/accounts/google/googlesettings.h
@@ -20,12 +20,12 @@
20 20
21#include <domain/settings/accountsettings.h> 21#include <domain/settings/accountsettings.h>
22 22
23class GmailSettings : public AccountSettings 23class GoogleSettings : public AccountSettings
24{ 24{
25 Q_OBJECT 25 Q_OBJECT
26 26
27public: 27public:
28 GmailSettings(QObject *parent = 0); 28 GoogleSettings(QObject *parent = 0);
29 29
30 Q_INVOKABLE virtual void load() Q_DECL_OVERRIDE; 30 Q_INVOKABLE virtual void load() Q_DECL_OVERRIDE;
31 Q_INVOKABLE virtual void save() Q_DECL_OVERRIDE; 31 Q_INVOKABLE virtual void save() Q_DECL_OVERRIDE;
diff --git a/accounts/gmail/metadata.json b/accounts/google/metadata.json
index 68c06971..0ad786f1 100644
--- a/accounts/gmail/metadata.json
+++ b/accounts/google/metadata.json
@@ -1,4 +1,4 @@
1{ 1{
2 "Name": "GMail", 2 "Name": "Google",
3 "RequiresKeyring": true 3 "RequiresKeyring": true
4} 4}
diff --git a/accounts/gmail/qml/AccountSettings.qml b/accounts/google/qml/AccountSettings.qml
index d7df5eaf..73cdfbd7 100644
--- a/accounts/gmail/qml/AccountSettings.qml
+++ b/accounts/google/qml/AccountSettings.qml
@@ -20,28 +20,28 @@
20import QtQuick 2.4 20import QtQuick 2.4
21import QtQuick.Layouts 1.1 21import QtQuick.Layouts 1.1
22import org.kube.framework 1.0 as Kube 22import org.kube.framework 1.0 as Kube
23import org.kube.accounts.gmail 1.0 as GmailAccount 23import org.kube.accounts.google 1.0 as GoogleAccount
24 24
25Item { 25Item {
26 26
27 property string accountId 27 property string accountId
28 property string heading: qsTr("Connect your GMail account") 28 property string heading: qsTr("Connect your Google account")
29 property string subheadline: qsTr("To let Kube access your account, fill in email address, username and give the account a title that will be displayed inside Kube.") 29 property string subheadline: qsTr("To let Kube access your account, fill in email address, username and give the account a title that will be displayed inside Kube.")
30 property bool valid: true 30 property bool valid: true
31 implicitHeight: grid.implicitHeight 31 implicitHeight: grid.implicitHeight
32 32
33 GmailAccount.GmailSettings { 33 GoogleAccount.GoogleSettings {
34 id: gmailSettings 34 id: googleSettings
35 accountIdentifier: accountId 35 accountIdentifier: accountId
36 accountType: "gmail" 36 accountType: "google"
37 } 37 }
38 38
39 function save(){ 39 function save(){
40 gmailSettings.save() 40 googleSettings.save()
41 } 41 }
42 42
43 function remove(){ 43 function remove(){
44 gmailSettings.remove() 44 googleSettings.remove()
45 } 45 }
46 46
47 GridLayout { 47 GridLayout {
@@ -52,7 +52,7 @@ Item {
52 rowSpacing: Kube.Units.largeSpacing 52 rowSpacing: Kube.Units.largeSpacing
53 53
54 Kube.Label { 54 Kube.Label {
55 text: "Please note that GMail requires you to configure your account to allow IMAP connections from Kube: 55 text: "Please note that Google requires you to configure your account to allow IMAP connections from Kube:
56<ol type=''> 56<ol type=''>
57<li> See <a href='https://support.google.com/mail/answer/7126229'>https://support.google.com/mail/answer/7126229</a> to configure your account to allow IMAP connections. 57<li> See <a href='https://support.google.com/mail/answer/7126229'>https://support.google.com/mail/answer/7126229</a> to configure your account to allow IMAP connections.
58<li> Visit <a href='https://myaccount.google.com/lesssecureapps'>https://myaccount.google.com/lesssecureapps</a> and enable the setting to allow Kube to connect to your account." 58<li> Visit <a href='https://myaccount.google.com/lesssecureapps'>https://myaccount.google.com/lesssecureapps</a> and enable the setting to allow Kube to connect to your account."
@@ -68,9 +68,9 @@ Item {
68 Kube.TextField { 68 Kube.TextField {
69 Layout.fillWidth: true 69 Layout.fillWidth: true
70 placeholderText: qsTr("Your name") 70 placeholderText: qsTr("Your name")
71 text: gmailSettings.userName 71 text: googleSettings.userName
72 onTextChanged: { 72 onTextChanged: {
73 gmailSettings.userName = text 73 googleSettings.userName = text
74 } 74 }
75 } 75 }
76 76
@@ -81,10 +81,10 @@ Item {
81 Kube.TextField { 81 Kube.TextField {
82 Layout.fillWidth: true 82 Layout.fillWidth: true
83 83
84 text: gmailSettings.emailAddress 84 text: googleSettings.emailAddress
85 onTextChanged: { 85 onTextChanged: {
86 gmailSettings.emailAddress = text 86 googleSettings.emailAddress = text
87 gmailSettings.accountName = text 87 googleSettings.accountName = text
88 } 88 }
89 placeholderText: qsTr("Your email address") 89 placeholderText: qsTr("Your email address")
90 } 90 }
diff --git a/accounts/gmail/qml/Login.qml b/accounts/google/qml/Login.qml
index bcab19be..0a44aa8c 100644
--- a/accounts/gmail/qml/Login.qml
+++ b/accounts/google/qml/Login.qml
@@ -20,7 +20,7 @@
20import QtQuick 2.4 20import QtQuick 2.4
21import QtQuick.Layouts 1.1 21import QtQuick.Layouts 1.1
22import org.kube.framework 1.0 as Kube 22import org.kube.framework 1.0 as Kube
23import org.kube.accounts.gmail 1.0 as GmailAccount 23import org.kube.accounts.google 1.0 as GoogleAccount
24 24
25Item { 25Item {
26 property alias accountId: settings.accountIdentifier 26 property alias accountId: settings.accountIdentifier
@@ -28,9 +28,9 @@ Item {
28 property string subheadline: settings.accountName 28 property string subheadline: settings.accountName
29 property bool valid: pwField.acceptableInput 29 property bool valid: pwField.acceptableInput
30 30
31 GmailAccount.GmailSettings { 31 GoogleAccount.GoogleSettings {
32 id: settings 32 id: settings
33 accountType: "gmail" 33 accountType: "google"
34 } 34 }
35 35
36 function login(){ 36 function login(){
diff --git a/accounts/google/qmldir b/accounts/google/qmldir
new file mode 100644
index 00000000..a4a06cb7
--- /dev/null
+++ b/accounts/google/qmldir
@@ -0,0 +1,3 @@
1module org.kube.accounts.google
2
3plugin googleaccountplugin