pull/2/head
cutefishd 4 years ago
parent b50ce88c28
commit 928d428e11

@ -1,58 +0,0 @@
{
"files.associations": {
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"ostream": "cpp",
"ranges": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"typeinfo": "cpp",
"variant": "cpp"
}
}

5
debian/changelog vendored

@ -0,0 +1,5 @@
libcutefish (0.1) UNRELEASED; urgency=low
* Initial release (CutefishOS) <cutefishos@foxmail.com>
-- CutefishOS <cutefishos@foxmail.com> Thu, 16 Oct 2014 17:22:15 +0200

1
debian/compat vendored

@ -0,0 +1 @@
9

24
debian/control vendored

@ -0,0 +1,24 @@
Source: libcutefish
Section: devel
Priority: optional
Maintainer: CutefishOS <cutefishos@foxmail.com>
Build-Depends: cmake,
debhelper (>= 9),
extra-cmake-modules,
libkf5networkmanagerqt-dev,
libkf5kio-dev,
modemmanager-qt-dev,
libqt5sensors5-dev,
qtbase5-dev,
qtdeclarative5-dev,
qtquickcontrols2-5-dev,
qttools5-dev,
qttools5-dev-tools
Standards-Version: 4.5.0
Homepage: https://github.com/cutefishos/qt-plugins
Package: libcutefish
Architecture: any
Depends: ${misc:Depends},
${shlibs:Depends}
Description: CutefishOS Library

3
debian/copyright vendored

@ -0,0 +1,3 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: calamares
Source: <url://example.com>

9
debian/rules vendored

@ -0,0 +1,9 @@
#!/usr/bin/make -f
export QT_SELECT=5
%:
dh $@
override_dh_auto_configure:
dh_auto_configure -- -DEMBED_TRANSLATIONS=ON -DBUILD_TESTING=ON

@ -0,0 +1 @@
3.0 (quilt)

