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
KDE PIM Add-ons
Commits
f946d8ab
Commit
f946d8ab
authored
Sep 10, 2017
by
Laurent Montel
Browse files
Coding style
parent
6ccbb3e2
Changes
36
Hide whitespace changes
Inline
Side-by-side
kaddressbook/importexportplugins/vcards/engine/vcardviewerdialog.h
View file @
f946d8ab
...
...
@@ -46,7 +46,6 @@ private:
void
writeConfig
();
void
updateView
();
KContacts
::
Addressee
::
List
mContacts
;
KContacts
::
Addressee
::
List
::
Iterator
mIt
;
QPushButton
*
mApplyButton
=
nullptr
;
...
...
kaddressbook/plugins/checkgravatar/gravatar/autotests/checkgravatarplugintest.cpp
View file @
f946d8ab
...
...
@@ -23,7 +23,6 @@
CheckGravatarPluginTest
::
CheckGravatarPluginTest
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
QTEST_MAIN
(
CheckGravatarPluginTest
)
kaddressbook/plugins/checkgravatar/gravatar/autotests/checkgravatarplugintest.h
View file @
f946d8ab
...
...
@@ -17,7 +17,6 @@
Boston, MA 02110-1301, USA.
*/
#ifndef CHECKGRAVATARPLUGINTEST_H
#define CHECKGRAVATARPLUGINTEST_H
...
...
kmail/editorinitplugins/externalcomposer/autotests/externalcomposerconfigurewidgettest.cpp
View file @
f946d8ab
...
...
@@ -83,7 +83,6 @@ void ExternalComposerConfigureWidgetTest::shouldEnableDisableElements()
QVERIFY
(
urlrequesterlabel
->
isEnabled
());
QVERIFY
(
explanationlabel
->
isEnabled
());
mExternalEditorCheck
->
toggle
();
QVERIFY
(
!
mExternalEditorCheck
->
isChecked
());
QVERIFY
(
!
mEditorRequester
->
isEnabled
());
...
...
kmail/editorinitplugins/externalcomposer/autotests/externalcomposerplugineditortest.cpp
View file @
f946d8ab
...
...
@@ -24,7 +24,6 @@
ExternalComposerPluginEditorTest
::
ExternalComposerPluginEditorTest
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
void
ExternalComposerPluginEditorTest
::
shouldHaveDefaultValue
()
...
...
kmail/editorinitplugins/externalcomposer/autotests/externalcomposerplugineditortest.h
View file @
f946d8ab
...
...
@@ -31,7 +31,6 @@ public:
private
Q_SLOTS
:
void
shouldHaveDefaultValue
();
};
#endif // EXTERNALCOMPOSERPLUGINEDITORTEST_H
kmail/editorinitplugins/externalcomposer/externalcomposerconfigurewidget.cpp
View file @
f946d8ab
...
...
@@ -48,8 +48,8 @@ ExternalComposerConfigureWidget::ExternalComposerConfigureWidget(QWidget *parent
hbox
->
addWidget
(
mEditorRequester
);
mEditorRequester
->
setMimeTypeFilters
({
QStringLiteral
(
"application/x-executable"
),
QStringLiteral
(
"application/x-shellscript"
),
QStringLiteral
(
"application/x-desktop"
)});
QStringLiteral
(
"application/x-shellscript"
),
QStringLiteral
(
"application/x-desktop"
)});
mEditorRequester
->
setMode
(
KFile
::
File
|
KFile
::
ExistingOnly
|
KFile
::
LocalOnly
);
mEditorRequester
->
setEnabled
(
false
);
// !mExternalEditorCheck->isChecked()
...
...
kmail/editorsendcheckplugins/automaticaddcontacts/automaticaddcontactsjob.cpp
View file @
f946d8ab
...
...
@@ -103,7 +103,7 @@ void AutomaticAddContactsJob::slotFetchAllCollections(KJob *job)
Akonadi
::
Collection
::
List
canCreateItemCollections
;
const
Akonadi
::
Collection
::
List
addressBookCollections
=
addressBookJob
->
collections
();
for
(
const
Akonadi
::
Collection
&
collection
:
addressBookCollections
)
{
if
(
Akonadi
::
Collection
::
CanCreateItem
&
collection
.
rights
())
{
if
(
Akonadi
::
Collection
::
CanCreateItem
&
collection
.
rights
())
{
canCreateItemCollections
.
append
(
collection
);
}
}
...
...
kmail/editorsendcheckplugins/checkbeforesend/autotests/checkattachmentjobtest.cpp
View file @
f946d8ab
...
...
@@ -47,17 +47,29 @@ void CheckAttachmentJobTest::shouldAssignEmails_data()
QTest
::
addColumn
<
QStringList
>
(
"originalEmails"
);
QTest
::
addColumn
<
QStringList
>
(
"result"
);
QTest
::
newRow
(
"emptylist"
)
<<
QStringList
()
<<
QStringList
();
QStringList
emails
{
QStringLiteral
(
"foo@kde.org"
),
QStringLiteral
(
"bla@kde.org"
)};
QStringList
createdList
{
QStringLiteral
(
"foo@kde.org"
),
QStringLiteral
(
"bla@kde.org"
)};
QStringList
emails
{
QStringLiteral
(
"foo@kde.org"
),
QStringLiteral
(
"bla@kde.org"
)
};
QStringList
createdList
{
QStringLiteral
(
"foo@kde.org"
),
QStringLiteral
(
"bla@kde.org"
)
};
QTest
::
newRow
(
"nonempty"
)
<<
emails
<<
createdList
;
emails
=
QStringList
{
QStringLiteral
(
"
\"
bla
\"
<foo@kde.org>"
),
QStringLiteral
(
"bla@kde.org"
)};
emails
=
QStringList
{
QStringLiteral
(
"
\"
bla
\"
<foo@kde.org>"
),
QStringLiteral
(
"bla@kde.org"
)
};
QTest
::
newRow
(
"potentialerrors"
)
<<
emails
<<
emails
;
emails
=
QStringList
{
QStringLiteral
(
"
\"
bla, foo
\"
<foo@kde.org>"
),
QStringLiteral
(
"bla@kde.org"
)};
emails
=
QStringList
{
QStringLiteral
(
"
\"
bla, foo
\"
<foo@kde.org>"
),
QStringLiteral
(
"bla@kde.org"
)
};
QTest
::
newRow
(
"emailswithquote"
)
<<
emails
<<
emails
;
emails
=
QStringList
{
QStringLiteral
(
"
\"
bla, foo
\"
<foo@kde.org>"
),
QStringLiteral
(
"bla@kde.org"
),
QStringLiteral
(
" "
)};
createdList
=
QStringList
{
QStringLiteral
(
"
\"
bla, foo
\"
<foo@kde.org>"
),
QStringLiteral
(
"bla@kde.org"
)};
emails
=
QStringList
{
QStringLiteral
(
"
\"
bla, foo
\"
<foo@kde.org>"
),
QStringLiteral
(
"bla@kde.org"
),
QStringLiteral
(
" "
)
};
createdList
=
QStringList
{
QStringLiteral
(
"
\"
bla, foo
\"
<foo@kde.org>"
),
QStringLiteral
(
"bla@kde.org"
)
};
QTest
::
newRow
(
"emailswithemptystr"
)
<<
emails
<<
createdList
;
}
...
...
@@ -71,7 +83,6 @@ void CheckAttachmentJobTest::shouldAssignEmails()
QCOMPARE
(
job
.
originalEmails
(),
result
);
}
void
CheckAttachmentJobTest
::
shouldRemoveDuplicatedEmails
()
{
QFETCH
(
QStringList
,
originalEmails
);
...
...
kmail/editorsendcheckplugins/checkbeforesend/autotests/checkbeforesendupdatesmtpdialogtest.cpp
View file @
f946d8ab
...
...
@@ -29,7 +29,6 @@ QTEST_MAIN(CheckBeforeSendUpdateSmtpDialogTest)
CheckBeforeSendUpdateSmtpDialogTest
::
CheckBeforeSendUpdateSmtpDialogTest
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
void
CheckBeforeSendUpdateSmtpDialogTest
::
shouldHaveDefaultValue
()
...
...
kmail/editorsendcheckplugins/checkbeforesend/checkbeforesendupdatesmtpdialog.cpp
View file @
f946d8ab
...
...
@@ -17,7 +17,6 @@
Boston, MA 02110-1301, USA.
*/
#include
"checkbeforesendupdatesmtpdialog.h"
#include
<KLocalizedString>
#include
<QVBoxLayout>
...
...
@@ -51,7 +50,6 @@ CheckBeforeSendUpdateSmtpDialog::CheckBeforeSendUpdateSmtpDialog(QWidget *parent
CheckBeforeSendUpdateSmtpDialog
::~
CheckBeforeSendUpdateSmtpDialog
()
{
}
bool
CheckBeforeSendUpdateSmtpDialog
::
changeSmtp
()
const
...
...
kmail/editorsendcheckplugins/confirm-address/autotests/confirmaddressemailentrydialogtest.cpp
View file @
f946d8ab
...
...
@@ -31,7 +31,6 @@ QTEST_MAIN(ConfirmAddressEmailEntryDialogTest)
ConfirmAddressEmailEntryDialogTest
::
ConfirmAddressEmailEntryDialogTest
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
void
ConfirmAddressEmailEntryDialogTest
::
shouldHaveDefaultValue
()
...
...
@@ -44,7 +43,6 @@ void ConfirmAddressEmailEntryDialogTest::shouldHaveDefaultValue()
QVERIFY
(
label
);
QVERIFY
(
!
label
->
text
().
isEmpty
());
QLineEdit
*
mLineEdit
=
dlg
.
findChild
<
QLineEdit
*>
(
QStringLiteral
(
"lineedit"
));
QVERIFY
(
mLineEdit
);
QVERIFY
(
mLineEdit
->
text
().
isEmpty
());
...
...
kmail/editorsendcheckplugins/confirm-address/confirmaddressconfiguretabwidget.cpp
View file @
f946d8ab
...
...
@@ -56,9 +56,9 @@ ConfirmAddressConfigureTabWidget::ConfirmAddressConfigureTabWidget(QWidget *pare
=
static_cast
<
PimCommon
::
SimpleStringListEditor
::
ButtonCode
>
(
PimCommon
::
SimpleStringListEditor
::
Add
|
PimCommon
::
SimpleStringListEditor
::
Remove
|
PimCommon
::
SimpleStringListEditor
::
Modify
);
mDomainNameListEditor
=
new
ConfirmAddressSimpleStringListEditor
(
groupBoxDomainName
,
buttonCode
,
i18n
(
"A&dd..."
),
i18n
(
"Re&move"
),
i18n
(
"Mod&ify..."
),
i18n
(
"Enter new domain name:"
));
i18n
(
"A&dd..."
),
i18n
(
"Re&move"
),
i18n
(
"Mod&ify..."
),
i18n
(
"Enter new domain name:"
));
mDomainNameListEditor
->
setObjectName
(
QStringLiteral
(
"domainnamelisteditor"
));
connect
(
mDomainNameListEditor
,
&
ConfirmAddressSimpleStringListEditor
::
changed
,
this
,
&
ConfirmAddressConfigureTabWidget
::
configureChanged
);
...
...
@@ -74,9 +74,9 @@ ConfirmAddressConfigureTabWidget::ConfirmAddressConfigureTabWidget(QWidget *pare
=
static_cast
<
PimCommon
::
SimpleStringListEditor
::
ButtonCode
>
(
PimCommon
::
SimpleStringListEditor
::
Add
|
PimCommon
::
SimpleStringListEditor
::
Remove
|
PimCommon
::
SimpleStringListEditor
::
Modify
);
mWhiteListEditor
=
new
ConfirmAddressSimpleStringListEditor
(
groupBoxWhiteList
,
buttonCode
,
i18n
(
"A&dd..."
),
i18n
(
"Re&move"
),
i18n
(
"Mod&ify..."
),
i18n
(
"Enter new email address:"
));
i18n
(
"A&dd..."
),
i18n
(
"Re&move"
),
i18n
(
"Mod&ify..."
),
i18n
(
"Enter new email address:"
));
mWhiteListEditor
->
setObjectName
(
QStringLiteral
(
"whitelisteditor"
));
layoutWhiteList
->
addWidget
(
mWhiteListEditor
);
connect
(
mWhiteListEditor
,
&
ConfirmAddressSimpleStringListEditor
::
changed
,
...
...
kmail/editorsendcheckplugins/confirm-address/confirmaddressemailentrydialog.cpp
View file @
f946d8ab
...
...
@@ -17,7 +17,6 @@
Boston, MA 02110-1301, USA.
*/
#include
"confirmaddressemailentrydialog.h"
#include
<KLocalizedString>
#include
<QHBoxLayout>
...
...
@@ -42,7 +41,6 @@ ConfirmAddressEmailEntryDialog::ConfirmAddressEmailEntryDialog(QWidget *parent)
KPIM
::
EmailValidator
*
emailValidator
=
new
KPIM
::
EmailValidator
(
this
);
mLineEdit
->
setValidator
(
emailValidator
);
QDialogButtonBox
*
buttons
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
,
this
);
buttons
->
setObjectName
(
QStringLiteral
(
"buttons"
));
mainLayout
->
addWidget
(
buttons
);
...
...
kmail/editorsendcheckplugins/confirm-address/confirmaddressemailentrydialog.h
View file @
f946d8ab
...
...
@@ -17,7 +17,6 @@
Boston, MA 02110-1301, USA.
*/
#ifndef CONFIRMADDRESSEMAILENTRYDIALOG_H
#define CONFIRMADDRESSEMAILENTRYDIALOG_H
...
...
kmail/editorsendcheckplugins/confirm-address/confirmaddresssimplestringlisteditor.cpp
View file @
f946d8ab
...
...
@@ -17,21 +17,18 @@
Boston, MA 02110-1301, USA.
*/
#include
"confirmaddresssimplestringlisteditor.h"
#include
"confirmaddressemailentrydialog.h"
#include
<KLocalizedString>
#include
<QPointer>
ConfirmAddressSimpleStringListEditor
::
ConfirmAddressSimpleStringListEditor
(
QWidget
*
parent
,
ButtonCode
buttons
,
const
QString
&
addLabel
,
const
QString
&
removeLabel
,
const
QString
&
modifyLabel
,
const
QString
&
addDialogLabel
)
ConfirmAddressSimpleStringListEditor
::
ConfirmAddressSimpleStringListEditor
(
QWidget
*
parent
,
ButtonCode
buttons
,
const
QString
&
addLabel
,
const
QString
&
removeLabel
,
const
QString
&
modifyLabel
,
const
QString
&
addDialogLabel
)
:
PimCommon
::
SimpleStringListEditor
(
parent
,
buttons
,
addLabel
,
removeLabel
,
modifyLabel
,
addDialogLabel
)
{
}
void
ConfirmAddressSimpleStringListEditor
::
addNewEntry
()
{
QPointer
<
ConfirmAddressEmailEntryDialog
>
dlg
=
new
ConfirmAddressEmailEntryDialog
(
this
);
...
...
@@ -42,11 +39,10 @@ void ConfirmAddressSimpleStringListEditor::addNewEntry()
delete
dlg
;
}
QString
ConfirmAddressSimpleStringListEditor
::
modifyEntry
(
const
QString
&
text
)
{
QString
newText
;
QPointer
<
ConfirmAddressEmailEntryDialog
>
dlg
=
new
ConfirmAddressEmailEntryDialog
(
this
);
QPointer
<
ConfirmAddressEmailEntryDialog
>
dlg
=
new
ConfirmAddressEmailEntryDialog
(
this
);
dlg
->
setWindowTitle
(
i18n
(
"Change Value"
));
dlg
->
setValue
(
text
);
if
(
dlg
->
exec
())
{
...
...
kmailtransport/sendmail/sendmailtransportplugin.cpp
View file @
f946d8ab
...
...
@@ -64,5 +64,3 @@ MailTransport::TransportJob *SendMailTransportPlugin::createTransportJob(MailTra
}
#include
"sendmailtransportplugin.moc"
plugins/messageviewer/bodypartformatter/autotests/diffhighlightertest.cpp
View file @
f946d8ab
...
...
@@ -26,7 +26,6 @@
DiffHighlighterTest
::
DiffHighlighterTest
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
QString
readDiffFile
(
const
QString
&
diffFile
)
...
...
@@ -67,17 +66,15 @@ void DiffHighlighterTest::shouldGenerateDiff()
// compare to reference file
QStringList
args
=
QStringList
()
<<
QStringLiteral
(
"-u"
)
<<
refFile
<<
generatedFile
;
<<
QStringLiteral
(
"-u"
)
<<
refFile
<<
generatedFile
;
QProcess
proc
;
proc
.
setProcessChannelMode
(
QProcess
::
ForwardedChannels
);
proc
.
start
(
QStringLiteral
(
"diff"
),
args
);
QVERIFY
(
proc
.
waitForFinished
());
QCOMPARE
(
proc
.
exitCode
(),
0
);
}
QTEST_MAIN
(
DiffHighlighterTest
)
plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp
View file @
f946d8ab
...
...
@@ -847,8 +847,8 @@ public:
}
if
(
KMessageBox
::
warningYesNo
(
nullptr
,
i18n
(
"%1
\n
%2"
,
warnStr
,
queryStr
))
==
KMessageBox
::
No
)
{
nullptr
,
i18n
(
"%1
\n
%2"
,
warnStr
,
queryStr
))
==
KMessageBox
::
No
)
{
return
true
;
}
}
...
...
@@ -1023,7 +1023,9 @@ public:
QDesktopServices
::
openUrl
(
QUrl
(
attachment
->
uri
()));
}
else
{
// put the attachment in a temporary file and launch it
QTemporaryFile
*
file
{
nullptr
};
QTemporaryFile
*
file
{
nullptr
};
QMimeDatabase
db
;
QStringList
patterns
=
db
.
mimeTypeForName
(
attachment
->
mimeType
()).
globPatterns
();
if
(
!
patterns
.
empty
())
{
...
...
@@ -1068,7 +1070,9 @@ public:
stat
=
job
->
exec
();
}
else
{
// put the attachment in a temporary file and save it
QTemporaryFile
*
file
{
nullptr
};
QTemporaryFile
*
file
{
nullptr
};
QMimeDatabase
db
;
QStringList
patterns
=
db
.
mimeTypeForName
(
a
->
mimeType
()).
globPatterns
();
if
(
!
patterns
.
empty
())
{
...
...
@@ -1087,7 +1091,6 @@ public:
auto
job
=
KIO
::
file_copy
(
QUrl
::
fromLocalFile
(
filename
),
QUrl
::
fromLocalFile
(
saveAsFile
));
stat
=
job
->
exec
();
}
return
stat
;
}
...
...
@@ -1172,9 +1175,9 @@ public:
}
delete
kontact
;
OrgKdeKorganizerCalendarInterface
*
iface
=
new
OrgKdeKorganizerCalendarInterface
(
QStringLiteral
(
"org.kde.korganizer"
),
QStringLiteral
(
"/Calendar"
),
QDBusConnection
::
sessionBus
(),
nullptr
);
OrgKdeKorganizerCalendarInterface
*
iface
=
new
OrgKdeKorganizerCalendarInterface
(
QStringLiteral
(
"org.kde.korganizer"
),
QStringLiteral
(
"/Calendar"
),
QDBusConnection
::
sessionBus
(),
nullptr
);
if
(
!
iface
->
isValid
())
{
qCDebug
(
TEXT_CALENDAR_LOG
)
<<
"Calendar interface is not valid! "
<<
iface
->
lastError
().
message
();
delete
iface
;
...
...
plugins/messageviewer/bodypartformatter/xdiff/diffhighlighter.cpp
View file @
f946d8ab
...
...
@@ -30,12 +30,11 @@ DiffHighlighter::DiffHighlighter()
setTheme
(
/*(palette().color(QPalette::Base).lightness() < 128)
? mRepo.defaultTheme(KSyntaxHighlighting::Repository::DarkTheme)*/
/*:*/
mRepo
.
defaultTheme
(
KSyntaxHighlighting
::
Repository
::
LightTheme
));
/*:*/
mRepo
.
defaultTheme
(
KSyntaxHighlighting
::
Repository
::
LightTheme
));
}
DiffHighlighter
::~
DiffHighlighter
()
{
}
void
DiffHighlighter
::
highlightDiff
(
const
QString
&
str
)
...
...
@@ -70,18 +69,24 @@ void DiffHighlighter::applyFormat(int offset, int length, const KSyntaxHighlight
{
if
(
!
format
.
isDefaultTextStyle
(
theme
()))
{
mOutputDiff
+=
QStringLiteral
(
"<span style=
\"
"
);
if
(
format
.
hasTextColor
(
theme
()))
if
(
format
.
hasTextColor
(
theme
()))
{
mOutputDiff
+=
QStringLiteral
(
"color:"
)
+
format
.
textColor
(
theme
()).
name
()
+
QStringLiteral
(
";"
);
if
(
format
.
hasBackgroundColor
(
theme
()))
}
if
(
format
.
hasBackgroundColor
(
theme
()))
{
mOutputDiff
+=
QStringLiteral
(
"background-color:"
)
+
format
.
backgroundColor
(
theme
()).
name
()
+
QStringLiteral
(
";"
);
if
(
format
.
isBold
(
theme
()))
}
if
(
format
.
isBold
(
theme
()))
{
mOutputDiff
+=
QStringLiteral
(
"font-weight:bold;"
);
if
(
format
.
isItalic
(
theme
()))
}
if
(
format
.
isItalic
(
theme
()))
{
mOutputDiff
+=
QStringLiteral
(
"font-style:italic;"
);
if
(
format
.
isUnderline
(
theme
()))
}
if
(
format
.
isUnderline
(
theme
()))
{
mOutputDiff
+=
QStringLiteral
(
"text-decoration:underline;"
);
if
(
format
.
isStrikeThrough
(
theme
()))
}
if
(
format
.
isStrikeThrough
(
theme
()))
{
mOutputDiff
+=
QStringLiteral
(
"text-decoration:line-through;"
);
}
mOutputDiff
+=
QStringLiteral
(
"
\"
>"
);
}
...
...
Prev
1
2
Next
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