diff --git a/kcontrol/componentchooser/windowmanagers/compiz-custom.desktop b/kcontrol/componentchooser/windowmanagers/compiz-custom.desktop index f642834f..2af5f924 100644 --- a/kcontrol/componentchooser/windowmanagers/compiz-custom.desktop +++ b/kcontrol/componentchooser/windowmanagers/compiz-custom.desktop @@ -76,6 +76,6 @@ Name[x-test]=xxCompiz custom (create wrapper script 'compiz-kde-launcher' to lau Name[zh_CN]=Compiz 定制(创建包装脚本“compiz-kde-launcher”以启动它) Name[zh_TW]=Compiz 自訂(建立外包文稿 compiz-kde-launcher 來啟動) Exec=compiz-kde-launcher -TryExec=compiz +TryExec=compiz-kde-launcher X-KDE-WindowManagerId=compiz X-KDE-WindowManagerRestartArgument=--replace diff --git a/kcontrol/componentchooser/windowmanagers/kwin_gles.desktop b/kcontrol/componentchooser/windowmanagers/kwin_gles.desktop deleted file mode 100644 index 700557be..00000000 --- a/kcontrol/componentchooser/windowmanagers/kwin_gles.desktop +++ /dev/null @@ -1,5 +0,0 @@ -[Desktop Entry] -Name=KWin GLES -Exec=kwin_gles -TryExec=kwin_gles -X-KDE-WindowManagerRestartArgument=--replace diff --git a/kwin/client.cpp b/kwin/client.cpp index 327f59a0..ed219755 100644 --- a/kwin/client.cpp +++ b/kwin/client.cpp @@ -1449,7 +1449,7 @@ void Client::setDesktop(int desktop) // the next desktop change { foreach (Client * c2, mainClients()) - c2->setDesktop(desktop); + c2->setDesktop(desktop); } FocusChain::self()->update(this, FocusChain::MakeFirst); diff --git a/kwin/clients/oxygen/config/oxygenconfig.cpp b/kwin/clients/oxygen/config/oxygenconfig.cpp index df1b76f9..977fd1e1 100644 --- a/kwin/clients/oxygen/config/oxygenconfig.cpp +++ b/kwin/clients/oxygen/config/oxygenconfig.cpp @@ -88,8 +88,9 @@ namespace Oxygen loadConfiguration( configuration ); // load shadows - foreach( ShadowConfigWidget* ui, _configWidget->shadowConfigurations ) - { ui->readConfig( _configuration.data() ); } + foreach( ShadowConfigWidget* ui, _configWidget->shadowConfigurations ) { + ui->readConfig( _configuration.data() ); + } // load exceptions ExceptionList exceptions; @@ -136,8 +137,9 @@ namespace Oxygen ExceptionList( exceptions ).writeConfig( _configuration ); // write shadow configuration - foreach( ShadowConfigWidget* ui, _configWidget->shadowConfigurations ) - { ui->writeConfig( _configuration.data() ); } + foreach( ShadowConfigWidget* ui, _configWidget->shadowConfigurations ) { + ui->writeConfig( _configuration.data() ); + } // sync configuration _configuration->sync(); @@ -157,8 +159,9 @@ namespace Oxygen loadConfiguration( configuration ); // load shadows - foreach( ShadowConfigWidget* ui, _configWidget->shadowConfigurations ) - { ui->readDefaults( _configuration.data() ); } + foreach( ShadowConfigWidget* ui, _configWidget->shadowConfigurations ) { + ui->readDefaults( _configuration.data() ); + } updateChanged(); diff --git a/kwin/clients/oxygen/oxygenclient.cpp b/kwin/clients/oxygen/oxygenclient.cpp index d77809b7..70f53368 100644 --- a/kwin/clients/oxygen/oxygenclient.cpp +++ b/kwin/clients/oxygen/oxygenclient.cpp @@ -101,8 +101,9 @@ namespace Oxygen { QList children( widget()->findChildren() ); - foreach( QLabel* widget, children ) - { widget->setAutoFillBackground( false ); } + foreach( QLabel* widget, children ) { + widget->setAutoFillBackground( false ); + } // also change shadow configuration size to something that fits in the preview list shadowCache().setShadowSize( QPalette::Active, 15 ); @@ -1360,8 +1361,7 @@ namespace Oxygen // update buttons QList buttons( widget()->findChildren() ); - foreach( Button* button, buttons ) - { + foreach( Button* button, buttons ) { if( ( button->isVisible() || isPreview() ) && event->rect().intersects( button->geometry() ) ) { @@ -1391,10 +1391,10 @@ namespace Oxygen // update buttons QList buttons( widget()->findChildren() ); - foreach( Button* button, buttons ) - { - if( event->rect().intersects( button->geometry() ) ) - { button->update(); } + foreach( Button* button, buttons ) { + if( event->rect().intersects( button->geometry() ) ) { + button->update(); + } } } diff --git a/kwin/clients/oxygen/oxygenexceptionlist.cpp b/kwin/clients/oxygen/oxygenexceptionlist.cpp index cf54f0a2..6095d1c4 100644 --- a/kwin/clients/oxygen/oxygenexceptionlist.cpp +++ b/kwin/clients/oxygen/oxygenexceptionlist.cpp @@ -83,8 +83,7 @@ namespace Oxygen // rewrite current exceptions int index = 0; - foreach( const ConfigurationPtr& exception, _exceptions ) - { + foreach( const ConfigurationPtr& exception, _exceptions ) { Util::writeConfig( exception.data(), config.data(), exceptionGroupName( index ) ); ++index; diff --git a/kwin/clients/oxygen/oxygenfactory.cpp b/kwin/clients/oxygen/oxygenfactory.cpp index e508d36a..3b424204 100644 --- a/kwin/clients/oxygen/oxygenfactory.cpp +++ b/kwin/clients/oxygen/oxygenfactory.cpp @@ -154,8 +154,7 @@ namespace Oxygen QString windowTitle; QString className; - foreach( const ConfigurationPtr& configuration, _exceptions ) - { + foreach( const ConfigurationPtr& configuration, _exceptions ) { // discard disabled exceptions if( !configuration->enabled() ) continue; diff --git a/kwin/composite.cpp b/kwin/composite.cpp index dab24ff8..fc9592a7 100644 --- a/kwin/composite.cpp +++ b/kwin/composite.cpp @@ -258,13 +258,13 @@ void Compositor::finish() foreach (Deleted * c, Workspace::self()->deletedList()) m_scene->windowDeleted(c); foreach (Client * c, Workspace::self()->clientList()) - c->finishCompositing(); + c->finishCompositing(); foreach (Client * c, Workspace::self()->desktopList()) - c->finishCompositing(); + c->finishCompositing(); foreach (Unmanaged * c, Workspace::self()->unmanagedList()) - c->finishCompositing(); + c->finishCompositing(); foreach (Deleted * c, Workspace::self()->deletedList()) - c->finishCompositing(); + c->finishCompositing(); xcb_composite_unredirect_subwindows(connection(), rootWindow(), XCB_COMPOSITE_REDIRECT_MANUAL); delete effects; effects = NULL; @@ -545,9 +545,10 @@ void Compositor::performCompositing() // TODO ? // this cannot be used so carelessly - needs protections against broken clients, the window // should not get focus before it's displayed, handle unredirected windows properly and so on. - foreach (Toplevel *t, windows) + foreach (Toplevel *t, windows) { if (!t->readyForPainting()) windows.removeAll(t); + } QRegion repaints = repaints_region; // clear all repaints, so that post-pass can add repaints for the next repaint @@ -566,18 +567,22 @@ void Compositor::performCompositing() bool Compositor::windowRepaintsPending() const { - foreach (Toplevel * c, Workspace::self()->clientList()) - if (!c->repaints().isEmpty()) - return true; - foreach (Toplevel * c, Workspace::self()->desktopList()) - if (!c->repaints().isEmpty()) - return true; - foreach (Toplevel * c, Workspace::self()->unmanagedList()) - if (!c->repaints().isEmpty()) - return true; - foreach (Toplevel * c, Workspace::self()->deletedList()) - if (!c->repaints().isEmpty()) - return true; + foreach (Toplevel * c, Workspace::self()->clientList()) { + if (!c->repaints().isEmpty()) + return true; + } + foreach (Toplevel * c, Workspace::self()->desktopList()) { + if (!c->repaints().isEmpty()) + return true; + } + foreach (Toplevel * c, Workspace::self()->unmanagedList()) { + if (!c->repaints().isEmpty()) + return true; + } + foreach (Toplevel * c, Workspace::self()->deletedList()) { + if (!c->repaints().isEmpty()) + return true; + } return false; } @@ -670,9 +675,9 @@ void Compositor::delayedCheckUnredirect() ToplevelList list; bool changed = forceUnredirectCheck; foreach (Client * c, Workspace::self()->clientList()) - list.append(c); + list.append(c); foreach (Unmanaged * c, Workspace::self()->unmanagedList()) - list.append(c); + list.append(c); foreach (Toplevel * c, list) { if (c->updateUnredirectedState()) changed = true; diff --git a/kwin/compositingprefs.cpp b/kwin/compositingprefs.cpp index 946f0860..8154c402 100644 --- a/kwin/compositingprefs.cpp +++ b/kwin/compositingprefs.cpp @@ -21,35 +21,15 @@ along with this program. If not, see . #include "config-kwin.h" #include "compositingprefs.h" - #include "xcbutils.h" -#include #include -#include -#include -#include -#include -#include -#include - -#include +#include namespace KWin { -extern int screen_number; // main.cpp -extern bool is_multihead; - -CompositingPrefs::CompositingPrefs() -{ -} - -CompositingPrefs::~CompositingPrefs() -{ -} - bool CompositingPrefs::compositingPossible() { if (!Xcb::Extensions::self()->isCompositeAvailable()) { diff --git a/kwin/compositingprefs.h b/kwin/compositingprefs.h index d65c801e..6d7c11c4 100644 --- a/kwin/compositingprefs.h +++ b/kwin/compositingprefs.h @@ -22,7 +22,6 @@ along with this program. If not, see . #define KWIN_COMPOSITINGPREFS_H #include -#include #include "kwinglobals.h" @@ -33,9 +32,6 @@ namespace KWin class CompositingPrefs { public: - CompositingPrefs(); - ~CompositingPrefs(); - static bool compositingPossible(); static QString compositingNotPossibleReason(); }; diff --git a/kwin/effects/diminactive/diminactive.cpp b/kwin/effects/diminactive/diminactive.cpp index 6a4a2878..af86e7be 100644 --- a/kwin/effects/diminactive/diminactive.cpp +++ b/kwin/effects/diminactive/diminactive.cpp @@ -122,7 +122,7 @@ void DimInactiveEffect::slotWindowActivated(EffectWindow* w) if ((w == NULL || w->group() != active->group()) && active->group() != NULL) { // repaint windows that are no longer in the active group foreach (EffectWindow * tmp, active->group()->members()) - tmp->addRepaintFull(); + tmp->addRepaintFull(); } } else active->addRepaintFull(); @@ -133,7 +133,7 @@ void DimInactiveEffect::slotWindowActivated(EffectWindow* w) if (active->group() != NULL) { // repaint newly active windows foreach (EffectWindow * tmp, active->group()->members()) - tmp->addRepaintFull(); + tmp->addRepaintFull(); } } else active->addRepaintFull(); diff --git a/kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp b/kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp index e85b2ffa..818768f1 100644 --- a/kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp +++ b/kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp @@ -87,10 +87,12 @@ void TaskbarThumbnailEffect::slotWindowDamaged(EffectWindow* w, const QRect& dam { Q_UNUSED(damage); // Update the thumbnail if the window was damaged - foreach (EffectWindow * window, thumbnails.uniqueKeys()) - foreach (const Data & thumb, thumbnails.values(window)) - if (w == effects->findWindow(thumb.window)) - window->addRepaint(thumb.rect); + foreach (EffectWindow * window, thumbnails.uniqueKeys()) { + foreach (const Data & thumb, thumbnails.values(window)) { + if (w == effects->findWindow(thumb.window)) + window->addRepaint(thumb.rect); + } + } } void TaskbarThumbnailEffect::slotWindowAdded(EffectWindow* w) diff --git a/kwin/effects/thumbnailaside/thumbnailaside.cpp b/kwin/effects/thumbnailaside/thumbnailaside.cpp index 85f66e27..25ed3c3b 100644 --- a/kwin/effects/thumbnailaside/thumbnailaside.cpp +++ b/kwin/effects/thumbnailaside/thumbnailaside.cpp @@ -178,7 +178,7 @@ void ThumbnailAsideEffect::arrange() void ThumbnailAsideEffect::repaintAll() { foreach (const Data & d, windows) - effects->addRepaint(d.rect); + effects->addRepaint(d.rect); } bool ThumbnailAsideEffect::isActive() const diff --git a/kwin/geometry.cpp b/kwin/geometry.cpp index 9a573b49..822f3a16 100644 --- a/kwin/geometry.cpp +++ b/kwin/geometry.cpp @@ -333,9 +333,10 @@ QRegion Workspace::restrictedMoveArea(int desktop, StrutAreas areas) const if (desktop == NETWinInfo::OnAllDesktops || desktop == 0) desktop = VirtualDesktopManager::self()->current(); QRegion region; - foreach (const StrutRect & rect, restrictedmovearea[desktop]) - if (areas & rect.area()) - region += rect; + foreach (const StrutRect & rect, restrictedmovearea[desktop]) { + if (areas & rect.area()) + region += rect; + } return region; } @@ -349,9 +350,10 @@ QRegion Workspace::previousRestrictedMoveArea(int desktop, StrutAreas areas) con if (desktop == NETWinInfo::OnAllDesktops || desktop == 0) desktop = VirtualDesktopManager::self()->current(); QRegion region; - foreach (const StrutRect & rect, oldrestrictedmovearea.at(desktop)) - if (areas & rect.area()) - region += rect; + foreach (const StrutRect & rect, oldrestrictedmovearea.at(desktop)) { + if (areas & rect.area()) + region += rect; + } return region; } diff --git a/kwin/group.cpp b/kwin/group.cpp index c061e234..2251f7a5 100644 --- a/kwin/group.cpp +++ b/kwin/group.cpp @@ -384,7 +384,7 @@ void Workspace::updateMinimizedOfTransients(Client* c) } if (c->isModal()) { // if a modal dialog is minimized, minimize its mainwindow too foreach (Client * c2, c->mainClients()) - c2->minimize(); + c2->minimize(); } } else { // else unmiminize the transients @@ -398,7 +398,7 @@ void Workspace::updateMinimizedOfTransients(Client* c) } if (c->isModal()) { foreach (Client * c2, c->mainClients()) - c2->unminimize(); + c2->unminimize(); } } } @@ -923,7 +923,7 @@ ClientList Client::allMainClients() const { ClientList result = mainClients(); foreach (const Client * cl, result) - result += cl->allMainClients(); + result += cl->allMainClients(); return result; } diff --git a/kwin/kcmkwin/kwinscreenedges/monitor.cpp b/kwin/kcmkwin/kwinscreenedges/monitor.cpp index f567a129..2c5ed88a 100644 --- a/kwin/kcmkwin/kwinscreenedges/monitor.cpp +++ b/kwin/kcmkwin/kwinscreenedges/monitor.cpp @@ -163,9 +163,10 @@ void Monitor::selectEdgeItem(int edge, int index) int Monitor::selectedEdgeItem(int edge) const { - foreach (QAction * act, popup_actions[ edge ]) - if (act->isChecked()) - return popup_actions[ edge ].indexOf(act); + foreach (QAction * act, popup_actions[ edge ]) { + if (act->isChecked()) + return popup_actions[ edge ].indexOf(act); + } abort(); } diff --git a/kwin/options.cpp b/kwin/options.cpp index e0ae5763..e303b989 100644 --- a/kwin/options.cpp +++ b/kwin/options.cpp @@ -27,7 +27,6 @@ along with this program. If not, see . #include #include -#include #include #include #include diff --git a/kwin/useractions.cpp b/kwin/useractions.cpp index 4ffccc32..56606923 100755 --- a/kwin/useractions.cpp +++ b/kwin/useractions.cpp @@ -1762,7 +1762,7 @@ void Workspace::slotInvertScreen() if (succeeded) return; -#endif +#endif // KWIN_NO_XF86VM if (!succeeded) kDebug(1212) << "sorry - neither Xrandr, nor XF86VidModeSetGammaRamp worked and there's no inversion supplying effect plugin either"; @@ -1791,11 +1791,9 @@ void Client::setShortcut(const QString& _cut) } QList< KShortcut > keys; QStringList groups = cut.split(" - "); - for (QStringList::ConstIterator it = groups.constBegin(); - it != groups.constEnd(); - ++it) { + foreach (const QString it, groups) { QRegExp reg("(.*\\+)\\((.*)\\)"); - if (reg.indexIn(*it) > -1) { + if (reg.indexIn(it) > -1) { QString base = reg.cap(1); QString list = reg.cap(2); for (int i = 0; @@ -1807,23 +1805,17 @@ void Client::setShortcut(const QString& _cut) } } else { // regexp doesn't match, so it should be a normal shortcut - KShortcut c(*it); + KShortcut c(it); if (!c.isEmpty()) { keys.append(c); } } } - for (QList< KShortcut >::ConstIterator it = keys.constBegin(); - it != keys.constEnd(); - ++it) { - if (_shortcut == *it) // current one is in the list + foreach (const KShortcut it, keys) { + if (_shortcut == it) // current one is in the list return; - } - for (QList< KShortcut >::ConstIterator it = keys.constBegin(); - it != keys.constEnd(); - ++it) { - if (workspace()->shortcutAvailable(*it, this)) { - setShortcutInternal(*it); + if (workspace()->shortcutAvailable(it, this)) { + setShortcutInternal(it); return; } } @@ -1855,15 +1847,13 @@ bool Workspace::shortcutAvailable(const KShortcut& cut, Client* ignore) const { if (ignore && cut == ignore->shortcut()) return true; - Q_FOREACH (const QKeySequence &seq, cut.toList()) { + foreach (const QKeySequence &seq, cut.toList()) { if (!KGlobalAccel::getGlobalShortcutsByKey(seq).isEmpty()) { return false; } } - for (ClientList::ConstIterator it = clients.constBegin(); - it != clients.constEnd(); - ++it) { - if ((*it) != ignore && (*it)->shortcut() == cut) + foreach (const Client* it, clients) { + if (it != ignore && it->shortcut() == cut) return false; } return true; diff --git a/kwin/workspace.cpp b/kwin/workspace.cpp index 4616867a..00d84f3b 100644 --- a/kwin/workspace.cpp +++ b/kwin/workspace.cpp @@ -434,7 +434,7 @@ Workspace::~Workspace() delete Placement::self(); delete client_keys_dialog; foreach (SessionInfo * s, session) - delete s; + delete s; // TODO: ungrabXServer();