Changeset View
Changeset View
Standalone View
Standalone View
kded/config.cpp
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Line(s) | 96 | { | |||
---|---|---|---|---|---|
109 | } | 109 | } | ||
110 | if (!file.open(QIODevice::ReadOnly)) { | 110 | if (!file.open(QIODevice::ReadOnly)) { | ||
111 | qCDebug(KSCREEN_KDED) << "failed to open file" << file.fileName(); | 111 | qCDebug(KSCREEN_KDED) << "failed to open file" << file.fileName(); | ||
112 | return nullptr; | 112 | return nullptr; | ||
113 | } | 113 | } | ||
114 | 114 | | |||
115 | QJsonDocument parser; | 115 | QJsonDocument parser; | ||
116 | QVariantList outputs = parser.fromJson(file.readAll()).toVariant().toList(); | 116 | QVariantList outputs = parser.fromJson(file.readAll()).toVariant().toList(); | ||
117 | Output::readInOutputs(config->data()->outputs(), outputs, Control::readInOutputRetentionValues(config->id())); | 117 | Output::readInOutputs(config->data()->outputs(), outputs, ControlConfig(config->data()).readInOutputRetentionValues()); | ||
118 | 118 | | |||
119 | QSize screenSize; | 119 | QSize screenSize; | ||
120 | for (const auto &output : config->data()->outputs()) { | 120 | for (const auto &output : config->data()->outputs()) { | ||
121 | if (!output->isConnected() || !output->isEnabled()) { | 121 | if (!output->isConnected() || !output->isEnabled()) { | ||
122 | continue; | 122 | continue; | ||
123 | } | 123 | } | ||
124 | 124 | | |||
125 | const QRect geom = output->geometry(); | 125 | const QRect geom = output->geometry(); | ||
Show All 39 Lines | |||||
165 | 165 | | |||
166 | bool Config::writeFile(const QString &filePath) | 166 | bool Config::writeFile(const QString &filePath) | ||
167 | { | 167 | { | ||
168 | if (id().isEmpty()) { | 168 | if (id().isEmpty()) { | ||
169 | return false; | 169 | return false; | ||
170 | } | 170 | } | ||
171 | const KScreen::OutputList outputs = m_data->outputs(); | 171 | const KScreen::OutputList outputs = m_data->outputs(); | ||
172 | 172 | | |||
173 | const auto retentions = Control::readInOutputRetentionValues(id()); | 173 | const auto retentions = ControlConfig(m_data).readInOutputRetentionValues(); | ||
174 | 174 | | |||
175 | QVariantList outputList; | 175 | QVariantList outputList; | ||
176 | Q_FOREACH(const KScreen::OutputPtr &output, outputs) { | 176 | Q_FOREACH(const KScreen::OutputPtr &output, outputs) { | ||
177 | QVariantMap info; | 177 | QVariantMap info; | ||
178 | 178 | | |||
179 | if (!output->isConnected()) { | 179 | if (!output->isConnected()) { | ||
180 | continue; | 180 | continue; | ||
181 | } | 181 | } | ||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |