Use new for-loop instead of foreach in kwin/effects.cpp
kdevelop was causing parsing errors, so I had to do it ;-)
This commit is contained in:
parent
d258759ac9
commit
cebb4b86b5
1 changed files with 15 additions and 15 deletions
30
effects.cpp
30
effects.cpp
|
@ -249,10 +249,10 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene)
|
||||||
#endif
|
#endif
|
||||||
connect(m_screenLockerWatcher, SIGNAL(locked(bool)), SIGNAL(screenLockingChanged(bool)));
|
connect(m_screenLockerWatcher, SIGNAL(locked(bool)), SIGNAL(screenLockingChanged(bool)));
|
||||||
// connect all clients
|
// connect all clients
|
||||||
foreach (Client *c, ws->clientList()) {
|
for (Client *c : ws->clientList()) {
|
||||||
setupClientConnections(c);
|
setupClientConnections(c);
|
||||||
}
|
}
|
||||||
foreach (Unmanaged *u, ws->unmanagedList()) {
|
for (Unmanaged *u : ws->unmanagedList()) {
|
||||||
setupUnmanagedConnections(u);
|
setupUnmanagedConnections(u);
|
||||||
}
|
}
|
||||||
reconfigure();
|
reconfigure();
|
||||||
|
@ -262,8 +262,8 @@ EffectsHandlerImpl::~EffectsHandlerImpl()
|
||||||
{
|
{
|
||||||
if (keyboard_grab_effect != NULL)
|
if (keyboard_grab_effect != NULL)
|
||||||
ungrabKeyboard();
|
ungrabKeyboard();
|
||||||
foreach (const EffectPair & ep, loaded_effects)
|
for (const EffectPair & ep : loaded_effects)
|
||||||
unloadEffect(ep.first);
|
unloadEffect(ep.first);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EffectsHandlerImpl::setupClientConnections(Client* c)
|
void EffectsHandlerImpl::setupClientConnections(Client* c)
|
||||||
|
@ -316,7 +316,7 @@ void EffectsHandlerImpl::slotEffectsQueried()
|
||||||
KConfigGroup conf(KSharedConfig::openConfig(), "Plugins");
|
KConfigGroup conf(KSharedConfig::openConfig(), "Plugins");
|
||||||
|
|
||||||
// First unload necessary effects
|
// First unload necessary effects
|
||||||
foreach (const KService::Ptr & service, offers) {
|
for (const KService::Ptr & service : offers) {
|
||||||
KPluginInfo plugininfo(service);
|
KPluginInfo plugininfo(service);
|
||||||
plugininfo.load(conf);
|
plugininfo.load(conf);
|
||||||
|
|
||||||
|
@ -335,13 +335,13 @@ void EffectsHandlerImpl::slotEffectsQueried()
|
||||||
}
|
}
|
||||||
QStringList newLoaded;
|
QStringList newLoaded;
|
||||||
// Then load those that should be loaded
|
// Then load those that should be loaded
|
||||||
foreach (const QString & effectName, effectsToBeLoaded) {
|
for (const QString & effectName : effectsToBeLoaded) {
|
||||||
if (!isEffectLoaded(effectName)) {
|
if (!isEffectLoaded(effectName)) {
|
||||||
if (loadEffect(effectName, checkDefault.contains(effectName)))
|
if (loadEffect(effectName, checkDefault.contains(effectName)))
|
||||||
newLoaded.append(effectName);
|
newLoaded.append(effectName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (const EffectPair & ep, loaded_effects) {
|
for (const EffectPair & ep : loaded_effects) {
|
||||||
if (!newLoaded.contains(ep.first)) // don't reconfigure newly loaded effects
|
if (!newLoaded.contains(ep.first)) // don't reconfigure newly loaded effects
|
||||||
ep.second->reconfigure(Effect::ReconfigureAll);
|
ep.second->reconfigure(Effect::ReconfigureAll);
|
||||||
}
|
}
|
||||||
|
@ -1039,7 +1039,7 @@ EffectWindowList EffectsHandlerImpl::stackingOrder() const
|
||||||
{
|
{
|
||||||
ToplevelList list = Workspace::self()->xStackingOrder();
|
ToplevelList list = Workspace::self()->xStackingOrder();
|
||||||
EffectWindowList ret;
|
EffectWindowList ret;
|
||||||
foreach (Toplevel *t, list) {
|
for (Toplevel *t : list) {
|
||||||
if (EffectWindow *w = effectWindow(t))
|
if (EffectWindow *w = effectWindow(t))
|
||||||
ret.append(w);
|
ret.append(w);
|
||||||
}
|
}
|
||||||
|
@ -1079,7 +1079,7 @@ EffectWindowList EffectsHandlerImpl::currentTabBoxWindowList() const
|
||||||
EffectWindowList ret;
|
EffectWindowList ret;
|
||||||
ClientList clients;
|
ClientList clients;
|
||||||
clients = TabBox::TabBox::self()->currentClientList();
|
clients = TabBox::TabBox::self()->currentClientList();
|
||||||
foreach (Client * c, clients)
|
for (Client * c : clients)
|
||||||
ret.append(c->effectWindow());
|
ret.append(c->effectWindow());
|
||||||
return ret;
|
return ret;
|
||||||
#else
|
#else
|
||||||
|
@ -1318,7 +1318,7 @@ QStringList EffectsHandlerImpl::listOfEffects() const
|
||||||
KService::List offers = KServiceTypeTrader::self()->query(QStringLiteral("KWin/Effect"));
|
KService::List offers = KServiceTypeTrader::self()->query(QStringLiteral("KWin/Effect"));
|
||||||
QStringList listOfModules;
|
QStringList listOfModules;
|
||||||
// First unload necessary effects
|
// First unload necessary effects
|
||||||
foreach (const KService::Ptr & service, offers) {
|
for (const KService::Ptr & service : offers) {
|
||||||
KPluginInfo plugininfo(service);
|
KPluginInfo plugininfo(service);
|
||||||
listOfModules << plugininfo.pluginName();
|
listOfModules << plugininfo.pluginName();
|
||||||
}
|
}
|
||||||
|
@ -1423,7 +1423,7 @@ bool EffectsHandlerImpl::loadEffect(const QString& name, bool checkDefault)
|
||||||
// TODO: detect circular deps
|
// TODO: detect circular deps
|
||||||
KPluginInfo plugininfo(service);
|
KPluginInfo plugininfo(service);
|
||||||
QStringList dependencies = plugininfo.dependencies();
|
QStringList dependencies = plugininfo.dependencies();
|
||||||
foreach (const QString & depName, dependencies) {
|
for (const QString & depName : dependencies) {
|
||||||
if (!loadEffect(depName)) {
|
if (!loadEffect(depName)) {
|
||||||
qCritical() << "EffectsHandler::loadEffect : Couldn't load dependencies for effect " << name << endl;
|
qCritical() << "EffectsHandler::loadEffect : Couldn't load dependencies for effect " << name << endl;
|
||||||
library->unload();
|
library->unload();
|
||||||
|
@ -1482,7 +1482,7 @@ void EffectsHandlerImpl::unloadEffect(const QString& name)
|
||||||
stopMouseInterception(it.value().second);
|
stopMouseInterception(it.value().second);
|
||||||
// remove support properties for the effect
|
// remove support properties for the effect
|
||||||
const QList<QByteArray> properties = m_propertiesForEffects.keys();
|
const QList<QByteArray> properties = m_propertiesForEffects.keys();
|
||||||
foreach (const QByteArray &property, properties) {
|
for (const QByteArray &property : properties) {
|
||||||
removeSupportProperty(property, it.value().second);
|
removeSupportProperty(property, it.value().second);
|
||||||
}
|
}
|
||||||
delete it.value().second;
|
delete it.value().second;
|
||||||
|
@ -1536,7 +1536,7 @@ void EffectsHandlerImpl::effectsChanged()
|
||||||
loaded_effects.clear();
|
loaded_effects.clear();
|
||||||
m_activeEffects.clear(); // it's possible to have a reconfigure and a quad rebuild between two paint cycles - bug #308201
|
m_activeEffects.clear(); // it's possible to have a reconfigure and a quad rebuild between two paint cycles - bug #308201
|
||||||
// qDebug() << "Recreating effects' list:";
|
// qDebug() << "Recreating effects' list:";
|
||||||
foreach (const EffectPair & effect, effect_order) {
|
for (const EffectPair & effect : effect_order) {
|
||||||
// qDebug() << effect.first;
|
// qDebug() << effect.first;
|
||||||
loaded_effects.append(effect);
|
loaded_effects.append(effect);
|
||||||
}
|
}
|
||||||
|
@ -1719,7 +1719,7 @@ EffectWindowList getMainWindows(Toplevel *toplevel)
|
||||||
T *c = static_cast<T*>(toplevel);
|
T *c = static_cast<T*>(toplevel);
|
||||||
EffectWindowList ret;
|
EffectWindowList ret;
|
||||||
ClientList mainclients = c->mainClients();
|
ClientList mainclients = c->mainClients();
|
||||||
foreach (Client * tmp, mainclients)
|
for (Client * tmp : mainclients)
|
||||||
ret.append(tmp->effectWindow());
|
ret.append(tmp->effectWindow());
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1835,7 +1835,7 @@ void EffectWindowImpl::unreferencePreviousWindowPixmap()
|
||||||
EffectWindowList EffectWindowGroupImpl::members() const
|
EffectWindowList EffectWindowGroupImpl::members() const
|
||||||
{
|
{
|
||||||
EffectWindowList ret;
|
EffectWindowList ret;
|
||||||
foreach (Toplevel * c, group->members())
|
for (Toplevel * c : group->members())
|
||||||
ret.append(c->effectWindow());
|
ret.append(c->effectWindow());
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue