Commit 2d92acae authored by Nicolas Fella's avatar Nicolas Fella

[kcm] Drop 'Enable bluetooth integration' setting

Summary: It controls whether the bluedevil kded module is loaded. I don't see any use case for it. If one really really needs to disable the kded module this can be done from the kded KCM.

Reviewers: #plasma, drosca

Reviewed By: drosca

Subscribers: broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D27572
parent 6750fd6d
......@@ -70,12 +70,8 @@ KCMBlueDevilGlobal::KCMBlueDevilGlobal(QWidget *parent, const QVariantList&)
addConfig(FileReceiverSettings::self(), this);
addConfig(GlobalSettings::self(), this);
m_isEnabled = m_ui->kcfg_enableGlobalBluetooth->isChecked();
receiveFilesChanged(m_ui->kcfg_enabled->isChecked());
enableBluetoothChanged(m_ui->kcfg_enableGlobalBluetooth->isChecked());
connect(m_ui->kcfg_enabled, &QCheckBox::toggled, this, &KCMBlueDevilGlobal::receiveFilesChanged);
connect(m_ui->kcfg_enableGlobalBluetooth, &QCheckBox::toggled, this, &KCMBlueDevilGlobal::enableBluetoothChanged);
// Initialize BluezQt
m_manager = new BluezQt::Manager(this);
......@@ -84,21 +80,6 @@ KCMBlueDevilGlobal::KCMBlueDevilGlobal(QWidget *parent, const QVariantList&)
connect(job, &BluezQt::InitManagerJob::result, this, &KCMBlueDevilGlobal::initJobResult);
}
void KCMBlueDevilGlobal::save()
{
KCModule::save();
if (!m_isEnabled && m_ui->kcfg_enableGlobalBluetooth->isChecked()) {
m_systemCheck->kded()->setModuleAutoloading(QStringLiteral("bluedevil"), true);
m_systemCheck->kded()->loadModule(QStringLiteral("bluedevil"));
} else if (m_isEnabled && !m_ui->kcfg_enableGlobalBluetooth->isChecked()) {
m_systemCheck->kded()->setModuleAutoloading(QStringLiteral("bluedevil"), false);
m_systemCheck->kded()->unloadModule(QStringLiteral("bluedevil"));
}
m_isEnabled = m_ui->kcfg_enableGlobalBluetooth->isChecked();
}
void KCMBlueDevilGlobal::initJobResult(BluezQt::InitManagerJob *job)
{
if (job->error()) {
......@@ -113,19 +94,10 @@ void KCMBlueDevilGlobal::initJobResult(BluezQt::InitManagerJob *job)
void KCMBlueDevilGlobal::receiveFilesChanged(bool enable)
{
enable = m_ui->kcfg_enableGlobalBluetooth->isChecked() && enable;
m_ui->lbl_saveFiles->setEnabled(enable);
m_ui->lbl_autoAccept->setEnabled(enable);
m_ui->kcfg_saveUrl->setEnabled(enable);
m_ui->kcfg_autoAccept->setEnabled(enable);
}
void KCMBlueDevilGlobal::enableBluetoothChanged(bool enable)
{
m_ui->lbl_receivingFiles->setEnabled(enable);
m_ui->kcfg_enabled->setEnabled(enable);
receiveFilesChanged(m_ui->kcfg_enabled->isChecked());
}
#include "global.moc"
......@@ -40,18 +40,14 @@ class KCMBlueDevilGlobal : public KCModule
public:
KCMBlueDevilGlobal(QWidget *parent, const QVariantList&);
void save() override;
private Q_SLOTS:
void initJobResult(BluezQt::InitManagerJob *job);
void receiveFilesChanged(bool enable);
void enableBluetoothChanged(bool enable);
private:
SystemCheck *m_systemCheck;
Ui::Global *m_ui;
BluezQt::Manager *m_manager;
bool m_isEnabled;
};
#endif // BLUEDEVILGLOBAL_H
......@@ -11,29 +11,6 @@
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="kcfg_enableGlobalBluetooth">
<property name="text">
<string>Enable Bluetooth integration</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="lbl_receivingFiles">
<property name="text">
......
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