@ -17,11 +17,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "control.h" #include "control.h"
#include "globals.h" #include "globals.h"
#include <QStringBuilder> #include <KDirWatch>
#include <QDir>
#include <QFile> #include <QFile>
#include <QFileSystemWatcher>
#include <QJsonDocument> #include <QJsonDocument>
#include <QDir> #include <QStringBuilder>
#include <kscreen/config.h> #include <kscreen/config.h>
#include <kscreen/output.h> #include <kscreen/output.h>
@ -38,14 +38,15 @@ void Control::activateWatcher()
if (m_watcher) { if (m_watcher) {
return; return;
} }
m_watcher = new QFileSystemWatcher({filePath()}, this); m_watcher = new KDirWatch(this);
connect(m_watcher, &QFileSystemWatcher::fileChanged, this, [this]() { m_watcher->addFile(filePath());
connect(m_watcher, &KDirWatch::dirty, this, [this]() {
readFile(); readFile();
Q_EMIT changed(); Q_EMIT changed();
}); });
} }
QFileSystemWatcher* Control::watcher() const KDirWatch *Control::watcher() const
{ {
return m_watcher; return m_watcher;
} }
@ -61,19 +62,15 @@ bool Control::writeFile()
return true; return true;
} }
if (!QDir().mkpath(dirPath())) { if (!QDir().mkpath(dirPath())) {
// TODO: error message
return false; return false;
} }
// write updated data to file // write updated data to file
QFile file(path); QFile file(path);
if (!file.open(QIODevice::WriteOnly)) { if (!file.open(QIODevice::WriteOnly)) {
// TODO: logging category?
// qCWarning(KSCREEN_COMMON) << "Failed to open config control file for writing! " << file.errorString();
return false; return false;
} }
file.write(QJsonDocument::fromVariant(infoMap).toJson()); file.write(QJsonDocument::fromVariant(infoMap).toJson());
// qCDebug(KSCREEN_COMMON) << "Control saved on: " << file.fileName();
return true; return true;
} }
@ -184,8 +181,7 @@ bool ControlConfig::writeFile()
{ {
bool success = true; bool success = true;
for (auto *outputControl : m_outputsControls) { for (auto *outputControl : m_outputsControls) {
if (getOutputRetention(outputControl->id(), outputControl->name()) if (getOutputRetention(outputControl->id(), outputControl->name()) == OutputRetention::Individual) {
== OutputRetention::Individual) {
continue; continue;
} }
success &= outputControl->writeFile(); success &= outputControl->writeFile();
@ -321,7 +317,6 @@ void ControlConfig::setScale(const QString &outputId, const QString &outputName,
if (auto *control = getOutputControl(outputId, outputName)) { if (auto *control = getOutputControl(outputId, outputName)) {
control->setScale(value); control->setScale(value);
} }
}; };
for (it = outputsInfo.begin(); it != outputsInfo.end(); ++it) { for (it = outputsInfo.begin(); it != outputsInfo.end(); ++it) {
@ -387,7 +382,6 @@ void ControlConfig::setAutoRotate(const QString &outputId, const QString &output
if (auto *control = getOutputControl(outputId, outputName)) { if (auto *control = getOutputControl(outputId, outputName)) {
control->setAutoRotate(value); control->setAutoRotate(value);
} }
}; };
for (it = outputsInfo.begin(); it != outputsInfo.end(); ++it) { for (it = outputsInfo.begin(); it != outputsInfo.end(); ++it) {
@ -415,8 +409,7 @@ bool ControlConfig::getAutoRotateOnlyInTabletMode(const KScreen::OutputPtr &outp
return getAutoRotateOnlyInTabletMode(output->hashMd5(), output->name()); return getAutoRotateOnlyInTabletMode(output->hashMd5(), output->name());
} }
bool ControlConfig::getAutoRotateOnlyInTabletMode(const QString &outputId, bool ControlConfig::getAutoRotateOnlyInTabletMode(const QString &outputId, const QString &outputName) const
const QString &outputName) const
{ {
const auto retention = getOutputRetention(outputId, outputName); const auto retention = getOutputRetention(outputId, outputName);
if (retention == OutputRetention::Individual) { if (retention == OutputRetention::Individual) {
@ -445,8 +438,7 @@ void ControlConfig::setAutoRotateOnlyInTabletMode(const KScreen::OutputPtr &outp
} }
// TODO: combine methods (templated functions) // TODO: combine methods (templated functions)
void ControlConfig::setAutoRotateOnlyInTabletMode(const QString &outputId, void ControlConfig::setAutoRotateOnlyInTabletMode(const QString &outputId, const QString &outputName, bool value)
const QString &outputName, bool value)
{ {
QList<QVariant>::iterator it; QList<QVariant>::iterator it;
QVariantList outputsInfo = getOutputs(); QVariantList outputsInfo = getOutputs();
@ -477,14 +469,12 @@ void ControlConfig::setAutoRotateOnlyInTabletMode(const QString &outputId,
setOutputAutoRotateOnlyInTabletMode(); setOutputAutoRotateOnlyInTabletMode();
} }
KScreen::OutputPtr ControlConfig::getReplicationSource(const KScreen::OutputPtr &output) const KScreen::OutputPtr ControlConfig::getReplicationSource(const KScreen::OutputPtr &output) const
{ {
return getReplicationSource(output->hashMd5(), output->name()); return getReplicationSource(output->hashMd5(), output->name());
} }
KScreen::OutputPtr ControlConfig::getReplicationSource(const QString &outputId, KScreen::OutputPtr ControlConfig::getReplicationSource(const QString &outputId, const QString &outputName) const
const QString &outputName) const
{ {
const QVariantList outputsInfo = getOutputs(); const QVariantList outputsInfo = getOutputs();
for (const auto &variantInfo : outputsInfo) { for (const auto &variantInfo : outputsInfo) {
@ -512,14 +502,12 @@ KScreen::OutputPtr ControlConfig::getReplicationSource(const QString &outputId,
return nullptr; return nullptr;
} }
void ControlConfig::setReplicationSource(const KScreen::OutputPtr &output, void ControlConfig::setReplicationSource(const KScreen::OutputPtr &output, const KScreen::OutputPtr &source)
const KScreen::OutputPtr &source)
{ {
setReplicationSource(output->hashMd5(), output->name(), source); setReplicationSource(output->hashMd5(), output->name(), source);
} }
void ControlConfig::setReplicationSource(const QString &outputId, const QString &outputName, void ControlConfig::setReplicationSource(const QString &outputId, const QString &outputName, const KScreen::OutputPtr &source)
const KScreen::OutputPtr &source)
{ {
QList<QVariant>::iterator it; QList<QVariant>::iterator it;
QVariantList outputsInfo = getOutputs(); QVariantList outputsInfo = getOutputs();
@ -558,8 +546,7 @@ void ControlConfig::setOutputs(QVariantList outputsInfo)
auto &infoMap = info(); auto &infoMap = info();
infoMap[QStringLiteral("outputs")] = outputsInfo; infoMap[QStringLiteral("outputs")] = outputsInfo;
} }
ControlOutput* ControlConfig::getOutputControl(const QString &outputId, ControlOutput *ControlConfig::getOutputControl(const QString &outputId, const QString &outputName) const
const QString &outputName) const
{ {
for (auto *control : m_outputsControls) { for (auto *control : m_outputsControls) {
if (control->id() == outputId && control->name() == outputName) { if (control->id() == outputId && control->name() == outputName) {

@ -14,16 +14,17 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/ *********************************************************************/
#ifndef COMMON_CONTROL_H #ifndef COMMON_CONTROL_H
#define COMMON_CONTROL_H #define COMMON_CONTROL_H
#include <kscreen/types.h> #include <kscreen/types.h>
#include <QObject> #include <QObject>
#include <QVector>
#include <QVariantMap> #include <QVariantMap>
#include <QVector>
class QFileSystemWatcher; class KDirWatch;
class Control : public QObject class Control : public QObject
{ {
@ -38,7 +39,6 @@ public:
explicit Control(QObject *parent = nullptr); explicit Control(QObject *parent = nullptr);
~Control() override = default; ~Control() override = default;
virtual bool writeFile(); virtual bool writeFile();
@ -54,14 +54,14 @@ protected:
void readFile(); void readFile();
QVariantMap &info(); QVariantMap &info();
const QVariantMap &constInfo() const; const QVariantMap &constInfo() const;
QFileSystemWatcher* watcher() const; KDirWatch *watcher() const;
static OutputRetention convertVariantToOutputRetention(QVariant variant); static OutputRetention convertVariantToOutputRetention(QVariant variant);
private: private:
static QString s_dirName; static QString s_dirName;
QVariantMap m_info; QVariantMap m_info;
QFileSystemWatcher *m_watcher = nullptr; KDirWatch *m_watcher = nullptr;
}; };
class ControlOutput; class ControlOutput;
@ -90,15 +90,12 @@ public:
bool getAutoRotateOnlyInTabletMode(const KScreen::OutputPtr &output) const; bool getAutoRotateOnlyInTabletMode(const KScreen::OutputPtr &output) const;
bool getAutoRotateOnlyInTabletMode(const QString &outputId, const QString &outputName) const; bool getAutoRotateOnlyInTabletMode(const QString &outputId, const QString &outputName) const;
void setAutoRotateOnlyInTabletMode(const KScreen::OutputPtr &output, bool value); void setAutoRotateOnlyInTabletMode(const KScreen::OutputPtr &output, bool value);
void setAutoRotateOnlyInTabletMode(const QString &outputId, const QString &outputName, void setAutoRotateOnlyInTabletMode(const QString &outputId, const QString &outputName, bool value);
bool value);
KScreen::OutputPtr getReplicationSource(const KScreen::OutputPtr &output) const; KScreen::OutputPtr getReplicationSource(const KScreen::OutputPtr &output) const;
KScreen::OutputPtr getReplicationSource(const QString &outputId, KScreen::OutputPtr getReplicationSource(const QString &outputId, const QString &outputName) const;
const QString &outputName) const;
void setReplicationSource(const KScreen::OutputPtr &output, const KScreen::OutputPtr &source); void setReplicationSource(const KScreen::OutputPtr &output, const KScreen::OutputPtr &source);
void setReplicationSource(const QString &outputId, const QString &outputName, void setReplicationSource(const QString &outputId, const QString &outputName, const KScreen::OutputPtr &source);
const KScreen::OutputPtr &source);
QString dirPath() const override; QString dirPath() const override;
QString filePath() const override; QString filePath() const override;

@ -1,13 +1,16 @@
/******************************************************************** /********************************************************************
Copyright © 2019 Roman Gilg <subdiff@gmail.com> Copyright © 2019 Roman Gilg <subdiff@gmail.com>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/ *********************************************************************/

@ -1,13 +1,16 @@
/******************************************************************** /********************************************************************
Copyright © 2019 Roman Gilg <subdiff@gmail.com> Copyright © 2019 Roman Gilg <subdiff@gmail.com>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/ *********************************************************************/

@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <kscreen/output.h> #include <kscreen/output.h>
#include <QRect> #include <QRect>
#include <QDebug>
using namespace KScreen; using namespace KScreen;
@ -42,10 +43,8 @@ void ConfigHandler::setConfig(KScreen::ConfigPtr config)
m_control.reset(new ControlConfig(config)); m_control.reset(new ControlConfig(config));
m_outputs = new OutputModel(this); m_outputs = new OutputModel(this);
connect(m_outputs, &OutputModel::positionChanged, connect(m_outputs, &OutputModel::positionChanged, this, &ConfigHandler::checkScreenNormalization);
this, &ConfigHandler::checkScreenNormalization); connect(m_outputs, &OutputModel::sizeChanged, this, &ConfigHandler::checkScreenNormalization);
connect(m_outputs, &OutputModel::sizeChanged,
this, &ConfigHandler::checkScreenNormalization);
for (const KScreen::OutputPtr &output : config->outputs()) { for (const KScreen::OutputPtr &output : config->outputs()) {
initOutput(output); initOutput(output);
@ -56,17 +55,17 @@ void ConfigHandler::setConfig(KScreen::ConfigPtr config)
m_initialRetention = getRetention(); m_initialRetention = getRetention();
Q_EMIT retentionChanged(); Q_EMIT retentionChanged();
connect(m_outputs, &OutputModel::changed, connect(m_outputs, &OutputModel::changed, this, [this]() {
this, [this]() {
checkNeedsSave(); checkNeedsSave();
Q_EMIT changed(); Q_EMIT changed();
}); });
connect(m_config.data(), &KScreen::Config::outputAdded, connect(m_config.data(), &KScreen::Config::outputAdded, this, [this]() {
this, [this]() { Q_EMIT outputConnect(true); }); Q_EMIT outputConnect(true);
connect(m_config.data(), &KScreen::Config::outputRemoved, });
this, [this]() { Q_EMIT outputConnect(false); }); connect(m_config.data(), &KScreen::Config::outputRemoved, this, [this]() {
connect(m_config.data(), &KScreen::Config::primaryOutputChanged, Q_EMIT outputConnect(false);
this, &ConfigHandler::primaryOutputChanged); });
connect(m_config.data(), &KScreen::Config::primaryOutputChanged, this, &ConfigHandler::primaryOutputChanged);
Q_EMIT outputModelChanged(); Q_EMIT outputModelChanged();
} }
@ -92,8 +91,7 @@ void ConfigHandler::initOutput(const KScreen::OutputPtr &output)
resetScale(output); resetScale(output);
m_outputs->add(output); m_outputs->add(output);
} }
connect(output.data(), &KScreen::Output::isConnectedChanged, connect(output.data(), &KScreen::Output::isConnectedChanged, this, [this, output]() {
this, [this, output]() {
Q_EMIT outputConnect(output->isConnected()); Q_EMIT outputConnect(output->isConnected());
}); });
} }
@ -101,8 +99,7 @@ void ConfigHandler::initOutput(const KScreen::OutputPtr &output)
void ConfigHandler::updateInitialData() void ConfigHandler::updateInitialData()
{ {
m_initialRetention = getRetention(); m_initialRetention = getRetention();
connect(new GetConfigOperation(), &GetConfigOperation::finished, connect(new GetConfigOperation(), &GetConfigOperation::finished, this, [this](ConfigOperation *op) {
this, [this](ConfigOperation *op) {
if (op->hasError()) { if (op->hasError()) {
return; return;
} }
@ -117,11 +114,9 @@ void ConfigHandler::updateInitialData()
void ConfigHandler::checkNeedsSave() void ConfigHandler::checkNeedsSave()
{ {
if (m_config->supportedFeatures() & if (m_config->supportedFeatures() & KScreen::Config::Feature::PrimaryDisplay) {
KScreen::Config::Feature::PrimaryDisplay) {
if (m_config->primaryOutput() && m_initialConfig->primaryOutput()) { if (m_config->primaryOutput() && m_initialConfig->primaryOutput()) {
if (m_config->primaryOutput()->hashMd5() != if (m_config->primaryOutput()->hashMd5() != m_initialConfig->primaryOutput()->hashMd5()) {
m_initialConfig->primaryOutput()->hashMd5() ) {
Q_EMIT needsSaveChecked(true); Q_EMIT needsSaveChecked(true);
return; return;
} }
@ -146,6 +141,7 @@ void ConfigHandler::checkNeedsSave()
if (output->isEnabled() != initialOutput->isEnabled()) { if (output->isEnabled() != initialOutput->isEnabled()) {
needsSave = true; needsSave = true;
} }
// clang-format off
if (output->isEnabled()) { if (output->isEnabled()) {
needsSave |= output->currentModeId() != needsSave |= output->currentModeId() !=
initialOutput->currentModeId() initialOutput->currentModeId()
@ -157,6 +153,7 @@ void ConfigHandler::checkNeedsSave()
|| autoRotateOnlyInTabletMode(output) || autoRotateOnlyInTabletMode(output)
!= m_initialControl->getAutoRotateOnlyInTabletMode(output); != m_initialControl->getAutoRotateOnlyInTabletMode(output);
} }
// clang-format on
if (needsSave) { if (needsSave) {
Q_EMIT needsSaveChecked(true); Q_EMIT needsSaveChecked(true);
return; return;
@ -211,9 +208,7 @@ QSize ConfigHandler::normalizeScreen()
void ConfigHandler::checkScreenNormalization() void ConfigHandler::checkScreenNormalization()
{ {
const bool normalized = !m_config || const bool normalized = !m_config || (m_lastNormalizedScreenSize == screenSize() && m_outputs->positionsNormalized());
(m_lastNormalizedScreenSize == screenSize() &&
m_outputs->positionsNormalized());
Q_EMIT screenNormalizationUpdate(normalized); Q_EMIT screenNormalizationUpdate(normalized);
} }
@ -227,7 +222,6 @@ void ConfigHandler::primaryOutputSelected(int index)
void ConfigHandler::primaryOutputChanged(const KScreen::OutputPtr &output) void ConfigHandler::primaryOutputChanged(const KScreen::OutputPtr &output)
{ {
Q_UNUSED(output) Q_UNUSED(output)
} }
Control::OutputRetention ConfigHandler::getRetention() const Control::OutputRetention ConfigHandler::getRetention() const
@ -272,8 +266,7 @@ void ConfigHandler::setRetention(int retention)
if (!m_control) { if (!m_control) {
return; return;
} }
if (retention != static_cast<int>(Retention::Global) && if (retention != static_cast<int>(Retention::Global) && retention != static_cast<int>(Retention::Individual)) {
retention != static_cast<int>(Retention::Individual)) {
// We only allow setting to global or individual retention. // We only allow setting to global or individual retention.
return; return;
} }
@ -304,8 +297,7 @@ KScreen::OutputPtr ConfigHandler::replicationSource(const KScreen::OutputPtr &ou
return m_control->getReplicationSource(output); return m_control->getReplicationSource(output);
} }
void ConfigHandler::setReplicationSource(KScreen::OutputPtr &output, void ConfigHandler::setReplicationSource(KScreen::OutputPtr &output, const KScreen::OutputPtr &source)
const KScreen::OutputPtr &source)
{ {
m_control->setReplicationSource(output, source); m_control->setReplicationSource(output, source);
} }

@ -29,7 +29,6 @@ class OutputModel;
class ConfigHandler : public QObject class ConfigHandler : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ConfigHandler(QObject *parent = nullptr); explicit ConfigHandler(QObject *parent = nullptr);
~ConfigHandler() override = default; ~ConfigHandler() override = default;
@ -37,17 +36,20 @@ public:
void setConfig(KScreen::ConfigPtr config); void setConfig(KScreen::ConfigPtr config);
void updateInitialData(); void updateInitialData();
OutputModel* outputModel() const { OutputModel *outputModel() const
{
return m_outputs; return m_outputs;
} }
QSize normalizeScreen(); QSize normalizeScreen();
KScreen::ConfigPtr config() const { KScreen::ConfigPtr config() const
{
return m_config; return m_config;
} }
KScreen::ConfigPtr initialConfig() const { KScreen::ConfigPtr initialConfig() const
{
return m_initialConfig; return m_initialConfig;
} }
@ -92,8 +94,7 @@ private:
std::unique_ptr<ControlConfig> m_control; std::unique_ptr<ControlConfig> m_control;
std::unique_ptr<ControlConfig> m_initialControl; std::unique_ptr<ControlConfig> m_initialControl;
Control::OutputRetention m_initialRetention = Control::OutputRetention:: Control::OutputRetention m_initialRetention = Control::OutputRetention::Undefined;
Undefined;
QSize m_lastNormalizedScreenSize; QSize m_lastNormalizedScreenSize;
}; };

@ -297,8 +297,7 @@ bool OutputModel::setEnabled(int outputIndex, bool enable)
return true; return true;
} }
inline inline bool refreshRateCompare(float rate1, float rate2)
bool refreshRateCompare(float rate1, float rate2)
{ {
return qAbs(rate1 - rate2) < 0.5; return qAbs(rate1 - rate2) < 0.5;
} }

@ -33,6 +33,9 @@ void Screen::load()
void Screen::save() void Screen::save()
{ {
if (!m_config)
return;
auto config = m_config->config(); auto config = m_config->config();
bool atLeastOneEnabledOutput = false; bool atLeastOneEnabledOutput = false;

Loading…
Cancel
Save