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
9dd3a449
Commit
9dd3a449
authored
Oct 12, 2021
by
Laurent Montel
😁
Browse files
merge two methods
parent
df6790e4
Pipeline
#88168
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/kmmainwidget.cpp
View file @
9dd3a449
...
...
@@ -480,17 +480,8 @@ void KMMainWidget::slotFolderChanged(const Akonadi::Collection &collection)
if
(
mCurrentCollection
==
collection
)
{
return
;
}
folderSelected
(
collection
);
if
(
collection
.
cachePolicy
().
syncOnDemand
())
{
AgentManager
::
self
()
->
synchronizeCollection
(
collection
,
false
);
}
mMsgActions
->
setCurrentMessage
(
Akonadi
::
Item
());
Q_EMIT
captionChangeRequest
(
MailCommon
::
Util
::
fullCollectionPath
(
collection
));
}
// Called by slotFolderChanged (no particular reason for this method to be split out)
void
KMMainWidget
::
folderSelected
(
const
Akonadi
::
Collection
&
col
)
{
// Store previous collection
mHistorySwitchFolderManager
->
addHistory
(
mCurrentCollection
,
collection
);
if
(
mGoToFirstUnreadMessageInSelectedFolder
)
{
// the default action has been overridden from outside
mPreSelectionMode
=
MessageList
::
Core
::
PreSelectFirstUnreadCentered
;
...
...
@@ -521,7 +512,7 @@ void KMMainWidget::folderSelected(const Akonadi::Collection &col)
if
(
mMsgView
)
{
mMsgView
->
clear
(
true
);
}
const
bool
newFolder
=
mCurrentCollection
!=
col
;
const
bool
newFolder
=
mCurrentCollection
!=
col
lection
;
// Delete any pending timer, if needed it will be recreated below
delete
mShowBusySplashTimer
;
...
...
@@ -531,8 +522,8 @@ void KMMainWidget::folderSelected(const Akonadi::Collection &col)
writeFolderConfig
();
}
mCurrentFolderSettings
=
FolderSettings
::
forCollection
(
col
);
mCurrentCollection
=
col
;
mCurrentFolderSettings
=
FolderSettings
::
forCollection
(
col
lection
);
mCurrentCollection
=
col
lection
;
readFolderConfig
();
if
(
mMsgView
)
{
...
...
@@ -551,6 +542,11 @@ void KMMainWidget::folderSelected(const Akonadi::Collection &col)
// settings. At this point the selection model hasn't been updated yet to the user's new choice, so it would load
// the old folder settings instead.
QTimer
::
singleShot
(
0
,
this
,
&
KMMainWidget
::
slotShowSelectedFolderInPane
);
if
(
collection
.
cachePolicy
().
syncOnDemand
())
{
AgentManager
::
self
()
->
synchronizeCollection
(
collection
,
false
);
}
mMsgActions
->
setCurrentMessage
(
Akonadi
::
Item
());
Q_EMIT
captionChangeRequest
(
MailCommon
::
Util
::
fullCollectionPath
(
collection
));
}
void
KMMainWidget
::
slotShowSelectedFolderInPane
()
...
...
src/kmmainwidget.h
View file @
9dd3a449
...
...
@@ -260,11 +260,6 @@ private:
void
updateMessageMenu
();
void
slotRemoveDuplicates
();
/**
Select the given folder
If the folder is 0 the intro is shown
*/
void
folderSelected
(
const
Akonadi
::
Collection
&
col
);
/**
Start a timer to update message actions
...
...
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