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
KDE PIM Add-ons
Commits
fe1445f9
Commit
fe1445f9
authored
Dec 14, 2021
by
Laurent Montel
Browse files
Fix update buttons
parent
73011821
Pipeline
#109919
passed with stage
in 9 minutes and 52 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
plugins/messageviewerconfigureplugins/foldersettings/folderconfiguretreewidget.cpp
View file @
fe1445f9
...
...
@@ -64,19 +64,20 @@ FolderConfigureTreeWidget::FolderConfigureTreeWidget(QWidget *parent)
connect
(
mUnSelectFolder
,
&
QPushButton
::
clicked
,
this
,
[
this
]()
{
changeFolderSelection
(
false
);
});
connect
(
checkable
->
selectionModel
(),
&
QItemSelectionModel
::
selectionChanged
,
this
,
&
FolderConfigureTreeWidget
::
slotSelectionChanged
);
connect
(
mFolderTreeWidget
->
folderTreeView
()
->
selectionModel
(),
&
QItemSelectionModel
::
currentChanged
,
this
,
&
FolderConfigureTreeWidget
::
slotSelectionChanged
);
}
FolderConfigureTreeWidget
::~
FolderConfigureTreeWidget
()
=
default
;
void
FolderConfigureTreeWidget
::
slotSelectionChanged
(
const
QItemSelection
&
selected
,
const
QItemSelection
&
deselected
)
void
FolderConfigureTreeWidget
::
slotSelectionChanged
()
{
qDebug
()
<<
"ssssssssssss"
;
Q_UNUSED
(
deselected
);
const
auto
selectedModelItems
{
selected
.
indexes
()};
const
QModelIndexList
indexes
=
mFolderTreeWidget
->
folderTreeView
()
->
selectionModel
()
->
selection
().
indexes
();
bool
checkedFolder
=
false
;
bool
uncheckedFolder
=
false
;
for
(
const
QModelIndex
&
selectedIndex
:
selectedModelItem
s
)
{
for
(
const
QModelIndex
&
selectedIndex
:
indexe
s
)
{
bool
b
=
mFolderSettingFilterProxyModel
->
data
(
selectedIndex
,
Qt
::
CheckStateRole
).
toBool
();
if
(
b
)
{
checkedFolder
=
true
;
...
...
@@ -84,8 +85,8 @@ void FolderConfigureTreeWidget::slotSelectionChanged(const QItemSelection &selec
uncheckedFolder
=
true
;
}
}
mSelectFolder
->
setEnabled
(
checkedFolder
);
mUnSelectFolder
->
setEnabled
(
un
checkedFolder
);
mSelectFolder
->
setEnabled
(
un
checkedFolder
);
mUnSelectFolder
->
setEnabled
(
checkedFolder
);
}
void
FolderConfigureTreeWidget
::
changeFolderSelection
(
bool
select
)
...
...
@@ -94,6 +95,7 @@ void FolderConfigureTreeWidget::changeFolderSelection(bool select)
for
(
const
QModelIndex
&
selectedIndex
:
indexes
)
{
mFolderSettingFilterProxyModel
->
setData
(
selectedIndex
,
select
?
Qt
::
Checked
:
Qt
::
Unchecked
,
Qt
::
CheckStateRole
);
}
slotSelectionChanged
();
}
Akonadi
::
Collection
::
List
FolderConfigureTreeWidget
::
listCollections
()
const
...
...
plugins/messageviewerconfigureplugins/foldersettings/folderconfiguretreewidget.h
View file @
fe1445f9
...
...
@@ -26,7 +26,7 @@ public:
private:
void
changeFolderSelection
(
bool
select
);
void
slotSelectionChanged
(
const
QItemSelection
&
selected
,
const
QItemSelection
&
deselected
);
void
slotSelectionChanged
();
FolderSettingFilterProxyModel
*
const
mFolderSettingFilterProxyModel
;
MailCommon
::
FolderTreeWidget
*
const
mFolderTreeWidget
;
QPushButton
*
mSelectFolder
=
nullptr
;
...
...
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