diff options
Diffstat (limited to 'framework/src/domain/settings/accountsettings.cpp')
-rw-r--r-- | framework/src/domain/settings/accountsettings.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/framework/src/domain/settings/accountsettings.cpp b/framework/src/domain/settings/accountsettings.cpp index 232f7aba..09cdf279 100644 --- a/framework/src/domain/settings/accountsettings.cpp +++ b/framework/src/domain/settings/accountsettings.cpp | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <QDir> | 24 | #include <QDir> |
25 | #include <QUrl> | 25 | #include <QUrl> |
26 | 26 | ||
27 | #include "keyring.h" | ||
28 | |||
27 | using namespace Sink; | 29 | using namespace Sink; |
28 | using namespace Sink::ApplicationDomain; | 30 | using namespace Sink::ApplicationDomain; |
29 | 31 | ||
@@ -196,7 +198,6 @@ void AccountSettings::loadImapResource() | |||
196 | mImapIdentifier = resource.identifier(); | 198 | mImapIdentifier = resource.identifier(); |
197 | mImapServer = resource.getProperty("server").toString(); | 199 | mImapServer = resource.getProperty("server").toString(); |
198 | mImapUsername = resource.getProperty("username").toString(); | 200 | mImapUsername = resource.getProperty("username").toString(); |
199 | mImapPassword = resource.getProperty("password").toString(); | ||
200 | emit imapResourceChanged(); | 201 | emit imapResourceChanged(); |
201 | }).onError([](const KAsync::Error &error) { | 202 | }).onError([](const KAsync::Error &error) { |
202 | qWarning() << "Failed to load the imap resource: " << error.errorMessage; | 203 | qWarning() << "Failed to load the imap resource: " << error.errorMessage; |
@@ -222,7 +223,6 @@ void AccountSettings::loadMailtransportResource() | |||
222 | mMailtransportIdentifier = resource.identifier(); | 223 | mMailtransportIdentifier = resource.identifier(); |
223 | mSmtpServer = resource.getProperty("server").toString(); | 224 | mSmtpServer = resource.getProperty("server").toString(); |
224 | mSmtpUsername = resource.getProperty("username").toString(); | 225 | mSmtpUsername = resource.getProperty("username").toString(); |
225 | mSmtpPassword = resource.getProperty("password").toString(); | ||
226 | emit smtpResourceChanged(); | 226 | emit smtpResourceChanged(); |
227 | }).onError([](const KAsync::Error &error) { | 227 | }).onError([](const KAsync::Error &error) { |
228 | SinkWarning() << "Failed to load the smtp resource: " << error.errorMessage; | 228 | SinkWarning() << "Failed to load the smtp resource: " << error.errorMessage; |
@@ -250,7 +250,6 @@ void AccountSettings::loadCardDavResource() | |||
250 | mCardDavIdentifier = resource.identifier(); | 250 | mCardDavIdentifier = resource.identifier(); |
251 | mCardDavServer = resource.getProperty("server").toString(); | 251 | mCardDavServer = resource.getProperty("server").toString(); |
252 | mCardDavUsername = resource.getProperty("username").toString(); | 252 | mCardDavUsername = resource.getProperty("username").toString(); |
253 | mCardDavPassword = resource.getProperty("password").toString(); | ||
254 | emit cardDavResourceChanged(); | 253 | emit cardDavResourceChanged(); |
255 | }).onError([](const KAsync::Error &error) { | 254 | }).onError([](const KAsync::Error &error) { |
256 | qWarning() << "Failed to load the CardDAV resource: " << error.errorMessage; | 255 | qWarning() << "Failed to load the CardDAV resource: " << error.errorMessage; |
@@ -291,18 +290,18 @@ void AccountSettings::saveImapResource() | |||
291 | { | 290 | { |
292 | mImapIdentifier = saveResource<ImapResource>(mAccountIdentifier, mImapIdentifier, { | 291 | mImapIdentifier = saveResource<ImapResource>(mAccountIdentifier, mImapIdentifier, { |
293 | {"server", mImapServer}, | 292 | {"server", mImapServer}, |
294 | {"username", mImapUsername}, | 293 | {"username", mImapUsername} |
295 | {"password", mImapPassword}, | ||
296 | }); | 294 | }); |
295 | Kube::Keyring{mAccountIdentifier}.storePassword(mImapIdentifier, mImapPassword); | ||
297 | } | 296 | } |
298 | 297 | ||
299 | void AccountSettings::saveCardDavResource() | 298 | void AccountSettings::saveCardDavResource() |
300 | { | 299 | { |
301 | mCardDavIdentifier = saveResource<CardDavResource>(mAccountIdentifier, mCardDavIdentifier, { | 300 | mCardDavIdentifier = saveResource<CardDavResource>(mAccountIdentifier, mCardDavIdentifier, { |
302 | {"server", mCardDavServer}, | 301 | {"server", mCardDavServer}, |
303 | {"username", mCardDavUsername}, | 302 | {"username", mCardDavUsername} |
304 | {"password", mCardDavPassword}, | ||
305 | }); | 303 | }); |
304 | Kube::Keyring{mAccountIdentifier}.storePassword(mCardDavIdentifier, mCardDavPassword); | ||
306 | } | 305 | } |
307 | 306 | ||
308 | void AccountSettings::saveMaildirResource() | 307 | void AccountSettings::saveMaildirResource() |
@@ -316,9 +315,9 @@ void AccountSettings::saveMailtransportResource() | |||
316 | { | 315 | { |
317 | mMailtransportIdentifier = saveResource<MailtransportResource>(mAccountIdentifier, mMailtransportIdentifier, { | 316 | mMailtransportIdentifier = saveResource<MailtransportResource>(mAccountIdentifier, mMailtransportIdentifier, { |
318 | {"server", mSmtpServer}, | 317 | {"server", mSmtpServer}, |
319 | {"username", mSmtpUsername}, | 318 | {"username", mSmtpUsername} |
320 | {"password", mSmtpPassword}, | ||
321 | }); | 319 | }); |
320 | Kube::Keyring{mAccountIdentifier}.storePassword(mMailtransportIdentifier, mSmtpPassword); | ||
322 | } | 321 | } |
323 | 322 | ||
324 | void AccountSettings::saveIdentity() | 323 | void AccountSettings::saveIdentity() |