Commit 5158d141 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Simplify iterator usage and make it with rest of KDE code consistent

parent c7ee6f1e
......@@ -63,18 +63,12 @@ EventsManager *EventsManager::instance()
QSharedPointer<EventHandler> EventsManager::eventHandler()
{
QMap<QString, EventsPlugin *>::const_iterator iter = m_plugins.constBegin();
while (iter != m_plugins.constEnd()) {
QSharedPointer<EventHandler> eventHandler(iter.value()->eventHandler());
for (auto it = m_plugins.cbegin(); it != m_plugins.constEnd(); it++) {
QSharedPointer<EventHandler> eventHandler(it.value()->eventHandler());
if (eventHandler) {
eventHandler->setFrameBufferPlugin(RfbServerManager::instance()->framebuffer());
return eventHandler;
}
++iter;
}
// No valid events plugin found.
......
......@@ -78,23 +78,17 @@ QSharedPointer<FrameBuffer> FrameBufferManager::frameBuffer(WId id, const QVaria
}
// We don't already have that frame buffer.
QMap<QString, FrameBufferPlugin *>::const_iterator iter = m_plugins.constBegin();
while (iter != m_plugins.constEnd()) {
if (iter.key() == KrfbConfig::preferredFrameBufferPlugin()) {
for (auto it = m_plugins.cbegin(); it != m_plugins.constEnd(); it++) {
if (it.key() == KrfbConfig::preferredFrameBufferPlugin()) {
qCDebug(KRFB) << "Using FrameBuffer:" << KrfbConfig::preferredFrameBufferPlugin();
QSharedPointer<FrameBuffer> frameBuffer(iter.value()->frameBuffer(id, args));
QSharedPointer<FrameBuffer> frameBuffer(it.value()->frameBuffer(id, args));
if (frameBuffer) {
m_frameBuffers.insert(id, frameBuffer.toWeakRef());
return frameBuffer;
}
}
++iter;
}
// No valid framebuffer plugin found.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment