Changeset View
Changeset View
Standalone View
Standalone View
kcm/kcm.cpp
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | 71 | { | |||
---|---|---|---|---|---|
74 | if (op->hasError()) { | 74 | if (op->hasError()) { | ||
75 | m_config.reset(); | 75 | m_config.reset(); | ||
76 | setBackendError(true); | 76 | setBackendError(true); | ||
77 | return; | 77 | return; | ||
78 | } | 78 | } | ||
79 | m_config->setConfig(qobject_cast<GetConfigOperation*>(op)->config()); | 79 | m_config->setConfig(qobject_cast<GetConfigOperation*>(op)->config()); | ||
80 | Q_EMIT perOutputScalingChanged(); | 80 | Q_EMIT perOutputScalingChanged(); | ||
81 | Q_EMIT primaryOutputSupportedChanged(); | 81 | Q_EMIT primaryOutputSupportedChanged(); | ||
82 | Q_EMIT outputReplicationSupportedChanged(); | ||||
82 | } | 83 | } | ||
83 | 84 | | |||
84 | void KCMKScreen::forceSave() | 85 | void KCMKScreen::forceSave() | ||
85 | { | 86 | { | ||
86 | doSave(true); | 87 | doSave(true); | ||
87 | } | 88 | } | ||
88 | 89 | | |||
89 | void KCMKScreen::save() | 90 | void KCMKScreen::save() | ||
Show All 22 Lines | 110 | qCDebug(KSCREEN_KCM) << output->name() << output->id() | |||
112 | << " Enabled:" << output->isEnabled() << "\n" | 113 | << " Enabled:" << output->isEnabled() << "\n" | ||
113 | << " Primary:" << output->isPrimary() << "\n" | 114 | << " Primary:" << output->isPrimary() << "\n" | ||
114 | << " Rotation:" << output->rotation() << "\n" | 115 | << " Rotation:" << output->rotation() << "\n" | ||
115 | << " Mode:" | 116 | << " Mode:" | ||
116 | << (mode ? mode->name() : QStringLiteral("unknown")) | 117 | << (mode ? mode->name() : QStringLiteral("unknown")) | ||
117 | << "@" << (mode ? mode->refreshRate() : 0.0) << "Hz" << "\n" | 118 | << "@" << (mode ? mode->refreshRate() : 0.0) << "Hz" << "\n" | ||
118 | << " Position:" << output->pos().x() << "x" << output->pos().y() << "\n" | 119 | << " Position:" << output->pos().x() << "x" << output->pos().y() << "\n" | ||
119 | << " Scale:" << (perOutputScaling() ? QString::number(output->scale()) : | 120 | << " Scale:" << (perOutputScaling() ? QString::number(output->scale()) : | ||
120 | QStringLiteral("global")); | 121 | QStringLiteral("global")) << "\n" | ||
122 | << " Replicates:" << (output->replicationSource() == 0 ? "no" : "yes"); | ||||
121 | } | 123 | } | ||
122 | 124 | | |||
123 | if (!atLeastOneEnabledOutput && !force) { | 125 | if (!atLeastOneEnabledOutput && !force) { | ||
124 | Q_EMIT dangerousSave(); | 126 | Q_EMIT dangerousSave(); | ||
125 | m_config->checkNeedsSave(); | 127 | m_config->checkNeedsSave(); | ||
126 | return; | 128 | return; | ||
127 | } | 129 | } | ||
128 | 130 | | |||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | |||||
217 | { | 219 | { | ||
218 | if (!m_config || !m_config->config()) { | 220 | if (!m_config || !m_config->config()) { | ||
219 | return false; | 221 | return false; | ||
220 | } | 222 | } | ||
221 | return m_config->config()->supportedFeatures().testFlag(Config::Feature:: | 223 | return m_config->config()->supportedFeatures().testFlag(Config::Feature:: | ||
222 | PrimaryDisplay); | 224 | PrimaryDisplay); | ||
223 | } | 225 | } | ||
224 | 226 | | |||
227 | bool KCMKScreen::outputReplicationSupported() const | ||||
228 | { | ||||
229 | if (!m_config || !m_config->config()) { | ||||
230 | return false; | ||||
231 | } | ||||
232 | return m_config->config()->supportedFeatures().testFlag(Config::Feature:: | ||||
233 | OutputReplication); | ||||
234 | } | ||||
235 | | ||||
225 | void KCMKScreen::setScreenNormalized(bool normalized) | 236 | void KCMKScreen::setScreenNormalized(bool normalized) | ||
226 | { | 237 | { | ||
227 | if (m_screenNormalized == normalized) { | 238 | if (m_screenNormalized == normalized) { | ||
228 | return; | 239 | return; | ||
229 | } | 240 | } | ||
230 | m_screenNormalized = normalized; | 241 | m_screenNormalized = normalized; | ||
231 | Q_EMIT screenNormalizedChanged(); | 242 | Q_EMIT screenNormalizedChanged(); | ||
232 | } | 243 | } | ||
▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines |