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
PIM Messagelib
Commits
4de6bf22
Commit
4de6bf22
authored
Jun 05, 2020
by
Laurent Montel
Browse files
Fix some clazy warning
parent
1905f49a
Pipeline
#22594
failed with stage
in 60 minutes and 1 second
Changes
25
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
messagecomposer/autotests/recipientseditortest.cpp
View file @
4de6bf22
...
...
@@ -63,9 +63,9 @@ void RecipientsEditorTest::test_addLineOnCommaPress()
QApplication
::
setActiveWindow
(
&
editor
);
QVERIFY
(
QTest
::
qWaitForWindowActive
(
&
editor
));
Q
COMPARE
(
editor
.
recipients
().
size
(),
0
);
Q
VERIFY
(
editor
.
recipients
().
isEmpty
()
);
auto
lineEdit
=
editor
.
lines
().
f
irst
()
->
findChild
<
MessageComposer
::
RecipientLineEdit
*>
();
auto
lineEdit
=
editor
.
lines
().
constF
irst
()
->
findChild
<
MessageComposer
::
RecipientLineEdit
*>
();
lineEdit
->
setFocus
();
// Simulate typing email address
...
...
messagecomposer/src/attachment/attachmentcontrollerbase.cpp
View file @
4de6bf22
...
...
@@ -246,7 +246,7 @@ void AttachmentControllerBase::Private::viewSelectedAttachments()
void
AttachmentControllerBase
::
Private
::
editSelectedAttachment
()
{
Q_ASSERT
(
selectedParts
.
count
()
==
1
);
q
->
editAttachment
(
selectedParts
.
f
irst
(),
MessageViewer
::
EditorWatcher
::
NoOpenWithDialog
);
q
->
editAttachment
(
selectedParts
.
constF
irst
(),
MessageViewer
::
EditorWatcher
::
NoOpenWithDialog
);
}
void
AttachmentControllerBase
::
Private
::
editSelectedAttachmentWith
()
...
...
@@ -268,19 +268,19 @@ void AttachmentControllerBase::Private::removeSelectedAttachments()
void
AttachmentControllerBase
::
Private
::
saveSelectedAttachmentAs
()
{
Q_ASSERT
(
selectedParts
.
count
()
==
1
);
q
->
saveAttachmentAs
(
selectedParts
.
f
irst
());
q
->
saveAttachmentAs
(
selectedParts
.
constF
irst
());
}
void
AttachmentControllerBase
::
Private
::
selectedAttachmentProperties
()
{
Q_ASSERT
(
selectedParts
.
count
()
==
1
);
q
->
attachmentProperties
(
selectedParts
.
f
irst
());
q
->
attachmentProperties
(
selectedParts
.
constF
irst
());
}
void
AttachmentControllerBase
::
Private
::
reloadAttachment
()
{
Q_ASSERT
(
selectedParts
.
count
()
==
1
);
AttachmentUpdateJob
*
ajob
=
new
AttachmentUpdateJob
(
selectedParts
.
f
irst
(),
q
);
AttachmentUpdateJob
*
ajob
=
new
AttachmentUpdateJob
(
selectedParts
.
constF
irst
(),
q
);
connect
(
ajob
,
&
AttachmentUpdateJob
::
result
,
q
,
[
this
](
KJob
*
job
)
{
updateJobResult
(
job
);
});
...
...
@@ -659,7 +659,7 @@ void AttachmentControllerBase::showContextMenu()
)
{
menu
.
addAction
(
d
->
viewContextAction
);
}
d
->
createOpenWithMenu
(
&
menu
,
d
->
selectedParts
.
f
irst
());
d
->
createOpenWithMenu
(
&
menu
,
d
->
selectedParts
.
constF
irst
());
}
menu
.
addAction
(
d
->
openContextAction
);
}
...
...
messagecomposer/src/composer-ng/richtextcomposerng.cpp
View file @
4de6bf22
...
...
@@ -378,7 +378,8 @@ void RichTextComposerNg::insertSignature(const KIdentityManagement::Signature &s
// We added the text of the signature above, now it is time to add the images as well.
if
(
signature
.
isInlinedHtml
())
{
for
(
const
KIdentityManagement
::
Signature
::
EmbeddedImagePtr
&
image
:
signature
.
embeddedImages
())
{
const
QList
<
KIdentityManagement
::
Signature
::
EmbeddedImagePtr
>
embeddedImages
=
signature
.
embeddedImages
();
for
(
const
KIdentityManagement
::
Signature
::
EmbeddedImagePtr
&
image
:
embeddedImages
)
{
composerControler
()
->
composerImages
()
->
loadImage
(
image
->
image
,
image
->
name
,
image
->
name
);
}
}
...
...
messagecomposer/src/composer/composerviewbase.cpp
View file @
4de6bf22
...
...
@@ -1186,7 +1186,7 @@ void ComposerViewBase::slotAutoSaveComposeResult(KJob *job)
// The messages were composed successfully. Only save the first message, there should
// only be one anyway, since crypto is disabled.
qCDebug
(
MESSAGECOMPOSER_LOG
)
<<
"NoError."
;
writeAutoSaveToDisk
(
composer
->
resultMessages
().
f
irst
());
writeAutoSaveToDisk
(
composer
->
resultMessages
().
constF
irst
());
Q_ASSERT
(
composer
->
resultMessages
().
size
()
==
1
);
if
(
m_autoSaveInterval
>
0
)
{
...
...
messagecomposer/src/composer/composerviewinterface.cpp
View file @
4de6bf22
...
...
@@ -67,11 +67,15 @@ MessageComposer::ComposerAttachmentInterface ComposerViewInterface::attachments(
{
MessageComposer
::
ComposerAttachmentInterface
attachmentInterface
;
if
(
mComposerView
)
{
attachmentInterface
.
setCount
(
mComposerView
->
attachmentModel
()
->
attachments
().
count
());
const
int
countElement
=
mComposerView
->
attachmentModel
()
->
attachments
().
count
();
attachmentInterface
.
setCount
(
countElement
);
QStringList
fileNames
;
QStringList
nameAndSize
;
QStringList
names
;
fileNames
.
reserve
(
countElement
);
nameAndSize
.
reserve
(
countElement
);
names
.
reserve
(
countElement
);
for
(
const
MessageCore
::
AttachmentPart
::
Ptr
&
attachment
:
mComposerView
->
attachmentModel
()
->
attachments
())
{
fileNames
.
append
(
attachment
->
fileName
());
names
.
append
(
attachment
->
name
());
...
...
messagecomposer/src/job/attachmentjob.cpp
View file @
4de6bf22
...
...
@@ -139,6 +139,6 @@ void AttachmentJob::process()
Q_D
(
AttachmentJob
);
// The content has been created by our subjob.
Q_ASSERT
(
d
->
subjobContents
.
count
()
==
1
);
d
->
resultContent
=
d
->
subjobContents
.
f
irst
();
d
->
resultContent
=
d
->
subjobContents
.
constF
irst
();
emitResult
();
}
messagecomposer/src/job/encryptjob.cpp
View file @
4de6bf22
...
...
@@ -173,7 +173,7 @@ void EncryptJob::doStart()
// and we want to use that
if
(
!
d
->
content
||
!
d
->
content
->
hasContent
())
{
if
(
d
->
subjobContents
.
size
()
==
1
)
{
d
->
content
=
d
->
subjobContents
.
f
irst
();
d
->
content
=
d
->
subjobContents
.
constF
irst
();
}
}
...
...
@@ -204,7 +204,7 @@ void EncryptJob::slotResult(KJob *job)
if
(
subjobs
().
size
()
==
2
)
{
auto
pjob
=
static_cast
<
ProtectedHeadersJob
*>
(
subjobs
().
last
());
if
(
pjob
)
{
auto
cjob
=
dynamic
_cast
<
ContentJobBase
*>
(
job
);
auto
cjob
=
qobject
_cast
<
ContentJobBase
*>
(
job
);
Q_ASSERT
(
cjob
);
pjob
->
setContent
(
cjob
->
content
());
}
...
...
@@ -221,7 +221,7 @@ void EncryptJob::process()
// and we want to use that
if
(
!
d
->
content
||
!
d
->
content
->
hasContent
())
{
Q_ASSERT
(
d
->
subjobContents
.
size
()
==
1
);
d
->
content
=
d
->
subjobContents
.
f
irst
();
d
->
content
=
d
->
subjobContents
.
constF
irst
();
}
const
QGpgME
::
Protocol
*
proto
=
nullptr
;
...
...
messagecomposer/src/job/maintextjob.cpp
View file @
4de6bf22
...
...
@@ -286,6 +286,6 @@ void MainTextJob::process()
Q_D
(
MainTextJob
);
// The content has been created by our subjob.
Q_ASSERT
(
d
->
subjobContents
.
count
()
==
1
);
d
->
resultContent
=
d
->
subjobContents
.
f
irst
();
d
->
resultContent
=
d
->
subjobContents
.
constF
irst
();
emitResult
();
}
messagecomposer/src/job/signjob.cpp
View file @
4de6bf22
...
...
@@ -167,7 +167,6 @@ void SignJob::doStart()
void
SignJob
::
slotResult
(
KJob
*
job
)
{
Q_D
(
SignJob
);
if
(
error
())
{
ContentJobBase
::
slotResult
(
job
);
return
;
...
...
@@ -175,7 +174,7 @@ void SignJob::slotResult(KJob *job)
if
(
subjobs
().
size
()
==
2
)
{
auto
pjob
=
static_cast
<
ProtectedHeadersJob
*>
(
subjobs
().
last
());
if
(
pjob
)
{
auto
cjob
=
dynamic
_cast
<
ContentJobBase
*>
(
job
);
auto
cjob
=
qobject
_cast
<
ContentJobBase
*>
(
job
);
Q_ASSERT
(
cjob
);
pjob
->
setContent
(
cjob
->
content
());
}
...
...
@@ -193,7 +192,7 @@ void SignJob::process()
// and we want to use that
if
(
!
d
->
content
)
{
Q_ASSERT
(
d
->
subjobContents
.
size
()
==
1
);
d
->
content
=
d
->
subjobContents
.
f
irst
();
d
->
content
=
d
->
subjobContents
.
constF
irst
();
}
//d->resultContent = new KMime::Content;
...
...
messagelist/src/core/manager.cpp
View file @
4de6bf22
...
...
@@ -415,7 +415,7 @@ const SortOrder Manager::sortOrderForStorageModel(const StorageModel *storageMod
return
ret
;
}
void
Manager
::
saveSortOrderForStorageModel
(
const
StorageModel
*
storageModel
,
const
SortOrder
&
order
,
bool
storageUsesPrivateSortOrder
)
void
Manager
::
saveSortOrderForStorageModel
(
const
StorageModel
*
storageModel
,
SortOrder
order
,
bool
storageUsesPrivateSortOrder
)
{
KConfigGroup
conf
(
MessageListSettings
::
self
()
->
config
(),
MessageList
::
Util
::
storageModelSortOrderGroup
());
order
.
writeConfig
(
conf
,
storageModel
->
id
(),
storageUsesPrivateSortOrder
);
...
...
messagelist/src/core/manager.h
View file @
4de6bf22
...
...
@@ -115,7 +115,7 @@ public:
// sort order management
const
SortOrder
sortOrderForStorageModel
(
const
StorageModel
*
storageModel
,
bool
*
storageUsesPrivateSortOrder
);
void
saveSortOrderForStorageModel
(
const
StorageModel
*
storageModel
,
const
SortOrder
&
order
,
bool
storageUsesPrivateSortOrder
);
void
saveSortOrderForStorageModel
(
const
StorageModel
*
storageModel
,
SortOrder
order
,
bool
storageUsesPrivateSortOrder
);
// theme sets management
const
Theme
*
themeForStorageModel
(
const
Akonadi
::
Collection
&
col
,
bool
*
storageUsesPrivateTheme
);
...
...
messagelist/src/core/model.cpp
View file @
4de6bf22
...
...
@@ -3446,7 +3446,7 @@ ModelPrivate::ViewItemJobResult ModelPrivate::viewItemJobStepInternalForJobPass1
return
ViewItemJobCompleted
;
}
ModelPrivate
::
ViewItemJobResult
ModelPrivate
::
viewItemJobStepInternalForJob
(
ViewItemJob
*
job
,
const
QElapsedTimer
&
elapsedTimer
)
ModelPrivate
::
ViewItemJobResult
ModelPrivate
::
viewItemJobStepInternalForJob
(
ViewItemJob
*
job
,
QElapsedTimer
elapsedTimer
)
{
// This function does a timed chunk of work for a single Fill View job.
// It attempts to process messages until a timeout forces it to return to the caller.
...
...
messagelist/src/core/model_p.h
View file @
4de6bf22
...
...
@@ -79,7 +79,7 @@ public:
ViewItemJobInterrupted
};
ViewItemJobResult
viewItemJobStepInternal
();
ViewItemJobResult
viewItemJobStepInternalForJob
(
ViewItemJob
*
job
,
const
QElapsedTimer
&
elapsedTimer
);
ViewItemJobResult
viewItemJobStepInternalForJob
(
ViewItemJob
*
job
,
QElapsedTimer
elapsedTimer
);
// FIXME: Those look like they should be made virtual in some job class! -> Refactor
ViewItemJobResult
viewItemJobStepInternalForJobPass1Fill
(
ViewItemJob
*
job
,
QElapsedTimer
elapsedTimer
);
...
...
messagelist/src/pane.cpp
View file @
4de6bf22
...
...
@@ -129,7 +129,7 @@ Pane::Pane(bool restoreSession, QAbstractItemModel *model, QItemSelectionModel *
const
QAbstractProxyModel
*
proxyModel
=
qobject_cast
<
const
QAbstractProxyModel
*>
(
d
->
mSelectionModel
->
model
());
while
(
proxyModel
)
{
if
(
static_cast
<
const
QAbstractItemModel
*>
(
proxyModel
)
==
d
->
mModel
)
{
if
(
proxyModel
==
d
->
mModel
)
{
break
;
}
...
...
@@ -138,7 +138,7 @@ Pane::Pane(bool restoreSession, QAbstractItemModel *model, QItemSelectionModel *
if
(
!
nextProxyModel
)
{
// It's the final model in the chain, so it is necessarily the sourceModel.
Q_ASSERT
(
qobject_cast
<
const
QAbstractItemModel
*>
(
proxyModel
->
sourceModel
()
)
==
d
->
mModel
);
Q_ASSERT
(
proxyModel
->
sourceModel
()
==
d
->
mModel
);
break
;
}
proxyModel
=
nextProxyModel
;
...
...
messagelist/src/storagemodel.cpp
View file @
4de6bf22
...
...
@@ -148,6 +148,7 @@ Collection::List StorageModel::displayedCollections() const
Collection
::
List
collections
;
const
QModelIndexList
indexes
=
d
->
mSelectionModel
->
selectedRows
();
collections
.
reserve
(
indexes
.
count
());
for
(
const
QModelIndex
&
index
:
indexes
)
{
Collection
c
=
index
.
data
(
EntityTreeModel
::
CollectionRole
).
value
<
Collection
>
();
if
(
c
.
isValid
())
{
...
...
@@ -163,6 +164,7 @@ QString StorageModel::id() const
QStringList
ids
;
const
QModelIndexList
indexes
=
d
->
mSelectionModel
->
selectedRows
();
ids
.
reserve
(
indexes
.
count
());
for
(
const
QModelIndex
&
index
:
indexes
)
{
Collection
c
=
index
.
data
(
EntityTreeModel
::
CollectionRole
).
value
<
Collection
>
();
if
(
c
.
isValid
())
{
...
...
messageviewer/src/dkim-verify/dkimauthenticationstatusinfo.cpp
View file @
4de6bf22
...
...
@@ -231,7 +231,8 @@ QDebug operator <<(QDebug d, const DKIMAuthenticationStatusInfo &t)
d
<<
"mAuthservId: "
<<
t
.
authservId
();
d
<<
"mReasonSpec: "
<<
t
.
reasonSpec
();
d
<<
"mAuthVersion: "
<<
t
.
authVersion
()
<<
'\n'
;
for
(
const
DKIMAuthenticationStatusInfo
::
AuthStatusInfo
&
info
:
t
.
listAuthStatusInfo
())
{
const
auto
listAuthStatusInfo
=
t
.
listAuthStatusInfo
();
for
(
const
DKIMAuthenticationStatusInfo
::
AuthStatusInfo
&
info
:
listAuthStatusInfo
)
{
d
<<
"mListAuthStatusInfo: "
<<
info
.
method
<<
" : "
<<
info
.
result
<<
" : "
<<
info
.
methodVersion
<<
" : "
<<
info
.
reason
<<
'\n'
;
d
<<
"Property:"
<<
'\n'
;
if
(
!
info
.
smtp
.
isEmpty
())
{
...
...
messageviewer/src/dkim-verify/dkimmanagerkeywidget.cpp
View file @
4de6bf22
...
...
@@ -73,7 +73,7 @@ void DKIMManagerKeyWidget::customContextMenuRequested(const QPoint &)
QTreeWidgetItem
*
item
=
mTreeWidget
->
currentItem
();
QMenu
menu
(
this
);
if
(
item
)
{
menu
.
addAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-copy"
)),
i18n
(
"Copy Key"
),
this
,
[
this
,
item
]()
{
menu
.
addAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-copy"
)),
i18n
(
"Copy Key"
),
this
,
[
item
]()
{
QApplication
::
clipboard
()
->
setText
(
item
->
text
(
2
));
});
menu
.
addSeparator
();
...
...
messageviewer/src/dkim-verify/dkimmanageruleswidget.cpp
View file @
4de6bf22
...
...
@@ -112,7 +112,9 @@ void DKIMManageRulesWidget::loadSettings()
void
DKIMManageRulesWidget
::
saveSettings
()
{
QVector
<
MessageViewer
::
DKIMRule
>
rules
;
for
(
int
i
=
0
,
total
=
mTreeWidget
->
topLevelItemCount
();
i
<
total
;
++
i
)
{
const
int
total
=
mTreeWidget
->
topLevelItemCount
();
rules
.
reserve
(
total
);
for
(
int
i
=
0
;
i
<
total
;
++
i
)
{
QTreeWidgetItem
*
item
=
mTreeWidget
->
topLevelItem
(
i
);
DKIMManageRulesWidgetItem
*
ruleItem
=
static_cast
<
DKIMManageRulesWidgetItem
*>
(
item
);
rules
.
append
(
ruleItem
->
rule
());
...
...
messageviewer/src/header/grantleeheaderformatter.cpp
View file @
4de6bf22
...
...
@@ -253,7 +253,7 @@ public:
QVariant
format
(
KMime
::
Message
*
message
,
MimeTreeParser
::
NodeHelper
*
nodeHelper
)
override
{
const
auto
value
=
nodeHelper
->
mailHeaderAsAddressList
(
header
.
constData
(),
message
);
return
QVariant
::
fromValue
(
static_cast
<
const
KMime
::
Headers
::
Generics
::
AddressList
*>
(
value
)
)
;
return
QVariant
::
fromValue
(
value
);
}
protected:
...
...
messageviewer/src/messagepartthemes/default/autotests/quotehtmltest.cpp
View file @
4de6bf22
...
...
@@ -194,7 +194,7 @@ void QuoteHtmlTest::testQuoteHtml_data()
"<div class=
\"
quotelevel2
\"
><div dir=
\"
ltr
\"
><span class=
\"
quotemarks
\"
>>></span><font color=
\"
#007000
\"
>quote2</font></div></div><blockquote><div class=
\"
quotelevelmark
\"
><a href=
\"
kmail:levelquote?-1
\"
><img src=
\"
%2
\"
/></a></div><br/></blockquote><div class=
\"
quotelevelmark
\"
><a href=
\"
kmail:levelquote?1
\"
><img src=
\"
%1
\"
/></a></div>"
"<div class=
\"
quotelevel2
\"
><div dir=
\"
ltr
\"
><span class=
\"
quotemarks
\"
>>></span><font color=
\"
#007000
\"
>new quote2</font></div></div></blockquote><div class=
\"
quotelevelmark
\"
><a href=
\"
kmail:levelquote?0
\"
><img src=
\"
%1
\"
/></a></div>"
"<div class=
\"
quotelevel1
\"
><div dir=
\"
ltr
\"
><span class=
\"
quotemarks
\"
>></span><font color=
\"
#008000
\"
>new quote1</font></div></div></blockquote><div class=
\"
noquote
\"
><div dir=
\"
ltr
\"
>new text</div></div>"
)
.
arg
(
mCollapseIcon
).
arg
(
mExpandIcon
)
.
arg
(
mCollapseIcon
,
mExpandIcon
)
<<
true
<<
2
;
QTest
::
newRow
(
"bug-369072-expand-quotelevel1"
)
<<
QStringLiteral
(
...
...
@@ -203,7 +203,7 @@ void QuoteHtmlTest::testQuoteHtml_data()
"<div class=
\"
quotelevel1
\"
><div dir=
\"
ltr
\"
><span class=
\"
quotemarks
\"
>></span><font color=
\"
#008000
\"
>quote1</font></div></div><blockquote><div class=
\"
quotelevelmark
\"
><a href=
\"
kmail:levelquote?-1
\"
><img src=
\"
%2
\"
/></a></div><br/>"
"<blockquote></blockquote></blockquote><div class=
\"
quotelevelmark
\"
><a href=
\"
kmail:levelquote?0
\"
><img src=
\"
%1
\"
/></a></div>"
"<div class=
\"
quotelevel1
\"
><div dir=
\"
ltr
\"
><span class=
\"
quotemarks
\"
>></span><font color=
\"
#008000
\"
>new quote1</font></div></div></blockquote><div class=
\"
noquote
\"
><div dir=
\"
ltr
\"
>new text</div></div>"
)
.
arg
(
mCollapseIcon
).
arg
(
mExpandIcon
)
.
arg
(
mCollapseIcon
,
mExpandIcon
)
<<
true
<<
1
;
QTest
::
newRow
(
"bug-370452"
)
<<
QStringLiteral
(
"test
\n
> blo
\n
>
\n
>
\n
>
\n
> bla
\n
new text"
)
...
...
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