Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit a221f94c authored by Laurent Montel's avatar Laurent Montel 😁

Fix save settings

parent 0093ec0f
......@@ -41,7 +41,6 @@ FollowUpReminderInfoDialog::FollowUpReminderInfoDialog(QWidget *parent)
QHBoxLayout *mainLayout = new QHBoxLayout( mainWidget );
mainLayout->setSpacing( KDialog::spacingHint() );
mainLayout->setMargin( KDialog::marginHint() );
connect(this, SIGNAL(okClicked()), SLOT(slotSave()));
mWidget = new FollowUpReminderInfoWidget;
mWidget->setObjectName(QLatin1String("FollowUpReminderInfoWidget"));
......@@ -94,11 +93,6 @@ void FollowUpReminderInfoDialog::writeConfig()
mWidget->saveTreeWidgetHeader(group);
}
void FollowUpReminderInfoDialog::slotSave()
{
mWidget->save();
}
void FollowUpReminderInfoDialog::load()
{
mWidget->load();
......
......@@ -39,8 +39,6 @@ public:
QList<qint32> listRemoveId() const;
private slots:
void slotSave();
private:
void readConfig();
void writeConfig();
......
......@@ -148,10 +148,10 @@ void FollowUpReminderInfoWidget::createOrUpdateItem(FollowUpReminder::FollowUpRe
void FollowUpReminderInfoWidget::save()
bool FollowUpReminderInfoWidget::save()
{
if (!mChanged)
return;
return false;
KSharedConfig::Ptr config = KGlobal::config();
// first, delete all filter groups:
......@@ -174,7 +174,7 @@ void FollowUpReminderInfoWidget::save()
KConfigGroup general = config->group(QLatin1String("General"));
general.writeEntry("Number", i);
config->sync();
config->reparseConfiguration();
return true;
}
void FollowUpReminderInfoWidget::customContextMenuRequested(const QPoint &pos)
......
......@@ -53,7 +53,7 @@ public:
void setInfo(const QList<FollowUpReminder::FollowUpReminderInfo *> &infoList);
void save();
bool save();
void load();
......
......@@ -71,12 +71,18 @@ void FollowUpReminderManager::load(bool forceReloadConfig)
mInitialize = true;
if (!mNoAnswerDialog.data()) {
mNoAnswerDialog = new FollowUpReminderNoAnswerDialog;
connect(mNoAnswerDialog, SIGNAL(needToReparseConfiguration()), this, SLOT(slotReparseConfiguration()));
}
mNoAnswerDialog->setInfo(noAnswerList);
mNoAnswerDialog->show();
}
}
void FollowUpReminderManager::slotReparseConfiguration()
{
load(true);
}
void FollowUpReminderManager::checkFollowUp(const Akonadi::Item &item, const Akonadi::Collection &col)
{
if (mFollowUpReminderInfoList.isEmpty()) {
......
......@@ -42,6 +42,7 @@ private slots:
void slotFinishTaskDone();
void slotFinishTaskFailed();
void slotReparseConfiguration();
private:
void answerReceived(const QString &from);
QString infoToStr(FollowUpReminder::FollowUpReminderInfo *info);
......
......@@ -40,7 +40,7 @@ FollowUpReminderNoAnswerDialog::FollowUpReminderNoAnswerDialog(QWidget *parent)
QVBoxLayout *vbox = new QVBoxLayout(w);
QLabel *lab = new QLabel(i18n("You still wait an answer about this mail:"));
vbox->addWidget(lab);
connect(this, SIGNAL(okClicked()), SLOT(slotSave()));
mWidget = new FollowUpReminderInfoWidget;
mWidget->setObjectName(QLatin1String("FollowUpReminderInfoWidget"));
vbox->addWidget(mWidget);
......@@ -74,3 +74,10 @@ void FollowUpReminderNoAnswerDialog::writeConfig()
group.writeEntry( "Size", size() );
mWidget->saveTreeWidgetHeader(group);
}
void FollowUpReminderNoAnswerDialog::slotSave()
{
if (mWidget->save()) {
Q_EMIT needToReparseConfiguration();
}
}
......@@ -32,6 +32,12 @@ public:
void setInfo(const QList<FollowUpReminder::FollowUpReminderInfo *> &info);
Q_SIGNALS:
void needToReparseConfiguration();
private slots:
void slotSave();
private:
void readConfig();
void writeConfig();
......
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