diff --git a/kcmkwin/common/effectmodel.h b/kcmkwin/common/effectmodel.h --- a/kcmkwin/common/effectmodel.h +++ b/kcmkwin/common/effectmodel.h @@ -225,7 +225,7 @@ QString category; QString serviceName; QString iconName; - Status effectStatus; + Status status; Status originalStatus; bool enabledByDefault; bool enabledByDefaultFunction; diff --git a/kcmkwin/common/effectmodel.cpp b/kcmkwin/common/effectmodel.cpp --- a/kcmkwin/common/effectmodel.cpp +++ b/kcmkwin/common/effectmodel.cpp @@ -170,7 +170,7 @@ case IconNameRole: return effect.iconName; case EffectStatusRole: - return static_cast(effect.effectStatus); + return static_cast(effect.status); case VideoRole: return effect.video; case WebsiteRole: @@ -203,20 +203,20 @@ // gets marked as changed and will get saved to the config file. This means the // config file could get polluted EffectData &data = m_effectsList[index.row()]; - data.effectStatus = Status(value.toInt()); - data.changed = data.effectStatus != data.originalStatus; + data.status = Status(value.toInt()); + data.changed = data.status != data.originalStatus; emit dataChanged(index, index); - if (data.effectStatus == Status::Enabled && !data.exclusiveGroup.isEmpty()) { + if (data.status == Status::Enabled && !data.exclusiveGroup.isEmpty()) { // need to disable all other exclusive effects in the same category for (int i = 0; i < m_effectsList.size(); ++i) { if (i == index.row()) { continue; } EffectData &otherData = m_effectsList[i]; if (otherData.exclusiveGroup == data.exclusiveGroup) { - otherData.effectStatus = Status::Disabled; - otherData.changed = otherData.effectStatus != otherData.originalStatus; + otherData.status = Status::Disabled; + otherData.changed = otherData.status != otherData.originalStatus; emit dataChanged(this->index(i, 0), this->index(i, 0)); } } @@ -248,13 +248,13 @@ effect.enabledByDefaultFunction = (data.enabledFunction != nullptr); const QString enabledKey = QStringLiteral("%1Enabled").arg(effect.serviceName); if (kwinConfig.hasKey(enabledKey)) { - effect.effectStatus = effectStatus(kwinConfig.readEntry(effect.serviceName + "Enabled", effect.enabledByDefault)); + effect.status = effectStatus(kwinConfig.readEntry(effect.serviceName + "Enabled", effect.enabledByDefault)); } else if (data.enabledFunction != nullptr) { - effect.effectStatus = Status::EnabledUndeterminded; + effect.status = Status::EnabledUndeterminded; } else { - effect.effectStatus = effectStatus(effect.enabledByDefault); + effect.status = effectStatus(effect.enabledByDefault); } - effect.originalStatus = effect.effectStatus; + effect.originalStatus = effect.status; effect.video = data.video; effect.website = QUrl(); effect.supported = true; @@ -294,8 +294,8 @@ effect.category = translatedCategory(plugin.category()); effect.serviceName = plugin.pluginName(); effect.iconName = plugin.icon(); - effect.effectStatus = effectStatus(kwinConfig.readEntry(effect.serviceName + "Enabled", plugin.isPluginEnabledByDefault())); - effect.originalStatus = effect.effectStatus; + effect.status = effectStatus(kwinConfig.readEntry(effect.serviceName + "Enabled", plugin.isPluginEnabledByDefault())); + effect.originalStatus = effect.status; effect.enabledByDefault = plugin.isPluginEnabledByDefault(); effect.enabledByDefaultFunction = false; effect.video = plugin.property(QStringLiteral("X-KWin-Video-Url")).toUrl(); @@ -366,14 +366,14 @@ const QString enabledKey = QStringLiteral("%1Enabled").arg(effect.serviceName); if (kwinConfig.hasKey(enabledKey)) { - effect.effectStatus = effectStatus(kwinConfig.readEntry(effect.serviceName + "Enabled", effect.enabledByDefault)); + effect.status = effectStatus(kwinConfig.readEntry(effect.serviceName + "Enabled", effect.enabledByDefault)); } else if (effect.enabledByDefaultFunction) { - effect.effectStatus = Status::EnabledUndeterminded; + effect.status = Status::EnabledUndeterminded; } else { - effect.effectStatus = effectStatus(effect.enabledByDefault); + effect.status = effectStatus(effect.enabledByDefault); } - effect.originalStatus = effect.effectStatus; + effect.originalStatus = effect.status; effect.configurable = std::any_of(configs.constBegin(), configs.constEnd(), [pluginEffect](const KPluginInfo &info) { @@ -413,8 +413,8 @@ if (effectIt == m_effectsList.end()) { continue; } - effectIt->effectStatus = oldEffect.effectStatus; - effectIt->changed = effectIt->effectStatus != effectIt->originalStatus; + effectIt->status = oldEffect.status; + effectIt->changed = effectIt->status != effectIt->originalStatus; } } @@ -490,12 +490,12 @@ } effect.changed = false; - effect.originalStatus = effect.effectStatus; + effect.originalStatus = effect.status; const QString key = effect.serviceName + QStringLiteral("Enabled"); - const bool shouldEnable = (effect.effectStatus != Status::Disabled); + const bool shouldEnable = (effect.status != Status::Disabled); const bool restoreToDefault = effect.enabledByDefaultFunction - ? effect.effectStatus == Status::EnabledUndeterminded + ? effect.status == Status::EnabledUndeterminded : shouldEnable == effect.enabledByDefault; if (restoreToDefault) { kwinConfig.deleteEntry(key); @@ -516,7 +516,7 @@ QStringLiteral("/Effects"), QDBusConnection::sessionBus()); for (const EffectData &effect : dirtyEffects) { - if (effect.effectStatus != Status::Disabled) { + if (effect.status != Status::Disabled) { interface.loadEffect(effect.serviceName); } else { interface.unloadEffect(effect.serviceName); @@ -528,9 +528,9 @@ { for (int i = 0; i < m_effectsList.count(); ++i) { const auto &effect = m_effectsList.at(i); - if (effect.enabledByDefaultFunction && effect.effectStatus != Status::EnabledUndeterminded) { + if (effect.enabledByDefaultFunction && effect.status != Status::EnabledUndeterminded) { updateEffectStatus(index(i, 0), Status::EnabledUndeterminded); - } else if ((bool)effect.effectStatus != effect.enabledByDefault) { + } else if ((bool)effect.status != effect.enabledByDefault) { updateEffectStatus(index(i, 0), effect.enabledByDefault ? Status::Enabled : Status::Disabled); } }