Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KMail
Commits
e1e3ac2b
Commit
e1e3ac2b
authored
Sep 15, 2020
by
Laurent Montel
😁
Browse files
Rename method as messageItem
parent
d0d53896
Pipeline
#34348
passed with stage
in 36 minutes and 44 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/kmmainwidget.cpp
View file @
e1e3ac2b
...
...
@@ -2325,10 +2325,10 @@ void KMMainWidget::slotSaveAttachments()
// so that KMCommand doesn't download it.
KMSaveAttachmentsCommand
*
saveCommand
=
nullptr
;
if
(
mMsgView
&&
selectedMessages
.
size
()
==
1
&&
mMsgView
->
message
().
hasPayload
<
KMime
::
Message
::
Ptr
>
()
&&
selectedMessages
.
first
().
id
()
==
mMsgView
->
message
().
id
())
{
&&
mMsgView
->
message
Item
().
hasPayload
<
KMime
::
Message
::
Ptr
>
()
&&
selectedMessages
.
first
().
id
()
==
mMsgView
->
message
Item
().
id
())
{
Akonadi
::
Item
dummyItem
;
dummyItem
.
setPayload
<
KMime
::
Message
::
Ptr
>
(
mMsgView
->
message
().
payload
<
KMime
::
Message
::
Ptr
>
());
dummyItem
.
setPayload
<
KMime
::
Message
::
Ptr
>
(
mMsgView
->
message
Item
().
payload
<
KMime
::
Message
::
Ptr
>
());
saveCommand
=
new
KMSaveAttachmentsCommand
(
this
,
dummyItem
,
mMsgView
->
viewer
());
}
else
{
saveCommand
=
new
KMSaveAttachmentsCommand
(
this
,
selectedMessages
,
mMsgView
->
viewer
());
...
...
src/kmreadermainwin.cpp
View file @
e1e3ac2b
...
...
@@ -99,7 +99,7 @@ void KMReaderMainWin::initKMReaderMainWin()
statusBar
()
->
addPermanentWidget
(
mZoomLabelIndicator
);
setZoomChanged
(
mReaderWin
->
viewer
()
->
webViewZoomFactor
());
statusBar
()
->
addPermanentWidget
(
mReaderWin
->
viewer
()
->
dkimWidgetInfo
());
if
(
!
mReaderWin
->
message
().
isValid
())
{
if
(
!
mReaderWin
->
message
Item
().
isValid
())
{
menuBar
()
->
hide
();
toolBar
(
QStringLiteral
(
"mainToolBar"
))
->
hide
();
}
else
{
...
...
@@ -316,21 +316,21 @@ void KMReaderMainWin::slotTrashMessage()
void
KMReaderMainWin
::
slotForwardInlineMsg
()
{
if
(
!
mReaderWin
->
message
().
hasPayload
<
KMime
::
Message
::
Ptr
>
())
{
if
(
!
mReaderWin
->
message
Item
().
hasPayload
<
KMime
::
Message
::
Ptr
>
())
{
return
;
}
KMCommand
*
command
=
nullptr
;
const
Akonadi
::
Collection
parentCol
=
mReaderWin
->
message
().
parentCollection
();
const
Akonadi
::
Collection
parentCol
=
mReaderWin
->
message
Item
().
parentCollection
();
if
(
parentCol
.
isValid
())
{
QSharedPointer
<
FolderSettings
>
fd
=
FolderSettings
::
forCollection
(
parentCol
,
false
);
if
(
fd
)
{
command
=
new
KMForwardCommand
(
this
,
mReaderWin
->
message
(),
command
=
new
KMForwardCommand
(
this
,
mReaderWin
->
message
Item
(),
fd
->
identity
(),
QString
(),
mReaderWin
->
copyText
());
}
else
{
command
=
new
KMForwardCommand
(
this
,
mReaderWin
->
message
(),
0
,
QString
(),
mReaderWin
->
copyText
());
command
=
new
KMForwardCommand
(
this
,
mReaderWin
->
message
Item
(),
0
,
QString
(),
mReaderWin
->
copyText
());
}
}
else
{
command
=
new
KMForwardCommand
(
this
,
mReaderWin
->
message
(),
0
,
QString
(),
mReaderWin
->
copyText
());
command
=
new
KMForwardCommand
(
this
,
mReaderWin
->
message
Item
(),
0
,
QString
(),
mReaderWin
->
copyText
());
}
connect
(
command
,
&
KMTrashMsgCommand
::
completed
,
this
,
&
KMReaderMainWin
::
slotReplyOrForwardFinished
);
command
->
start
();
...
...
@@ -338,21 +338,21 @@ void KMReaderMainWin::slotForwardInlineMsg()
void
KMReaderMainWin
::
slotForwardAttachedMessage
()
{
if
(
!
mReaderWin
->
message
().
hasPayload
<
KMime
::
Message
::
Ptr
>
())
{
if
(
!
mReaderWin
->
message
Item
().
hasPayload
<
KMime
::
Message
::
Ptr
>
())
{
return
;
}
KMCommand
*
command
=
nullptr
;
const
Akonadi
::
Collection
parentCol
=
mReaderWin
->
message
().
parentCollection
();
const
Akonadi
::
Collection
parentCol
=
mReaderWin
->
message
Item
().
parentCollection
();
if
(
parentCol
.
isValid
())
{
QSharedPointer
<
FolderSettings
>
fd
=
FolderSettings
::
forCollection
(
parentCol
,
false
);
if
(
fd
)
{
command
=
new
KMForwardAttachedCommand
(
this
,
mReaderWin
->
message
(),
command
=
new
KMForwardAttachedCommand
(
this
,
mReaderWin
->
message
Item
(),
fd
->
identity
());
}
else
{
command
=
new
KMForwardAttachedCommand
(
this
,
mReaderWin
->
message
());
command
=
new
KMForwardAttachedCommand
(
this
,
mReaderWin
->
message
Item
());
}
}
else
{
command
=
new
KMForwardAttachedCommand
(
this
,
mReaderWin
->
message
());
command
=
new
KMForwardAttachedCommand
(
this
,
mReaderWin
->
message
Item
());
}
connect
(
command
,
&
KMTrashMsgCommand
::
completed
,
this
,
&
KMReaderMainWin
::
slotReplyOrForwardFinished
);
...
...
@@ -361,7 +361,7 @@ void KMReaderMainWin::slotForwardAttachedMessage()
void
KMReaderMainWin
::
slotRedirectMessage
()
{
const
Akonadi
::
Item
currentItem
=
mReaderWin
->
message
();
const
Akonadi
::
Item
currentItem
=
mReaderWin
->
message
Item
();
if
(
!
currentItem
.
hasPayload
<
KMime
::
Message
::
Ptr
>
())
{
return
;
}
...
...
@@ -372,7 +372,7 @@ void KMReaderMainWin::slotRedirectMessage()
void
KMReaderMainWin
::
slotCustomReplyToMsg
(
const
QString
&
tmpl
)
{
const
Akonadi
::
Item
currentItem
=
mReaderWin
->
message
();
const
Akonadi
::
Item
currentItem
=
mReaderWin
->
message
Item
();
if
(
!
currentItem
.
hasPayload
<
KMime
::
Message
::
Ptr
>
())
{
return
;
}
...
...
@@ -388,7 +388,7 @@ void KMReaderMainWin::slotCustomReplyToMsg(const QString &tmpl)
void
KMReaderMainWin
::
slotCustomReplyAllToMsg
(
const
QString
&
tmpl
)
{
const
Akonadi
::
Item
currentItem
=
mReaderWin
->
message
();
const
Akonadi
::
Item
currentItem
=
mReaderWin
->
message
Item
();
if
(
!
currentItem
.
hasPayload
<
KMime
::
Message
::
Ptr
>
())
{
return
;
}
...
...
@@ -405,7 +405,7 @@ void KMReaderMainWin::slotCustomReplyAllToMsg(const QString &tmpl)
void
KMReaderMainWin
::
slotCustomForwardMsg
(
const
QString
&
tmpl
)
{
const
Akonadi
::
Item
currentItem
=
mReaderWin
->
message
();
const
Akonadi
::
Item
currentItem
=
mReaderWin
->
message
Item
();
if
(
!
currentItem
.
hasPayload
<
KMime
::
Message
::
Ptr
>
())
{
return
;
}
...
...
@@ -477,8 +477,8 @@ void KMReaderMainWin::setupAccel()
this
,
&
KMReaderMainWin
::
slotSelectMoreMessageTagList
);
mTagActionManager
->
createActions
();
if
(
mReaderWin
->
message
().
isValid
())
{
mTagActionManager
->
updateActionStates
(
1
,
mReaderWin
->
message
());
if
(
mReaderWin
->
message
Item
().
isValid
())
{
mTagActionManager
->
updateActionStates
(
1
,
mReaderWin
->
message
Item
());
}
mHideMenuBarAction
=
KStandardAction
::
showMenubar
(
this
,
&
KMReaderMainWin
::
slotToggleMenubar
,
actionCollection
());
mHideMenuBarAction
->
setChecked
(
KMailSettings
::
self
()
->
readerShowMenuBar
());
...
...
@@ -495,7 +495,7 @@ void KMReaderMainWin::setupAccel()
void
KMReaderMainWin
::
slotToggleMenubar
(
bool
dontShowWarning
)
{
if
(
!
mReaderWin
->
message
().
isValid
())
{
if
(
!
mReaderWin
->
message
Item
().
isValid
())
{
return
;
}
if
(
menuBar
())
{
...
...
src/kmreaderwin.cpp
View file @
e1e3ac2b
...
...
@@ -411,7 +411,7 @@ bool KMReaderWin::htmlLoadExternal()
return
mViewer
->
htmlLoadExternal
();
}
Akonadi
::
Item
KMReaderWin
::
message
()
const
Akonadi
::
Item
KMReaderWin
::
message
Item
()
const
{
return
mViewer
->
messageItem
();
}
...
...
@@ -423,14 +423,14 @@ QWidget *KMReaderWin::mainWindow() const
void
KMReaderWin
::
slotMailtoCompose
()
{
KMCommand
*
command
=
new
KMMailtoComposeCommand
(
urlClicked
(),
message
());
KMCommand
*
command
=
new
KMMailtoComposeCommand
(
urlClicked
(),
message
Item
());
command
->
start
();
}
void
KMReaderWin
::
slotMailtoForward
()
{
KMCommand
*
command
=
new
KMMailtoForwardCommand
(
mMainWindow
,
urlClicked
(),
message
());
message
Item
());
command
->
start
();
}
...
...
@@ -513,7 +513,7 @@ void KMReaderWin::slotSaveImageOnDisk()
void
KMReaderWin
::
slotMailtoReply
()
{
KMMailtoReplyCommand
*
command
=
new
KMMailtoReplyCommand
(
mMainWindow
,
urlClicked
(),
message
(),
copyText
());
message
Item
(),
copyText
());
command
->
setReplyAsHtml
(
htmlMail
());
command
->
start
();
}
...
...
@@ -743,7 +743,7 @@ bool KMReaderWin::printSelectedText(bool preview)
::
MessageComposer
::
Composer
*
composer
=
new
::
MessageComposer
::
Composer
;
composer
->
textPart
()
->
setCleanPlainText
(
str
);
composer
->
textPart
()
->
setWrappedPlainText
(
str
);
KMime
::
Message
::
Ptr
messagePtr
=
message
().
payload
<
KMime
::
Message
::
Ptr
>
();
KMime
::
Message
::
Ptr
messagePtr
=
message
Item
().
payload
<
KMime
::
Message
::
Ptr
>
();
composer
->
infoPart
()
->
setFrom
(
messagePtr
->
from
()
->
asUnicodeString
());
composer
->
infoPart
()
->
setTo
(
QStringList
()
<<
messagePtr
->
to
()
->
asUnicodeString
());
composer
->
infoPart
()
->
setCc
(
QStringList
()
<<
messagePtr
->
cc
()
->
asUnicodeString
());
...
...
src/kmreaderwin.h
View file @
e1e3ac2b
...
...
@@ -143,7 +143,7 @@ public:
QAction
*
addToExistingContactAction
()
const
;
Akonadi
::
Item
message
()
const
;
Akonadi
::
Item
message
Item
()
const
;
QWidget
*
mainWindow
()
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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