summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-02 06:12:35 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-02 06:12:35 (GMT)
commitf7aab82001798742d60224c2a3fc75b5369fa799 (patch)
treeb883c6e5678617b297ecb2e71b22a8ae41b3e5c6
parentda237e3da20bf9cbc320c4efca0756952bb76839 (diff)
Astyle kdelibs
-rw-r--r--messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp91
-rw-r--r--messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h3
-rw-r--r--messagecomposer/src/composer-ng/richtextcomposerng.cpp8
-rw-r--r--messageviewer/autotests/viewertest.cpp44
-rw-r--r--templateparser/src/templatesconfiguration.cpp11
5 files changed, 74 insertions, 83 deletions
diff --git a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
index 95d1eba..a5d3bed 100644
--- a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
+++ b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
@@ -17,7 +17,6 @@
Boston, MA 02110-1301, USA.
*/
-
#include "richtextcomposerngtest.h"
#include "../richtextcomposerng.h"
#include "../richtextcomposersignatures.h"
@@ -48,7 +47,6 @@ void RichTextComposerNgTest::shouldHaveDefaultValue()
QVERIFY(richtextComposerNg.composerControler()->composerImages());
}
-
void RichTextComposerNgTest::shouldForceAutoCorrection_data()
{
QTest::addColumn<QString>("original");
@@ -178,16 +176,16 @@ void RichTextComposerNgTest::shouldAddSpecificSignature_data()
QTest::addColumn<bool>("enablesignature");
QTest::addColumn<bool>("signaturehtml");
QTest::newRow("startandaddseparatordisablenonhtml") << QStringLiteral("foo bla, bli\nbb") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator
- << false << false;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator
+ << false << false;
QTest::newRow("startandaddseparatordisablehtml") << QStringLiteral("foo bla, bli\nbb") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator
- << false << true;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator
+ << false << true;
QTest::newRow("startandaddseparatorenablehtml") << QStringLiteral("foo bla, bli\nbb") << QStringLiteral("-- \nSignaturefoo bla, bli\nbb")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator
- << true << true;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator
+ << true << true;
}
void RichTextComposerNgTest::shouldAddSpecificSignature()
@@ -231,91 +229,88 @@ void RichTextComposerNgTest::shouldReplaceSignature_data()
QTest::newRow("withnewlineatbegin") << QStringLiteral("\nSignature\nnew line") << QStringLiteral("foo bla, bli\nbb")
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
QTest::newRow("withnewlineatbeginandend") << QStringLiteral("\nSignature\nnew line\n") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
-
+ << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddSeparator;
//Add separator AtStart
QTest::newRow("newlinebody-2") << QStringLiteral("Signature") << QStringLiteral("\n")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
QTest::newRow("emptybody-2") << QStringLiteral("Signature") << QString()
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
QTest::newRow("spacebody-2") << QStringLiteral("Signature") << QStringLiteral(" ")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
QTest::newRow("simple-2") << QStringLiteral("Signature") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
QTest::newRow("withnewline-2") << QStringLiteral("Signature\nnew line") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
QTest::newRow("withnewlineatbegin-2") << QStringLiteral("\nSignature\nnew line") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
QTest::newRow("withnewlineatbeginandend-2 ") << QStringLiteral("\nSignature\nnew line\n") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
-
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddSeparator;
//Add nothing End
//FIXME
//QTest::newRow("newlinebody-3") << QStringLiteral("Signature") << QStringLiteral("\n")
// << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNothing;
QTest::newRow("emptybody-3") << QStringLiteral("Signature") << QString()
- << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNothing;
+ << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNothing;
QTest::newRow("spacebody-3") << QStringLiteral("Signature") << QStringLiteral(" ")
- << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNothing;
+ << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNothing;
QTest::newRow("simple-3") << QStringLiteral("Signature") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNothing;
+ << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNothing;
QTest::newRow("withnewline-3") << QStringLiteral("Signature\nnew line") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNothing;
+ << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNothing;
QTest::newRow("withnewlineatbegin-3") << QStringLiteral("\nSignature\nnew line") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNothing;
+ << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNothing;
QTest::newRow("withnewlineatbeginandend-3") << QStringLiteral("\nSignature\nnew line\n") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNothing;
-
+ << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNothing;
//Add nothing Start
QTest::newRow("newlinebody-4") << QStringLiteral("Signature") << QStringLiteral("\n")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNothing;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNothing;
QTest::newRow("emptybody-4") << QStringLiteral("Signature") << QString()
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNothing;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNothing;
QTest::newRow("spacebody-4") << QStringLiteral("Signature") << QStringLiteral(" ")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNothing;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNothing;
QTest::newRow("simple-4") << QStringLiteral("Signature") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNothing;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNothing;
QTest::newRow("withnewline-4") << QStringLiteral("Signature\nnew line") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNothing;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNothing;
QTest::newRow("withnewlineatbegin-4") << QStringLiteral("\nSignature\nnew line") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNothing;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNothing;
QTest::newRow("withnewlineatbeginandend-4") << QStringLiteral("\nSignature\nnew line\n") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNothing;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNothing;
//Add newline End
QTest::newRow("emptybody-5") << QStringLiteral("Signature") << QString()
- << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNewLines;
- QTest::newRow("newlinebody-5") << QStringLiteral("Signature") << QStringLiteral("\n")
<< KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNewLines;
+ QTest::newRow("newlinebody-5") << QStringLiteral("Signature") << QStringLiteral("\n")
+ << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNewLines;
QTest::newRow("spacebody-5") << QStringLiteral("Signature") << QStringLiteral(" ")
- << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNewLines;
+ << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNewLines;
QTest::newRow("simple-5") << QStringLiteral("Signature") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNewLines;
+ << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNewLines;
QTest::newRow("withnewline-5") << QStringLiteral("Signature\nnew line") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNewLines;
+ << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNewLines;
QTest::newRow("withnewlineatbegin-5") << QStringLiteral("\nSignature\nnew line") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNewLines;
+ << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNewLines;
QTest::newRow("withnewlineatbeginandend-5") << QStringLiteral("\nSignature\nnew line\n") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNewLines;
+ << KIdentityManagement::Signature::End << KIdentityManagement::Signature::AddNewLines;
#if 0 //Need to fix it.
//Add newline start
QTest::newRow("emptybody-6") << QStringLiteral("Signature") << QString()
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNewLines;
- QTest::newRow("newlinebody-6") << QStringLiteral("Signature") << QStringLiteral("\n")
<< KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNewLines;
+ QTest::newRow("newlinebody-6") << QStringLiteral("Signature") << QStringLiteral("\n")
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNewLines;
QTest::newRow("spacebody-6") << QStringLiteral("Signature") << QStringLiteral(" ")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNewLines;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNewLines;
QTest::newRow("simple-6") << QStringLiteral("Signature") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNewLines;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNewLines;
QTest::newRow("withnewline-6") << QStringLiteral("Signature\nnew line") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNewLines;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNewLines;
QTest::newRow("withnewlineatbegin-6") << QStringLiteral("\nSignature\nnew line") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNewLines;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNewLines;
QTest::newRow("withnewlineatbeginandend6") << QStringLiteral("\nSignature\nnew line\n") << QStringLiteral("foo bla, bli\nbb")
- << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNewLines;
+ << KIdentityManagement::Signature::Start << KIdentityManagement::Signature::AddNewLines;
#endif
}
@@ -336,7 +331,7 @@ void RichTextComposerNgTest::shouldReplaceSignature()
newSignature.setInlinedHtml(false);
QString addText;
- switch(signatureaddtext) {
+ switch (signatureaddtext) {
case KIdentityManagement::Signature::AddNothing:
break;
case KIdentityManagement::Signature::AddSeparator:
@@ -348,7 +343,7 @@ void RichTextComposerNgTest::shouldReplaceSignature()
}
QString expected;
- switch(signatureplacement) {
+ switch (signatureplacement) {
case KIdentityManagement::Signature::Start:
expected = addText + signatureText + bodytext;
break;
diff --git a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h
index 2415830..17e1acf 100644
--- a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h
+++ b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.h
@@ -17,7 +17,6 @@
Boston, MA 02110-1301, USA.
*/
-
#ifndef RICHTEXTCOMPOSERNGTEST_H
#define RICHTEXTCOMPOSERNGTEST_H
@@ -37,7 +36,6 @@ private Q_SLOTS:
void shouldForceAutoCorrectionWithSelection_data();
void shouldForceAutoCorrectionWithSelection();
-
void shouldNotChangeSignatureWhenOriginalAndNewSignatureAreSame();
void shouldAddSignature_data();
@@ -46,7 +44,6 @@ private Q_SLOTS:
void shouldAddSpecificSignature_data();
void shouldAddSpecificSignature();
-
void shouldReplaceSignature_data();
void shouldReplaceSignature();
diff --git a/messagecomposer/src/composer-ng/richtextcomposerng.cpp b/messagecomposer/src/composer-ng/richtextcomposerng.cpp
index 6b231a6..8cf8d64 100644
--- a/messagecomposer/src/composer-ng/richtextcomposerng.cpp
+++ b/messagecomposer/src/composer-ng/richtextcomposerng.cpp
@@ -381,8 +381,8 @@ void RichTextComposerNg::forceAutoCorrection(bool selectedText)
const int positionEnd = qMax(cur.selectionEnd(), cur.selectionStart());
cur.setPosition(positionStart);
int cursorPosition = positionStart;
- while(cursorPosition < positionEnd) {
- if(isLineQuoted(cur.block().text())) {
+ while (cursorPosition < positionEnd) {
+ if (isLineQuoted(cur.block().text())) {
cur.movePosition(QTextCursor::NextBlock);
} else {
cur.movePosition(QTextCursor::NextWord);
@@ -392,8 +392,8 @@ void RichTextComposerNg::forceAutoCorrection(bool selectedText)
}
} else {
cur.movePosition(QTextCursor::Start);
- while(!cur.atEnd()) {
- if(isLineQuoted(cur.block().text())) {
+ while (!cur.atEnd()) {
+ if (isLineQuoted(cur.block().text())) {
cur.movePosition(QTextCursor::NextBlock);
} else {
cur.movePosition(QTextCursor::NextWord);
diff --git a/messageviewer/autotests/viewertest.cpp b/messageviewer/autotests/viewertest.cpp
index 27677ca..f346641 100644
--- a/messageviewer/autotests/viewertest.cpp
+++ b/messageviewer/autotests/viewertest.cpp
@@ -71,30 +71,30 @@ void ViewerTest::shouldHaveDefaultValuesOnCreation()
}
static const char s_mail1[] =
- "From: Konqui <konqui@kde.org>\n"
- "To: Friends <friends@kde.org>\n"
- "Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST)\n"
- "Subject: Sample message\n"
- "MIME-Version: 1.0\n"
- "Content-type: text/plain; charset=us-ascii\n"
- "\n"
- "\n"
- "This is a test message.\n"
- "\n";
+ "From: Konqui <konqui@kde.org>\n"
+ "To: Friends <friends@kde.org>\n"
+ "Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST)\n"
+ "Subject: Sample message\n"
+ "MIME-Version: 1.0\n"
+ "Content-type: text/plain; charset=us-ascii\n"
+ "\n"
+ "\n"
+ "This is a test message.\n"
+ "\n";
static const char s_mail2[] =
- "From: David Faure <dfaure@example.com>\n"
- "To: Friends <friends@example.com>\n"
- "Date: Sun, 31 Aug 2016 23:56:48 +0200 (CEST)\n"
- "Subject: Second mail\n"
- "MIME-Version: 1.0\n"
- "Content-type: text/plain; charset=\"us-ascii\"\n"
- "\n"
- "\n"
- "This is the second message.\n"
- "\n";
-
-KMime::Message::Ptr createMsg(const char* data)
+ "From: David Faure <dfaure@example.com>\n"
+ "To: Friends <friends@example.com>\n"
+ "Date: Sun, 31 Aug 2016 23:56:48 +0200 (CEST)\n"
+ "Subject: Second mail\n"
+ "MIME-Version: 1.0\n"
+ "Content-type: text/plain; charset=\"us-ascii\"\n"
+ "\n"
+ "\n"
+ "This is the second message.\n"
+ "\n";
+
+KMime::Message::Ptr createMsg(const char *data)
{
KMime::Message::Ptr msgPtr(new KMime::Message());
msgPtr->setContent(QByteArray(data));
diff --git a/templateparser/src/templatesconfiguration.cpp b/templateparser/src/templatesconfiguration.cpp
index 7cb4ae9..2fa4d11 100644
--- a/templateparser/src/templatesconfiguration.cpp
+++ b/templateparser/src/templatesconfiguration.cpp
@@ -97,16 +97,15 @@ TemplatesConfiguration::TemplatesConfiguration(QWidget *parent, const QString &n
TemplatesConfiguration::~TemplatesConfiguration()
{
disconnect(textEdit_new->editor(), &QPlainTextEdit::textChanged,
- this, &TemplatesConfiguration::slotTextChanged);
+ this, &TemplatesConfiguration::slotTextChanged);
disconnect(textEdit_reply->editor(), &QPlainTextEdit::textChanged,
- this, &TemplatesConfiguration::slotTextChanged);
+ this, &TemplatesConfiguration::slotTextChanged);
disconnect(textEdit_reply_all->editor(), &QPlainTextEdit::textChanged,
- this, &TemplatesConfiguration::slotTextChanged);
+ this, &TemplatesConfiguration::slotTextChanged);
disconnect(textEdit_forward->editor(), &QPlainTextEdit::textChanged,
- this, &TemplatesConfiguration::slotTextChanged);
+ this, &TemplatesConfiguration::slotTextChanged);
disconnect(lineEdit_quote, &QLineEdit::textChanged,
- this, &TemplatesConfiguration::slotTextChanged);
-
+ this, &TemplatesConfiguration::slotTextChanged);
delete d;
}