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
cdfad542
Commit
cdfad542
authored
Dec 01, 2021
by
Laurent Montel
😁
Browse files
Fix update "move all to trash" action.
Bug found by Allen
parent
db0a735e
Pipeline
#103795
passed with stage
in 7 minutes and 53 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/kmmainwidget.cpp
View file @
cdfad542
...
...
@@ -3890,10 +3890,7 @@ void KMMainWidget::slotAkonadiStandardActionUpdated()
&&
folderWithContent
);
}
if
(
QAction
*
act
=
mAkonadiStandardActionManager
->
action
(
Akonadi
::
StandardMailActionManager
::
MoveAllToTrash
))
{
act
->
setEnabled
(
folderWithContent
&&
(
mCurrentFolderSettings
->
count
()
>
0
)
&&
mCurrentFolderSettings
->
canDeleteMessages
());
act
->
setText
((
mCurrentFolderSettings
&&
CommonKernel
->
folderIsTrash
(
mCurrentCollection
))
?
i18n
(
"E&mpty Trash"
)
:
i18n
(
"&Move All Messages to Trash"
));
}
updateMoveAllToTrash
();
QList
<
QAction
*>
addToFavorite
;
QAction
*
actionAddToFavoriteCollections
=
akonadiStandardAction
(
Akonadi
::
StandardActionManager
::
AddToFavoriteCollections
);
...
...
@@ -3992,6 +3989,8 @@ void KMMainWidget::updateFolderMenu()
const
bool
isInTrashFolder
=
(
mCurrentFolderSettings
&&
CommonKernel
->
folderIsTrash
(
mCurrentCollection
));
QAction
*
moveToTrash
=
akonadiStandardAction
(
Akonadi
::
StandardMailActionManager
::
MoveToTrash
);
updateMoveAllToTrash
();
KMail
::
Util
::
setActionTrashOrDelete
(
moveToTrash
,
isInTrashFolder
);
mTrashThreadAction
->
setIcon
(
isInTrashFolder
?
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-delete-shred"
))
:
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-delete"
)));
...
...
@@ -4040,6 +4039,15 @@ void KMMainWidget::updateFolderMenu()
}
}
void
KMMainWidget
::
updateMoveAllToTrash
()
{
if
(
QAction
*
act
=
mAkonadiStandardActionManager
->
action
(
Akonadi
::
StandardMailActionManager
::
MoveAllToTrash
))
{
const
bool
folderWithContent
=
mCurrentFolderSettings
&&
!
mCurrentFolderSettings
->
isStructural
();
act
->
setEnabled
(
folderWithContent
&&
(
mCurrentFolderSettings
->
count
()
>
0
)
&&
mCurrentFolderSettings
->
canDeleteMessages
());
act
->
setText
((
mCurrentFolderSettings
&&
CommonKernel
->
folderIsTrash
(
mCurrentCollection
))
?
i18n
(
"E&mpty Trash"
)
:
i18n
(
"&Move All Messages to Trash"
));
}
}
//-----------------------------------------------------------------------------
void
KMMainWidget
::
slotIntro
()
{
...
...
src/kmmainwidget.h
View file @
cdfad542
...
...
@@ -532,6 +532,7 @@ private:
void
slotHistorySwitchFolder
(
const
Akonadi
::
Collection
&
collection
);
void
redoSwitchFolder
();
void
undoSwitchFolder
();
void
updateMoveAllToTrash
();
// Message actions
QAction
*
mDeleteAction
=
nullptr
;
...
...
Write
Preview
Supports
Markdown
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