Commit 01626861 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Clean up interface + remove unused code

parent 1d1da344
Pipeline #76360 failed with stage
in 26 minutes and 19 seconds
......@@ -102,10 +102,6 @@ void AccountWidget::setupWidgets()
connect(leaveOnServerCountSpin, QOverload<int>::of(&QSpinBox::valueChanged), this, &AccountWidget::slotLeaveOnServerCountChanged);
connect(leaveOnServerSizeCheck, &QCheckBox::toggled, this, &AccountWidget::slotEnableLeaveOnServerSize);
connect(filterOnServerSizeSpin, QOverload<int>::of(&QSpinBox::valueChanged), this, &AccountWidget::slotFilterOnServerSizeChanged);
connect(filterOnServerCheck, &QCheckBox::toggled, filterOnServerSizeSpin, &QSpinBox::setEnabled);
connect(filterOnServerCheck, &QCheckBox::clicked, this, &AccountWidget::slotFilterOnServerClicked);
connect(checkCapabilities, &QPushButton::clicked, this, &AccountWidget::slotCheckPopCapabilities);
encryptionButtonGroup = new QButtonGroup(page);
encryptionButtonGroup->addButton(encryptionNone, Transport::EnumEncryption::None);
......@@ -123,9 +119,6 @@ void AccountWidget::setupWidgets()
connect(usePipeliningCheck, &QCheckBox::clicked, this, &AccountWidget::slotPipeliningClicked);
// FIXME: Hide widgets which are not supported yet
filterOnServerCheck->hide();
filterOnServerSizeSpin->hide();
}
void AccountWidget::loadSettings()
......@@ -154,8 +147,6 @@ void AccountWidget::loadSettings()
leaveOnServerSizeCheck->setEnabled(mSettings.leaveOnServer());
leaveOnServerSizeCheck->setChecked(mSettings.leaveOnServerSize() >= 1);
leaveOnServerSizeSpin->setValue(mSettings.leaveOnServerSize() >= 1 ? mSettings.leaveOnServerSize() : 10);
filterOnServerCheck->setChecked(mSettings.filterOnServer());
filterOnServerSizeSpin->setValue(mSettings.filterCheckSize());
intervalCheck->setChecked(mSettings.intervalCheckEnabled());
intervalSpin->setValue(mSettings.intervalCheckInterval());
intervalSpin->setEnabled(mSettings.intervalCheckEnabled());
......@@ -262,21 +253,6 @@ void AccountWidget::slotLeaveOnServerClicked()
}
}
void AccountWidget::slotFilterOnServerClicked()
{
if (mServerTest && !mServerTest->capabilities().contains(ServerTest::Top) && filterOnServerCheck->isChecked()) {
KMessageBox::information(topLevelWidget(),
i18n("The server does not seem to support "
"fetching message headers, but this is a "
"requirement for filtering messages on the "
"server.\n"
"Since some servers do not correctly "
"announce their capabilities you still "
"have the possibility to turn filtering "
"messages on the server on."));
}
}
void AccountWidget::slotPipeliningClicked()
{
if (usePipeliningCheck->isChecked()) {
......@@ -422,19 +398,6 @@ void AccountWidget::enablePopFeatures()
"fetched messages on the server on."));
}
if (mServerTest && !mServerTest->capabilities().contains(ServerTest::Top) && filterOnServerCheck->isChecked()) {
filterOnServerCheck->setChecked(false);
KMessageBox::information(topLevelWidget(),
i18n("The server does not seem to support "
"fetching message headers, but this is a "
"requirement for filtering messages on the "
"server; therefore, this option has been "
"disabled.\n"
"Since some servers do not correctly "
"announce their capabilities you still "
"have the possibility to turn filtering "
"messages on the server on."));
}
}
static void addAuthenticationItem(QComboBox *combo, int authenticationType)
......@@ -465,11 +428,6 @@ void AccountWidget::slotLeaveOnServerCountChanged(int value)
leaveOnServerCountSpin->setSuffix(i18np(" message", " messages", value));
}
void AccountWidget::slotFilterOnServerSizeChanged(int value)
{
filterOnServerSizeSpin->setSuffix(i18np(" byte", " bytes", value));
}
void AccountWidget::checkHighest(QButtonGroup *btnGroup)
{
QListIterator<QAbstractButton *> it(btnGroup->buttons());
......@@ -508,8 +466,6 @@ void AccountWidget::saveSettings()
mSettings.setLeaveOnServerDays(leaveOnServerCheck->isChecked() ? (leaveOnServerDaysCheck->isChecked() ? leaveOnServerDaysSpin->value() : -1) : 0);
mSettings.setLeaveOnServerCount(leaveOnServerCheck->isChecked() ? (leaveOnServerCountCheck->isChecked() ? leaveOnServerCountSpin->value() : -1) : 0);
mSettings.setLeaveOnServerSize(leaveOnServerCheck->isChecked() ? (leaveOnServerSizeCheck->isChecked() ? leaveOnServerSizeSpin->value() : -1) : 0);
mSettings.setFilterOnServer(filterOnServerCheck->isChecked());
mSettings.setFilterCheckSize(filterOnServerSizeSpin->value());
mSettings.setTargetCollection(folderRequester->collection().id());
mSettings.save();
......
......@@ -41,14 +41,12 @@ private Q_SLOTS:
void slotEnableLeaveOnServerDays(bool state);
void slotEnableLeaveOnServerCount(bool state);
void slotEnableLeaveOnServerSize(bool state);
void slotFilterOnServerClicked();
void slotPipeliningClicked();
void slotPopEncryptionChanged(QAbstractButton *button);
void slotCheckPopCapabilities();
void slotPopCapabilities(const QVector<int> &);
void slotLeaveOnServerDaysChanged(int value);
void slotLeaveOnServerCountChanged(int value);
void slotFilterOnServerSizeChanged(int value);
void targetCollectionReceived(Akonadi::Collection::List collections);
void localFolderRequestJobFinished(KJob *job);
......
This diff is collapsed.
Supports Markdown
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