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
b9fd5723
Commit
b9fd5723
authored
Aug 01, 2017
by
Laurent Montel
Browse files
Coding style
parent
75215e6b
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/kmailtransport/plugins/smtp/autotests/fakeserver.cpp
View file @
b9fd5723
...
...
@@ -23,9 +23,9 @@
#include
<QFile>
#include
<QDebug>
FakeServer
::
FakeServer
(
QObject
*
parent
)
:
QThread
(
parent
)
,
m_tcpServer
(
nullptr
)
FakeServer
::
FakeServer
(
QObject
*
parent
)
:
QThread
(
parent
)
,
m_tcpServer
(
nullptr
)
{
moveToThread
(
this
);
}
...
...
@@ -38,16 +38,17 @@ QByteArray FakeServer::greeting()
QList
<
QByteArray
>
FakeServer
::
greetingAndEhlo
(
bool
multiline
)
{
return
QList
<
QByteArray
>
()
<<
greeting
()
<<
"C: EHLO 127.0.0.1"
<<
QByteArray
(
"S: 250"
)
+
(
multiline
?
'-'
:
' '
)
+
"Localhost ready to roll"
;
<<
"C: EHLO 127.0.0.1"
<<
QByteArray
(
"S: 250"
)
+
(
multiline
?
'-'
:
' '
)
+
"Localhost ready to roll"
;
}
QList
<
QByteArray
>
FakeServer
::
bye
()
{
return
{
"C: QUIT"
,
"S: 221 So long, and thanks for all the fish"
,
"X: "
};
return
{
"C: QUIT"
,
"S: 221 So long, and thanks for all the fish"
,
"X: "
};
}
FakeServer
::~
FakeServer
()
...
...
@@ -179,7 +180,7 @@ void FakeServer::writeServerPart(int scenarioNumber)
QTcpSocket
*
clientSocket
=
m_clientSockets
[
scenarioNumber
];
while
(
!
scenario
.
isEmpty
()
&&
(
scenario
.
first
().
startsWith
(
"S: "
)
||
scenario
.
first
().
startsWith
(
"W: "
)))
{
&&
(
scenario
.
first
().
startsWith
(
"S: "
)
||
scenario
.
first
().
startsWith
(
"W: "
)))
{
QByteArray
rule
=
scenario
.
takeFirst
();
if
(
rule
.
startsWith
(
"S: "
))
{
...
...
src/kmailtransport/plugins/smtp/autotests/smtpjobtest.cpp
View file @
b9fd5723
...
...
@@ -38,10 +38,10 @@ private Q_SLOTS:
{
QStandardPaths
::
setTestModeEnabled
(
true
);
}
void
smtpJobTest_data
()
{
QTest
::
addColumn
<
QList
<
QByteArray
>>
(
"scenario"
);
QTest
::
addColumn
<
QList
<
QByteArray
>
>
(
"scenario"
);
QTest
::
addColumn
<
MailTransport
::
TransportBase
::
EnumAuthenticationType
::
type
>
(
"authType"
);
QTest
::
addColumn
<
QString
>
(
"from"
);
QTest
::
addColumn
<
QStringList
>
(
"to"
);
...
...
@@ -74,7 +74,9 @@ private Q_SLOTS:
QTest
::
newRow
(
"simple"
)
<<
scenario
<<
MailTransport
::
TransportBase
::
EnumAuthenticationType
::
LOGIN
<<
QStringLiteral
(
"Foo Bar <foo@bar.com>"
)
<<
QStringList
{}
<<
QStringList
{
QStringLiteral
(
"bar@foo.com"
),
QStringLiteral
(
"<bar@bar.foo>"
)
}
<<
QStringList
{
QStringLiteral
(
"bar@foo.com"
),
QStringLiteral
(
"<bar@bar.foo>"
)
}
<<
QByteArray
(
"Hi Bob"
)
<<
true
;
}
...
...
src/kmailtransport/plugins/smtp/lineeditpassword.cpp
View file @
b9fd5723
...
...
@@ -17,7 +17,6 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
"lineeditpassword.h"
#include
<KLocalizedString>
#include
<QIcon>
...
...
@@ -43,7 +42,6 @@ LineEditPassword::LineEditPassword(QWidget *parent)
LineEditPassword
::~
LineEditPassword
()
{
}
void
LineEditPassword
::
initialize
()
...
...
@@ -64,8 +62,7 @@ void LineEditPassword::toggleEchoMode()
if
(
mPasswordLineEdit
->
echoMode
()
==
QLineEdit
::
Password
)
{
mPasswordLineEdit
->
setEchoMode
(
QLineEdit
::
Normal
);
mToggleEchoModeAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"hint"
),
QIcon
(
QStringLiteral
(
":/icons/hint.svg"
))));
}
else
if
(
mPasswordLineEdit
->
echoMode
()
==
QLineEdit
::
Normal
)
{
}
else
if
(
mPasswordLineEdit
->
echoMode
()
==
QLineEdit
::
Normal
)
{
mPasswordLineEdit
->
setEchoMode
(
QLineEdit
::
Password
);
mToggleEchoModeAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"visibility"
),
QIcon
(
QStringLiteral
(
":/icons/visibility.svg"
))));
}
...
...
src/kmailtransport/plugins/smtp/lineeditpassword.h
View file @
b9fd5723
...
...
@@ -22,8 +22,7 @@
class
QLineEdit
;
class
QAction
;
namespace
MailTransport
{
namespace
MailTransport
{
class
LineEditPassword
:
public
QWidget
{
public:
...
...
src/kmailtransport/plugins/smtp/smtpconfigdialog.cpp
View file @
b9fd5723
...
...
@@ -30,7 +30,6 @@
using
namespace
MailTransport
;
SmtpConfigDialog
::
SmtpConfigDialog
(
Transport
*
transport
,
QWidget
*
parent
)
:
QDialog
(
parent
)
{
...
...
src/kmailtransport/plugins/smtp/smtpconfigwidget.cpp
View file @
b9fd5723
...
...
@@ -316,7 +316,7 @@ void SMTPConfigWidget::hostNameChanged(const QString &text)
d
->
resetAuthCapabilities
();
if
(
d
->
encryptionGroup
)
{
for
(
int
i
=
0
;
i
<
d
->
encryptionGroup
->
buttons
().
count
();
++
i
)
{
for
(
int
i
=
0
;
i
<
d
->
encryptionGroup
->
buttons
().
count
();
++
i
)
{
d
->
encryptionGroup
->
buttons
().
at
(
i
)
->
setEnabled
(
true
);
}
}
...
...
src/kmailtransport/plugins/smtp/smtpjob.cpp
View file @
b9fd5723
...
...
@@ -51,7 +51,7 @@ public:
}
int
ref
;
QHash
<
int
,
KSmtp
::
Session
*>
sessions
;
QHash
<
int
,
KSmtp
::
Session
*>
sessions
;
void
removeSession
(
KSmtp
::
Session
*
session
)
{
...
...
@@ -59,11 +59,11 @@ public:
int
key
=
sessions
.
key
(
session
);
if
(
key
>
0
)
{
QObject
::
connect
(
session
,
&
KSmtp
::
Session
::
stateChanged
,
[
session
](
KSmtp
::
Session
::
State
state
)
{
if
(
state
==
KSmtp
::
Session
::
Disconnected
)
{
session
->
deleteLater
();
}
});
[
session
](
KSmtp
::
Session
::
State
state
)
{
if
(
state
==
KSmtp
::
Session
::
Disconnected
)
{
session
->
deleteLater
();
}
});
session
->
quit
();
sessions
.
remove
(
key
);
}
...
...
@@ -158,11 +158,11 @@ void SmtpJob::startSmtpJob()
this
,
&
SmtpJob
::
sessionStateChanged
,
Qt
::
UniqueConnection
);
connect
(
d
->
session
,
&
KSmtp
::
Session
::
connectionError
,
this
,
[
this
](
const
QString
&
err
)
{
setError
(
KJob
::
UserDefinedError
);
setErrorText
(
err
);
s_sessionPool
->
removeSession
(
d
->
session
);
emitResult
();
});
setError
(
KJob
::
UserDefinedError
);
setErrorText
(
err
);
s_sessionPool
->
removeSession
(
d
->
session
);
emitResult
();
});
if
(
d
->
session
->
state
()
==
KSmtp
::
Session
::
Disconnected
)
{
d
->
session
->
open
();
...
...
@@ -267,7 +267,6 @@ void SmtpJob::startLoginJob()
default:
qCWarning
(
MAILTRANSPORT_SMTP_LOG
)
<<
"Unknown encryption mode"
<<
transport
()
->
encryption
();
break
;
}
connect
(
login
,
&
KJob
::
result
,
this
,
&
SmtpJob
::
slotResult
);
...
...
src/kmailtransport/transportmanager.cpp
View file @
b9fd5723
...
...
@@ -496,7 +496,6 @@ void TransportManagerPrivate::updatePluginList()
}
}
void
TransportManager
::
updatePluginList
()
{
d
->
updatePluginList
();
...
...
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