Commit 623e33f5 authored by Laurent Montel's avatar Laurent Montel 😁

Fix save/load

parent d5f78505
......@@ -199,19 +199,15 @@ void NewMailNotifierSelectCollectionWidget::forceStatus(const QModelIndex &paren
}
}
void NewMailNotifierSelectCollectionWidget::updateCollectionsRecursive(const QModelIndex &parent)
void NewMailNotifierSelectCollectionWidget::updateCollectionsRecursive()
{
#if 0
const int nbCol = mCheckProxy->rowCount(parent);
for (int i = 0; i < nbCol; ++i) {
const QModelIndex child = mCheckProxy->index(i, 0, parent);
Akonadi::Collection collection =
mNewMailNotifierProxyModel->data(child, Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
QHashIterator<Akonadi::Collection, bool> i(mNewMailNotifierProxyModel->notificationCollection());
while (i.hasNext()) {
i.next();
Akonadi::Collection collection = i.key();
Akonadi::NewMailNotifierAttribute *attr = collection.attribute<Akonadi::NewMailNotifierAttribute>();
Akonadi::CollectionModifyJob *modifyJob = Q_NULLPTR;
const bool selected = (mCheckProxy->data(child, Qt::CheckStateRole).value<int>() != 0);
const bool selected = i.value();
if (selected && attr && attr->ignoreNewMail()) {
collection.removeAttribute<Akonadi::NewMailNotifierAttribute>();
modifyJob = new Akonadi::CollectionModifyJob(collection);
......@@ -226,9 +222,7 @@ void NewMailNotifierSelectCollectionWidget::updateCollectionsRecursive(const QMo
if (modifyJob) {
connect(modifyJob, &Akonadi::CollectionModifyJob::finished, this, &NewMailNotifierSelectCollectionWidget::slotModifyJobDone);
}
updateCollectionsRecursive(child);
}
#endif
}
void NewMailNotifierSelectCollectionWidget::slotModifyJobDone(KJob *job)
......
......@@ -59,7 +59,7 @@ public:
explicit NewMailNotifierSelectCollectionWidget(QWidget *parent = Q_NULLPTR);
~NewMailNotifierSelectCollectionWidget();
void updateCollectionsRecursive(const QModelIndex &parent);
void updateCollectionsRecursive();
private Q_SLOTS:
void slotSelectAllCollections();
......
......@@ -212,7 +212,7 @@ void NewMailNotifierSettingsDialog::slotHelpLinkClicked(const QString &)
void NewMailNotifierSettingsDialog::slotOkClicked()
{
mSelectCollection->updateCollectionsRecursive(QModelIndex());
mSelectCollection->updateCollectionsRecursive();
NewMailNotifierAgentSettings::setShowPhoto(mShowPhoto->isChecked());
NewMailNotifierAgentSettings::setShowFrom(mShowFrom->isChecked());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment