Commit d5a08db0 authored by Frederik Gladhorn's avatar Frederik Gladhorn

Simple cleanup

parent 01297182
...@@ -39,11 +39,6 @@ static bool sizeLessThan(const QSize &sizeA, const QSize &sizeB) ...@@ -39,11 +39,6 @@ static bool sizeLessThan(const QSize &sizeA, const QSize &sizeB)
ResolutionSlider::ResolutionSlider(const KScreen::OutputPtr &output, QWidget *parent) ResolutionSlider::ResolutionSlider(const KScreen::OutputPtr &output, QWidget *parent)
: QWidget(parent) : QWidget(parent)
, mOutput(output) , mOutput(output)
, mSmallestLabel(nullptr)
, mBiggestLabel(nullptr)
, mCurrentLabel(nullptr)
, mSlider(nullptr)
, mComboBox(nullptr)
{ {
connect(output.data(), &KScreen::Output::currentModeIdChanged, connect(output.data(), &KScreen::Output::currentModeIdChanged,
this, &ResolutionSlider::slotOutputModeChanged); this, &ResolutionSlider::slotOutputModeChanged);
......
...@@ -37,7 +37,7 @@ class ResolutionSlider : public QWidget ...@@ -37,7 +37,7 @@ class ResolutionSlider : public QWidget
public: public:
explicit ResolutionSlider(const KScreen::OutputPtr &output, QWidget *parent = nullptr); explicit ResolutionSlider(const KScreen::OutputPtr &output, QWidget *parent = nullptr);
virtual ~ResolutionSlider(); ~ResolutionSlider() override;
QSize currentResolution() const; QSize currentResolution() const;
......
...@@ -70,12 +70,12 @@ void ScalingConfig::load() ...@@ -70,12 +70,12 @@ void ScalingConfig::load()
void ScalingConfig::accept() void ScalingConfig::accept()
{ {
if (scaleFactor() == m_initialScalingFactor) { if (qFuzzyCompare(scaleFactor(), m_initialScalingFactor)) {
QDialog::accept(); QDialog::accept();
return; return;
} }
const qreal scalingFactor = scaleFactor(); const qreal scalingFactor = scaleFactor();
//save to config //save to config
auto config = KSharedConfig::openConfig(QStringLiteral("kdeglobals")); auto config = KSharedConfig::openConfig(QStringLiteral("kdeglobals"));
config->group("KScreen").writeEntry("ScaleFactor", scalingFactor); config->group("KScreen").writeEntry("ScaleFactor", scalingFactor);
...@@ -90,8 +90,8 @@ void ScalingConfig::accept() ...@@ -90,8 +90,8 @@ void ScalingConfig::accept()
} }
config->group("KScreen").writeEntry("ScreenScaleFactors", screenFactors); config->group("KScreen").writeEntry("ScreenScaleFactors", screenFactors);
KConfig fontConfig("kcmfonts"); KConfig fontConfig(QStringLiteral("kcmfonts"));
auto fontConfigGroup = fontConfig.group("General"); auto fontConfigGroup = fontConfig.group("General");
if (qFuzzyCompare(scalingFactor, 1.0)) { if (qFuzzyCompare(scalingFactor, 1.0)) {
......
...@@ -31,7 +31,7 @@ class ScalingConfig : public QDialog ...@@ -31,7 +31,7 @@ class ScalingConfig : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit ScalingConfig(const KScreen::OutputList &outputList, QWidget* parent = 0); explicit ScalingConfig(const KScreen::OutputList &outputList, QWidget* parent = 0);
virtual ~ScalingConfig(); ~ScalingConfig() override;
protected: protected:
void accept() Q_DECL_OVERRIDE; void accept() Q_DECL_OVERRIDE;
......
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