Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KMailTransport
Commits
ca0ff919
Commit
ca0ff919
authored
Sep 01, 2020
by
Laurent Montel
Browse files
GIT_SILENT: coding style
parent
5e98c0d3
Pipeline
#32631
passed with stage
in 19 minutes and 11 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/kmailtransport/plugins/smtp/autotests/fakeserver.cpp
View file @
ca0ff919
...
...
@@ -34,9 +34,9 @@ QList<QByteArray> FakeServer::greetingAndEhlo(bool multiline)
QList
<
QByteArray
>
FakeServer
::
bye
()
{
return
{
"C: QUIT"
,
"S: 221 So long, and thanks for all the fish"
,
"X: "
"C: QUIT"
,
"S: 221 So long, and thanks for all the fish"
,
"X: "
};
}
...
...
src/kmailtransport/plugins/smtp/smtpjob.cpp
View file @
ca0ff919
...
...
@@ -188,22 +188,22 @@ void SmtpJob::startPasswordRetrieval(bool forceRefresh)
GOOGLE_API_KEY
,
transport
()
->
userName
(),
{
KGAPI2
::
Account
::
mailScopeUrl
()
});
connect
(
promise
,
&
KGAPI2
::
AccountPromise
::
finished
,
this
,
[
forceRefresh
,
this
](
KGAPI2
::
AccountPromise
*
promise
)
{
if
(
promise
->
account
())
{
if
(
forceRefresh
)
{
promise
=
KGAPI2
::
AccountManager
::
instance
()
->
refreshTokens
(
GOOGLE_API_KEY
,
GOOGLE_API_SECRET
,
transport
()
->
userName
());
}
else
{
onTokenRequestFinished
(
promise
);
return
;
}
}
else
{
promise
=
KGAPI2
::
AccountManager
::
instance
()
->
getAccount
(
GOOGLE_API_KEY
,
GOOGLE_API_SECRET
,
transport
()
->
userName
(),
{
KGAPI2
::
Account
::
mailScopeUrl
()
});
}
connect
(
promise
,
&
KGAPI2
::
AccountPromise
::
finished
,
this
,
&
SmtpJob
::
onTokenRequestFinished
);
});
if
(
promise
->
account
())
{
if
(
forceRefresh
)
{
promise
=
KGAPI2
::
AccountManager
::
instance
()
->
refreshTokens
(
GOOGLE_API_KEY
,
GOOGLE_API_SECRET
,
transport
()
->
userName
());
}
else
{
onTokenRequestFinished
(
promise
);
return
;
}
}
else
{
promise
=
KGAPI2
::
AccountManager
::
instance
()
->
getAccount
(
GOOGLE_API_KEY
,
GOOGLE_API_SECRET
,
transport
()
->
userName
(),
{
KGAPI2
::
Account
::
mailScopeUrl
()
});
}
connect
(
promise
,
&
KGAPI2
::
AccountPromise
::
finished
,
this
,
&
SmtpJob
::
onTokenRequestFinished
);
});
}
else
{
startLoginJob
();
}
...
...
@@ -226,7 +226,6 @@ void SmtpJob::onTokenRequestFinished(KGAPI2::AccountPromise *promise)
startLoginJob
();
}
void
SmtpJob
::
startLoginJob
()
{
if
(
!
transport
()
->
requiresAuthentication
())
{
...
...
@@ -241,9 +240,9 @@ void SmtpJob::startLoginJob()
&&
transport
()
->
authenticationType
()
!=
Transport
::
EnumAuthenticationType
::
GSSAPI
)
{
QPointer
<
KPasswordDialog
>
dlg
=
new
KPasswordDialog
(
nullptr
,
KPasswordDialog
::
ShowUsernameLine
|
KPasswordDialog
::
ShowKeepPassword
);
nullptr
,
KPasswordDialog
::
ShowUsernameLine
|
KPasswordDialog
::
ShowKeepPassword
);
dlg
->
setPrompt
(
i18n
(
"You need to supply a username and a password "
"to use this SMTP server."
));
dlg
->
setKeepPassword
(
transport
()
->
storePassword
());
...
...
@@ -365,7 +364,7 @@ void SmtpJob::slotResult(KJob *job)
return
;
}
if
(
qobject_cast
<
KSmtp
::
LoginJob
*>
(
job
))
{
if
(
qobject_cast
<
KSmtp
::
LoginJob
*>
(
job
))
{
if
(
job
->
error
()
==
KSmtp
::
LoginJob
::
TokenExpired
)
{
startPasswordRetrieval
(
/*force refresh */
true
);
return
;
...
...
src/kmailtransport/plugins/smtp/smtpmailtransportplugin.h
View file @
ca0ff919
...
...
@@ -14,8 +14,7 @@ class SMTPMailTransportPlugin : public MailTransport::TransportAbstractPlugin
{
Q_OBJECT
public:
explicit
SMTPMailTransportPlugin
(
QObject
*
parent
=
nullptr
,
const
QList
<
QVariant
>
&
=
{
explicit
SMTPMailTransportPlugin
(
QObject
*
parent
=
nullptr
,
const
QList
<
QVariant
>
&
=
{
});
~
SMTPMailTransportPlugin
()
override
;
...
...
src/kmailtransport/precommandjob.cpp
View file @
ca0ff919
...
...
@@ -71,7 +71,7 @@ void PrecommandJob::start()
void
PreCommandJobPrivate
::
slotStarted
()
{
Q_EMIT
q
->
infoMessage
(
q
,
i18n
(
"Executing precommand"
),
i18n
(
"Executing precommand '%1'."
,
precommand
));
i18n
(
"Executing precommand '%1'."
,
precommand
));
}
void
PreCommandJobPrivate
::
slotError
(
QProcess
::
ProcessError
error
)
...
...
src/kmailtransport/servertest.cpp
View file @
ca0ff919
...
...
@@ -68,7 +68,8 @@ public:
bool
handleNntpConversation
(
MailTransport
::
Socket
*
socket
,
int
type
,
int
*
stage
,
const
QString
&
response
,
bool
*
shouldStartTLS
);
QVector
<
int
>
parseAuthenticationList
(
const
QStringList
&
authentications
);
inline
bool
isGmail
(
const
QString
&
server
)
const
{
inline
bool
isGmail
(
const
QString
&
server
)
const
{
return
server
.
endsWith
(
QLatin1String
(
"gmail.com"
))
||
server
.
endsWith
(
QLatin1String
(
"googlemail.com"
));
}
...
...
src/kmailtransport/transportmanager.cpp
View file @
ca0ff919
...
...
@@ -623,7 +623,9 @@ void TransportManager::loadPasswordsAsync()
d
->
wallet
=
Wallet
::
openWallet
(
Wallet
::
NetworkWallet
(),
window
,
Wallet
::
Asynchronous
);
if
(
d
->
wallet
)
{
connect
(
d
->
wallet
,
&
KWallet
::
Wallet
::
walletOpened
,
this
,
[
this
](
bool
status
)
{
d
->
slotWalletOpened
(
status
);});
connect
(
d
->
wallet
,
&
KWallet
::
Wallet
::
walletOpened
,
this
,
[
this
](
bool
status
)
{
d
->
slotWalletOpened
(
status
);
});
d
->
walletAsyncOpen
=
true
;
}
else
{
d
->
walletOpenFailed
=
true
;
...
...
src/kmailtransport/transportmanager.h
View file @
ca0ff919
...
...
@@ -13,7 +13,6 @@
#include
<QList>
#include
<QObject>
namespace
KWallet
{
class
Wallet
;
}
...
...
src/kmailtransport/widgets/transportmanagementwidget.cpp
View file @
ca0ff919
...
...
@@ -133,10 +133,10 @@ void TransportManagementWidget::Private::removeClicked()
}
const
int
rc
=
KMessageBox
::
questionYesNo
(
q
,
i18n
(
"Do you want to remove outgoing account '%1'?"
,
ui
.
transportList
->
currentItem
()
->
text
(
0
)),
i18n
(
"Remove outgoing account?"
));
q
,
i18n
(
"Do you want to remove outgoing account '%1'?"
,
ui
.
transportList
->
currentItem
()
->
text
(
0
)),
i18n
(
"Remove outgoing account?"
));
if
(
rc
==
KMessageBox
::
No
)
{
return
;
}
...
...
src/kmailtransportakonadi/plugins/akonadimailtransportplugin.h
View file @
ca0ff919
...
...
@@ -17,8 +17,7 @@ class AkonadiMailTransportPlugin : public MailTransport::TransportAbstractPlugin
{
Q_OBJECT
public:
explicit
AkonadiMailTransportPlugin
(
QObject
*
parent
=
nullptr
,
const
QList
<
QVariant
>
&
=
{
explicit
AkonadiMailTransportPlugin
(
QObject
*
parent
=
nullptr
,
const
QList
<
QVariant
>
&
=
{
});
~
AkonadiMailTransportPlugin
()
override
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment