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
a644941d
Commit
a644941d
authored
May 15, 2021
by
Laurent Montel
😁
Browse files
Use KRecentFilesMenu directly
parent
04ba77a3
Pipeline
#62038
canceled with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/kmail_part.rc
View file @
a644941d
...
...
@@ -2,7 +2,7 @@
the same menu entries at the same place in KMail and Kontact -->
<!DOCTYPE gui>
<gui version="54
7
" name="kmmainwin" translationDomain="kmail">
<gui version="54
8
" name="kmmainwin" translationDomain="kmail">
<MenuBar>
<Menu noMerge="1" name="file" >
<text>&File</text>
...
...
@@ -17,7 +17,7 @@
</Menu>
<Separator/>
<Action name="file_open" />
<Action name="file_open_recent" />
<Action name="
kmail_
file_open_recent" />
<Action name="file_save_as" />
<Separator/>
<Action name="file_export_pdf" />
...
...
@@ -150,6 +150,7 @@
<text>&Message</text>
<Action name="new_message" />
<Action name="post_message" />
<Action name="new_to_recipients" />
<Separator/>
<Action name="reply" />
<Action name="reply_all" />
...
...
src/kmmainwidget.cpp
View file @
a644941d
...
...
@@ -145,7 +145,7 @@
#include <KConfigGroup>
#include <KNotification>
#include <KRecentFiles
Action
>
#include <KRecentFiles
Menu
>
#include <KStandardAction>
#include <KStringHandler>
#include <KToggleAction>
...
...
@@ -2794,10 +2794,9 @@ void KMMainWidget::setupActions()
mOpenAction
=
KStandardAction
::
open
(
this
,
&
KMMainWidget
::
slotOpenMsg
,
actionCollection
());
mOpenRecentAction
=
KStandardAction
::
openRecent
(
this
,
&
KMMainWidget
::
slotOpenRecentMessage
,
actionCollection
());
KConfigGroup
grp
=
mConfig
->
group
(
QStringLiteral
(
"Recent Files"
));
mOpenRecentAction
->
loadEntries
(
grp
);
mOpenRecentMenu
=
new
KRecentFilesMenu
(
this
);
actionCollection
()
->
addAction
(
QStringLiteral
(
"kmail_file_open_recent"
),
mOpenRecentMenu
->
menuAction
());
connect
(
mOpenRecentMenu
,
&
KRecentFilesMenu
::
urlTriggered
,
this
,
&
KMMainWidget
::
slotOpenRecentMessage
);
{
auto
action
=
new
QAction
(
i18n
(
"&Expire All Folders"
),
this
);
actionCollection
()
->
addAction
(
QStringLiteral
(
"expire_all_folders"
),
action
);
...
...
@@ -4539,12 +4538,9 @@ void KMMainWidget::slotOpenRecentMessage(const QUrl &url)
openCommand
->
start
();
}
void
KMMainWidget
::
addRecentFile
(
const
QUrl
&
mU
rl
)
void
KMMainWidget
::
addRecentFile
(
const
QUrl
&
u
rl
)
{
mOpenRecentAction
->
addUrl
(
mUrl
);
KConfigGroup
grp
=
mConfig
->
group
(
QStringLiteral
(
"Recent Files"
));
mOpenRecentAction
->
saveEntries
(
grp
);
grp
.
sync
();
mOpenRecentMenu
->
addUrl
(
url
);
}
void
KMMainWidget
::
slotMoveMessageToTrash
()
...
...
src/kmmainwidget.h
View file @
a644941d
...
...
@@ -58,7 +58,7 @@ class CollectionPane;
class
KMCommand
;
class
KMMoveCommand
;
class
KMTrashMsgCommand
;
class
KRecentFiles
Action
;
class
KRecentFiles
Menu
;
class
ManageShowCollectionProperties
;
class
KActionMenuTransport
;
class
KActionMenuAccount
;
...
...
@@ -638,7 +638,7 @@ private:
QPointer
<
MailCommon
::
FolderSelectionDialog
>
mSelectFromAllFoldersDialog
;
QAction
*
mServerSideSubscription
=
nullptr
;
QAction
*
mAccountSettings
=
nullptr
;
KRecentFiles
Action
*
mOpenRecent
Action
=
nullptr
;
KRecentFiles
Menu
*
mOpenRecent
Menu
=
nullptr
;
QPointer
<
KSieveUi
::
ManageSieveScriptsDialog
>
mManageSieveDialog
;
QAction
*
mQuickSearchAction
=
nullptr
;
DisplayMessageFormatActionMenu
*
mDisplayMessageFormatMenu
=
nullptr
;
...
...
src/kmmainwin.rc
View file @
a644941d
...
...
@@ -2,7 +2,7 @@
the same menu entries at the same place in KMail and Kontact -->
<!DOCTYPE gui>
<gui version="54
7
" name="kmmainwin" translationDomain="kmail">
<gui version="54
8
" name="kmmainwin" translationDomain="kmail">
<MenuBar>
<Menu noMerge="1" name="file" >
<text>&File</text>
...
...
@@ -17,7 +17,7 @@
</Menu>
<Separator/>
<Action name="file_open" />
<Action name="file_open_recent" />
<Action name="
kmail_
file_open_recent" />
<Action name="file_save_as" />
<Separator/>
<Action name="file_export_pdf" />
...
...
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