Fix iterator

svn path=/trunk/KDE/kdebase/workspace/; revision=883047
This commit is contained in:
Laurent Montel 2008-11-11 23:09:11 +00:00
parent b274203a6a
commit 5535a9de5e
22 changed files with 200 additions and 200 deletions

View file

@ -875,8 +875,8 @@ void Client::setActive( bool act )
StackingUpdatesBlocker blocker( workspace()); StackingUpdatesBlocker blocker( workspace());
workspace()->updateClientLayer( this ); // active windows may get different layer workspace()->updateClientLayer( this ); // active windows may get different layer
ClientList mainclients = mainClients(); ClientList mainclients = mainClients();
for( ClientList::ConstIterator it = mainclients.begin(); for( ClientList::ConstIterator it = mainclients.constBegin();
it != mainclients.end(); it != mainclients.constEnd();
++it ) ++it )
if( (*it)->isFullScreen()) // fullscreens go high even if their transient is active if( (*it)->isFullScreen()) // fullscreens go high even if their transient is active
workspace()->updateClientLayer( *it ); workspace()->updateClientLayer( *it );

View file

@ -645,8 +645,8 @@ bool Client::isMinimizable() const
{ // #66868 - let other xmms windows be minimized when the mainwindow is minimized { // #66868 - let other xmms windows be minimized when the mainwindow is minimized
bool shown_mainwindow = false; bool shown_mainwindow = false;
ClientList mainclients = mainClients(); ClientList mainclients = mainClients();
for( ClientList::ConstIterator it = mainclients.begin(); for( ClientList::ConstIterator it = mainclients.constBegin();
it != mainclients.end(); it != mainclients.constEnd();
++it ) ++it )
{ {
if( (*it)->isShown( true )) if( (*it)->isShown( true ))
@ -857,8 +857,8 @@ void Client::updateVisibility()
return; return;
} }
bool belongs_to_desktop = false; bool belongs_to_desktop = false;
for( ClientList::ConstIterator it = group()->members().begin(); for( ClientList::ConstIterator it = group()->members().constBegin();
it != group()->members().end(); it != group()->members().constEnd();
++it ) ++it )
if( (*it)->isDesktop()) if( (*it)->isDesktop())
{ {
@ -1508,8 +1508,8 @@ void Client::getIcons()
if( icon_pix.isNull() && isTransient()) if( icon_pix.isNull() && isTransient())
{ // then mainclients { // then mainclients
ClientList mainclients = mainClients(); ClientList mainclients = mainClients();
for( ClientList::ConstIterator it = mainclients.begin(); for( ClientList::ConstIterator it = mainclients.constBegin();
it != mainclients.end() && icon_pix.isNull(); it != mainclients.constEnd() && icon_pix.isNull();
++it ) ++it )
{ {
icon_pix = (*it)->icon(); icon_pix = (*it)->icon();

View file

@ -90,7 +90,7 @@ void PlastikConfig::save(KConfigGroup&)
KConfigGroup cg(m_config, "General"); KConfigGroup cg(m_config, "General");
QList<QRadioButton *> buttons = m_dialog->titleAlign->findChildren<QRadioButton *>(); QList<QRadioButton *> buttons = m_dialog->titleAlign->findChildren<QRadioButton *>();
for(QList<QRadioButton *>::ConstIterator it = buttons.begin(); it != buttons.end(); ++it) for(QList<QRadioButton *>::ConstIterator it = buttons.constBegin(); it != buttons.constEnd(); ++it)
{ {
if((*it)->isChecked()) if((*it)->isChecked())
cg.writeEntry("TitleAlignment", QString((*it)->objectName())); cg.writeEntry("TitleAlignment", QString((*it)->objectName()));

View file

@ -248,8 +248,8 @@ void Workspace::finishCompositing()
scene = NULL; scene = NULL;
compositeTimer.stop(); compositeTimer.stop();
repaints_region = QRegion(); repaints_region = QRegion();
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.constBegin();
it != clients.end(); it != clients.constEnd();
++it ) ++it )
{ // forward all opacity values to the frame in case there'll be other CM running { // forward all opacity values to the frame in case there'll be other CM running
if( (*it)->opacity() != 1.0 ) if( (*it)->opacity() != 1.0 )

View file

@ -58,8 +58,8 @@ int main( int argc, char* argv[] )
++pos; ++pos;
dest_cfg.deleteGroup( QString::number( pos )); dest_cfg.deleteGroup( QString::number( pos ));
KConfigGroup dcg2 (&dest_cfg, QString::number( pos )); KConfigGroup dcg2 (&dest_cfg, QString::number( pos ));
for( QMap< QString, QString >::ConstIterator it = entries.begin(); for( QMap< QString, QString >::ConstIterator it = entries.constBegin();
it != entries.end(); it != entries.constEnd();
++it ) ++it )
dcg2.writeEntry( it.key(), *it ); dcg2.writeEntry( it.key(), *it );
} }

View file

@ -108,7 +108,7 @@ void Workspace::updateClientArea( bool force )
iS ++ ) iS ++ )
new_sareas[ i ][ iS ] = screens[ iS ]; new_sareas[ i ][ iS ] = screens[ iS ];
} }
for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it) for ( ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it)
{ {
if( !(*it)->hasStrut()) if( !(*it)->hasStrut())
continue; continue;
@ -200,12 +200,12 @@ void Workspace::updateClientArea( bool force )
} }
updateTopMenuGeometry(); updateTopMenuGeometry();
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.constBegin();
it != clients.end(); it != clients.constEnd();
++it) ++it)
(*it)->checkWorkspacePosition(); (*it)->checkWorkspacePosition();
for( ClientList::ConstIterator it = desktops.begin(); for( ClientList::ConstIterator it = desktops.constBegin();
it != desktops.end(); it != desktops.constEnd();
++it) ++it)
(*it)->checkWorkspacePosition(); (*it)->checkWorkspacePosition();
} }
@ -353,7 +353,7 @@ QPoint Workspace::adjustClientPosition( Client* c, QPoint pos, bool unrestricted
if (snap) if (snap)
{ {
QList<Client *>::ConstIterator l; QList<Client *>::ConstIterator l;
for (l = clients.begin();l != clients.end();++l ) for (l = clients.constBegin();l != clients.constEnd();++l )
{ {
if ((*l)->isOnDesktop(currentDesktop()) && if ((*l)->isOnDesktop(currentDesktop()) &&
!(*l)->isMinimized() !(*l)->isMinimized()
@ -568,7 +568,7 @@ QRect Workspace::adjustClientSize( Client* c, QRect moveResizeGeom, int mode )
deltaX = int(snap); deltaX = int(snap);
deltaY = int(snap); deltaY = int(snap);
QList<Client *>::ConstIterator l; QList<Client *>::ConstIterator l;
for (l = clients.begin();l != clients.end();++l ) for (l = clients.constBegin();l != clients.constEnd();++l )
{ {
if ((*l)->isOnDesktop(currentDesktop()) && if ((*l)->isOnDesktop(currentDesktop()) &&
!(*l)->isMinimized() !(*l)->isMinimized()
@ -790,8 +790,8 @@ void Workspace::updateTopMenuGeometry( Client* c )
area = clientArea( MaximizeFullArea, QPoint( 0, 0 ), 1 ); // HACK desktop ? area = clientArea( MaximizeFullArea, QPoint( 0, 0 ), 1 ); // HACK desktop ?
area.setHeight( topMenuHeight()); area.setHeight( topMenuHeight());
topmenu_space->setGeometry( area ); topmenu_space->setGeometry( area );
for( ClientList::ConstIterator it = topmenus.begin(); for( ClientList::ConstIterator it = topmenus.constBegin();
it != topmenus.end(); it != topmenus.constEnd();
++it ) ++it )
updateTopMenuGeometry( *it ); updateTopMenuGeometry( *it );
} }

View file

@ -65,8 +65,8 @@ bool performTransiencyCheck()
{ {
bool ret = true; bool ret = true;
ClientList clients = Workspace::self()->clients; ClientList clients = Workspace::self()->clients;
for( ClientList::ConstIterator it1 = clients.begin(); for( ClientList::ConstIterator it1 = clients.constBegin();
it1 != clients.end(); it1 != clients.constEnd();
++it1 ) ++it1 )
{ {
if( (*it1)->deleting ) if( (*it1)->deleting )
@ -92,8 +92,8 @@ bool performTransiencyCheck()
else else
{ {
ClientList mains = (*it1)->mainClients(); ClientList mains = (*it1)->mainClients();
for( ClientList::ConstIterator it2 = mains.begin(); for( ClientList::ConstIterator it2 = mains.constBegin();
it2 != mains.end(); it2 != mains.constEnd();
++it2 ) ++it2 )
{ {
if( transiencyCheckNonExistent if( transiencyCheckNonExistent
@ -113,8 +113,8 @@ bool performTransiencyCheck()
} }
} }
ClientList trans = (*it1)->transients_list; ClientList trans = (*it1)->transients_list;
for( ClientList::ConstIterator it2 = trans.begin(); for( ClientList::ConstIterator it2 = trans.constBegin();
it2 != trans.end(); it2 != trans.constEnd();
++it2 ) ++it2 )
{ {
if( transiencyCheckNonExistent if( transiencyCheckNonExistent
@ -134,13 +134,13 @@ bool performTransiencyCheck()
} }
} }
GroupList groups = Workspace::self()->groups; GroupList groups = Workspace::self()->groups;
for( GroupList::ConstIterator it1 = groups.begin(); for( GroupList::ConstIterator it1 = groups.constBegin();
it1 != groups.end(); it1 != groups.constEnd();
++it1 ) ++it1 )
{ {
ClientList members = (*it1)->members(); ClientList members = (*it1)->members();
for( ClientList::ConstIterator it2 = members.begin(); for( ClientList::ConstIterator it2 = members.constBegin();
it2 != members.end(); it2 != members.constEnd();
++it2 ) ++it2 )
{ {
if( (*it2)->in_group != *it1 ) if( (*it2)->in_group != *it1 )
@ -329,8 +329,8 @@ void Group::getIcons()
Group* Workspace::findGroup( Window leader ) const Group* Workspace::findGroup( Window leader ) const
{ {
assert( leader != None ); assert( leader != None );
for( GroupList::ConstIterator it = groups.begin(); for( GroupList::ConstIterator it = groups.constBegin();
it != groups.end(); it != groups.constEnd();
++it ) ++it )
if( (*it)->leader() == leader ) if( (*it)->leader() == leader )
return *it; return *it;
@ -343,8 +343,8 @@ Group* Workspace::findClientLeaderGroup( const Client* c ) const
{ {
TRANSIENCY_CHECK( c ); TRANSIENCY_CHECK( c );
Group* ret = NULL; Group* ret = NULL;
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.constBegin();
it != clients.end(); it != clients.constEnd();
++it ) ++it )
{ {
if( *it == c ) if( *it == c )
@ -380,8 +380,8 @@ void Workspace::updateMinimizedOfTransients( Client* c )
// if mainwindow is minimized or shaded, minimize transients too // if mainwindow is minimized or shaded, minimize transients too
if ( c->isMinimized() || c->isShade() ) if ( c->isMinimized() || c->isShade() )
{ {
for( ClientList::ConstIterator it = c->transients().begin(); for( ClientList::ConstIterator it = c->transients().constBegin();
it != c->transients().end(); it != c->transients().constEnd();
++it ) ++it )
{ {
if( !(*it)->isMinimized() if( !(*it)->isMinimized()
@ -394,8 +394,8 @@ void Workspace::updateMinimizedOfTransients( Client* c )
} }
else else
{ // else unmiminize the transients { // else unmiminize the transients
for( ClientList::ConstIterator it = c->transients().begin(); for( ClientList::ConstIterator it = c->transients().constBegin();
it != c->transients().end(); it != c->transients().constEnd();
++it ) ++it )
{ {
if( (*it)->isMinimized() if( (*it)->isMinimized()
@ -414,8 +414,8 @@ void Workspace::updateMinimizedOfTransients( Client* c )
*/ */
void Workspace::updateOnAllDesktopsOfTransients( Client* c ) void Workspace::updateOnAllDesktopsOfTransients( Client* c )
{ {
for( ClientList::ConstIterator it = c->transients().begin(); for( ClientList::ConstIterator it = c->transients().constBegin();
it != c->transients().end(); it != c->transients().constEnd();
++it) ++it)
{ {
if( (*it)->isOnAllDesktops() != c->isOnAllDesktops()) if( (*it)->isOnAllDesktops() != c->isOnAllDesktops())
@ -427,8 +427,8 @@ void Workspace::updateOnAllDesktopsOfTransients( Client* c )
void Workspace::checkTransients( Window w ) void Workspace::checkTransients( Window w )
{ {
TRANSIENCY_CHECK( NULL ); TRANSIENCY_CHECK( NULL );
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.constBegin();
it != clients.end(); it != clients.constEnd();
++it ) ++it )
(*it)->checkTransient( w ); (*it)->checkTransient( w );
} }
@ -639,8 +639,8 @@ void Client::removeFromMainClients()
transientFor()->removeTransient( this ); transientFor()->removeTransient( this );
if( groupTransient()) if( groupTransient())
{ {
for( ClientList::ConstIterator it = group()->members().begin(); for( ClientList::ConstIterator it = group()->members().constBegin();
it != group()->members().end(); it != group()->members().constEnd();
++it ) ++it )
(*it)->removeTransient( this ); (*it)->removeTransient( this );
} }
@ -675,14 +675,14 @@ void Client::cleanGrouping()
// it != mains.end(); // it != mains.end();
// ++it ) // ++it )
// kDebug() << "MN2:" << *it; // kDebug() << "MN2:" << *it;
for( ClientList::ConstIterator it = transients_list.begin(); for( ClientList::ConstIterator it = transients_list.constBegin();
it != transients_list.end(); it != transients_list.constEnd();
) )
{ {
if( (*it)->transientFor() == this ) if( (*it)->transientFor() == this )
{ {
removeTransient( *it ); removeTransient( *it );
it = transients_list.begin(); // restart, just in case something more has changed with the list it = transients_list.constBegin(); // restart, just in case something more has changed with the list
} }
else else
++it; ++it;
@ -705,8 +705,8 @@ void Client::cleanGrouping()
ClientList group_members = group()->members(); ClientList group_members = group()->members();
group()->removeMember( this ); group()->removeMember( this );
in_group = NULL; in_group = NULL;
for( ClientList::ConstIterator it = group_members.begin(); for( ClientList::ConstIterator it = group_members.constBegin();
it != group_members.end(); it != group_members.constEnd();
++it ) ++it )
(*it)->removeTransient( this ); (*it)->removeTransient( this );
// kDebug() << "CLEANGROUPING4:" << this; // kDebug() << "CLEANGROUPING4:" << this;
@ -723,14 +723,14 @@ void Client::cleanGrouping()
void Client::checkGroupTransients() void Client::checkGroupTransients()
{ {
TRANSIENCY_CHECK( this ); TRANSIENCY_CHECK( this );
for( ClientList::ConstIterator it1 = group()->members().begin(); for( ClientList::ConstIterator it1 = group()->members().constBegin();
it1 != group()->members().end(); it1 != group()->members().constEnd();
++it1 ) ++it1 )
{ {
if( !(*it1)->groupTransient()) // check all group transients in the group if( !(*it1)->groupTransient()) // check all group transients in the group
continue; // TODO optimize to check only the changed ones? continue; // TODO optimize to check only the changed ones?
for( ClientList::ConstIterator it2 = group()->members().begin(); for( ClientList::ConstIterator it2 = group()->members().constBegin();
it2 != group()->members().end(); it2 != group()->members().constEnd();
++it2 ) // group transients can be transient only for others in the group, ++it2 ) // group transients can be transient only for others in the group,
{ // so don't make them transient for the ones that are transient for it { // so don't make them transient for the ones that are transient for it
if( *it1 == *it2 ) if( *it1 == *it2 )
@ -756,8 +756,8 @@ void Client::checkGroupTransients()
// transient for it - the indirect transiency actually shouldn't break anything, // transient for it - the indirect transiency actually shouldn't break anything,
// but it can lead to exponentially expensive operations (#95231) // but it can lead to exponentially expensive operations (#95231)
// TODO this is pretty slow as well // TODO this is pretty slow as well
for( ClientList::ConstIterator it3 = group()->members().begin(); for( ClientList::ConstIterator it3 = group()->members().constBegin();
it3 != group()->members().end(); it3 != group()->members().constEnd();
++it3 ) ++it3 )
{ {
if( *it1 == *it2 || *it2 == *it3 || *it1 == *it3 ) if( *it1 == *it2 || *it2 == *it3 || *it1 == *it3 )
@ -928,8 +928,8 @@ bool Client::hasTransientInternal( const Client* cl, bool indirect, ConstClientL
if( set.contains( this )) if( set.contains( this ))
return false; return false;
set.append( this ); set.append( this );
for( ClientList::ConstIterator it = transients().begin(); for( ClientList::ConstIterator it = transients().constBegin();
it != transients().end(); it != transients().constEnd();
++it ) ++it )
if( (*it)->hasTransientInternal( cl, indirect, set )) if( (*it)->hasTransientInternal( cl, indirect, set ))
return true; return true;
@ -943,8 +943,8 @@ ClientList Client::mainClients() const
if( transientFor() != NULL ) if( transientFor() != NULL )
return ClientList() << const_cast< Client* >( transientFor()); return ClientList() << const_cast< Client* >( transientFor());
ClientList result; ClientList result;
for( ClientList::ConstIterator it = group()->members().begin(); for( ClientList::ConstIterator it = group()->members().constBegin();
it != group()->members().end(); it != group()->members().constEnd();
++it ) ++it )
if((*it)->hasTransient( this, false )) if((*it)->hasTransient( this, false ))
result.append( *it ); result.append( *it );
@ -961,8 +961,8 @@ ClientList Client::allMainClients() const
Client* Client::findModal( bool allow_itself ) Client* Client::findModal( bool allow_itself )
{ {
for( ClientList::ConstIterator it = transients().begin(); for( ClientList::ConstIterator it = transients().constBegin();
it != transients().end(); it != transients().constEnd();
++it ) ++it )
if( Client* ret = (*it)->findModal( true )) if( Client* ret = (*it)->findModal( true ))
return ret; return ret;
@ -1071,14 +1071,14 @@ void Client::checkGroup( Group* set_group, bool force )
// no longer transient for ones in the old group // no longer transient for ones in the old group
if( old_group != NULL ) if( old_group != NULL )
{ {
for( ClientList::ConstIterator it = old_group->members().begin(); for( ClientList::ConstIterator it = old_group->members().constBegin();
it != old_group->members().end(); it != old_group->members().constEnd();
++it ) ++it )
(*it)->removeTransient( this ); (*it)->removeTransient( this );
} }
// and make transient for all in the new group // and make transient for all in the new group
for( ClientList::ConstIterator it = group()->members().begin(); for( ClientList::ConstIterator it = group()->members().constBegin();
it != group()->members().end(); it != group()->members().constEnd();
++it ) ++it )
{ {
if( *it == this ) if( *it == this )
@ -1088,8 +1088,8 @@ void Client::checkGroup( Group* set_group, bool force )
} }
// group transient splashscreens should be transient even for windows // group transient splashscreens should be transient even for windows
// in group mapped later // in group mapped later
for( ClientList::ConstIterator it = group()->members().begin(); for( ClientList::ConstIterator it = group()->members().constBegin();
it != group()->members().end(); it != group()->members().constEnd();
++it ) ++it )
{ {
if( !(*it)->isSplash()) if( !(*it)->isSplash())

View file

@ -516,7 +516,7 @@ void ButtonDropSite::recalcItemGeometry()
// update the geometry of the items in the left button list // update the geometry of the items in the left button list
int offset = r.left(); int offset = r.left();
for (ButtonList::const_iterator it = buttonsLeft.begin(); it != buttonsLeft.end(); ++it) { for (ButtonList::const_iterator it = buttonsLeft.constBegin(); it != buttonsLeft.constEnd(); ++it) {
int w = (*it)->width(); int w = (*it)->width();
(*it)->rect = QRect(offset, r.top(), w, (*it)->height() ); (*it)->rect = QRect(offset, r.top(), w, (*it)->height() );
offset += w; offset += w;
@ -524,7 +524,7 @@ void ButtonDropSite::recalcItemGeometry()
// the right button list... // the right button list...
offset = r.right() - calcButtonListWidth(buttonsRight); offset = r.right() - calcButtonListWidth(buttonsRight);
for (ButtonList::const_iterator it = buttonsRight.begin(); it != buttonsRight.end(); ++it) { for (ButtonList::const_iterator it = buttonsRight.constBegin(); it != buttonsRight.constEnd(); ++it) {
int w = (*it)->width(); int w = (*it)->width();
(*it)->rect = QRect(offset, r.top(), w, (*it)->height() ); (*it)->rect = QRect(offset, r.top(), w, (*it)->height() );
offset += w; offset += w;
@ -533,14 +533,14 @@ void ButtonDropSite::recalcItemGeometry()
ButtonDropSiteItem *ButtonDropSite::buttonAt(QPoint p) { ButtonDropSiteItem *ButtonDropSite::buttonAt(QPoint p) {
// try to find the item in the left button list // try to find the item in the left button list
for (ButtonList::const_iterator it = buttonsLeft.begin(); it != buttonsLeft.end(); ++it) { for (ButtonList::const_iterator it = buttonsLeft.constBegin(); it != buttonsLeft.constEnd(); ++it) {
if ( (*it)->rect.contains(p) ) { if ( (*it)->rect.contains(p) ) {
return *it; return *it;
} }
} }
// try to find the item in the right button list // try to find the item in the right button list
for (ButtonList::const_iterator it = buttonsRight.begin(); it != buttonsRight.end(); ++it) { for (ButtonList::const_iterator it = buttonsRight.constBegin(); it != buttonsRight.constEnd(); ++it) {
if ( (*it)->rect.contains(p) ) { if ( (*it)->rect.contains(p) ) {
return *it; return *it;
} }
@ -569,7 +569,7 @@ bool ButtonDropSite::removeButton(ButtonDropSiteItem *item) {
int ButtonDropSite::calcButtonListWidth(const ButtonList& btns) int ButtonDropSite::calcButtonListWidth(const ButtonList& btns)
{ {
int w = 0; int w = 0;
for (ButtonList::const_iterator it = btns.begin(); it != btns.end(); ++it) { for (ButtonList::const_iterator it = btns.constBegin(); it != btns.constEnd(); ++it) {
w += (*it)->width(); w += (*it)->width();
} }
@ -593,7 +593,7 @@ bool ButtonDropSite::removeSelectedButton()
void ButtonDropSite::drawButtonList(QPainter *p, const ButtonList& btns, int offset) void ButtonDropSite::drawButtonList(QPainter *p, const ButtonList& btns, int offset)
{ {
for (ButtonList::const_iterator it = btns.begin(); it != btns.end(); ++it) { for (ButtonList::const_iterator it = btns.constBegin(); it != btns.constEnd(); ++it) {
QRect itemRect = (*it)->rect; QRect itemRect = (*it)->rect;
if (itemRect.isValid() ) { if (itemRect.isValid() ) {
(*it)->draw(p, palette(), itemRect); (*it)->draw(p, palette(), itemRect);
@ -847,7 +847,7 @@ QString ButtonPositionWidget::buttonsLeft() const
{ {
ButtonList btns = m_dropSite->buttonsLeft; ButtonList btns = m_dropSite->buttonsLeft;
QString btnString = ""; QString btnString = "";
for (ButtonList::const_iterator it = btns.begin(); it != btns.end(); ++it) { for (ButtonList::const_iterator it = btns.constBegin(); it != btns.constEnd(); ++it) {
btnString.append( (*it)->button().type ); btnString.append( (*it)->button().type );
} }
return btnString; return btnString;
@ -857,7 +857,7 @@ QString ButtonPositionWidget::buttonsRight() const
{ {
ButtonList btns = m_dropSite->buttonsRight; ButtonList btns = m_dropSite->buttonsRight;
QString btnString = ""; QString btnString = "";
for (ButtonList::const_iterator it = btns.begin(); it != btns.end(); ++it) { for (ButtonList::const_iterator it = btns.constBegin(); it != btns.constEnd(); ++it) {
btnString.append( (*it)->button().type ); btnString.append( (*it)->button().type );
} }
return btnString; return btnString;

View file

@ -217,10 +217,10 @@ KWinDecorationModule::~KWinDecorationModule()
// And insert these into a DecorationInfo structure // And insert these into a DecorationInfo structure
void KWinDecorationModule::findDecorations() void KWinDecorationModule::findDecorations()
{ {
QStringList dirList = KGlobal::dirs()->findDirs("data", "kwin"); const QStringList dirList = KGlobal::dirs()->findDirs("data", "kwin");
QStringList::ConstIterator it; QStringList::ConstIterator it;
for (it = dirList.begin(); it != dirList.end(); ++it) for (it = dirList.constBegin(); it != dirList.constEnd(); ++it)
{ {
QDir d(*it); QDir d(*it);
if (d.exists()) if (d.exists())
@ -253,7 +253,7 @@ void KWinDecorationModule::createDecorationList()
// Sync with kwin hardcoded KDE2 style which has no desktop item // Sync with kwin hardcoded KDE2 style which has no desktop item
QStringList decorationNames; QStringList decorationNames;
// decorationNames.append( i18n("KDE 2") ); // decorationNames.append( i18n("KDE 2") );
for (it = decorations.begin(); it != decorations.end(); ++it) for (it = decorations.constBegin(); it != decorations.constEnd(); ++it)
{ {
decorationNames.append((*it).name); decorationNames.append((*it).name);
} }
@ -293,8 +293,8 @@ static const char* const border_names[ KDecorationDefines::BordersCount ] =
int KWinDecorationModule::borderSizeToIndex( BorderSize size, QList< BorderSize > sizes ) int KWinDecorationModule::borderSizeToIndex( BorderSize size, QList< BorderSize > sizes )
{ {
int pos = 0; int pos = 0;
for( QList< BorderSize >::ConstIterator it = sizes.begin(); for( QList< BorderSize >::ConstIterator it = sizes.constBegin();
it != sizes.end(); it != sizes.constEnd();
++it, ++pos ) ++it, ++pos )
if( size <= *it ) if( size <= *it )
break; break;
@ -304,9 +304,9 @@ int KWinDecorationModule::borderSizeToIndex( BorderSize size, QList< BorderSize
KDecorationDefines::BorderSize KWinDecorationModule::indexToBorderSize( int index, KDecorationDefines::BorderSize KWinDecorationModule::indexToBorderSize( int index,
QList< BorderSize > sizes ) QList< BorderSize > sizes )
{ {
QList< BorderSize >::ConstIterator it = sizes.begin(); QList< BorderSize >::ConstIterator it = sizes.constBegin();
for(; for(;
it != sizes.end(); it != sizes.constEnd();
++it, --index ) ++it, --index )
if( index == 0 ) if( index == 0 )
break; break;
@ -576,7 +576,7 @@ void KWinDecorationModule::checkSupportedBorderSizes()
cBorder->hide(); cBorder->hide();
} else { } else {
cBorder->clear(); cBorder->clear();
for (QList<BorderSize>::const_iterator it = sizes.begin(); it != sizes.end(); ++it) { for (QList<BorderSize>::const_iterator it = sizes.constBegin(); it != sizes.constEnd(); ++it) {
BorderSize size = *it; BorderSize size = *it;
cBorder->addItem(i18n(border_names[size]), borderSizeToIndex(size,sizes) ); cBorder->addItem(i18n(border_names[size]), borderSizeToIndex(size,sizes) );
} }

View file

@ -51,14 +51,14 @@ static void saveRules( const QList< Rules* >& rules )
{ {
KConfig cfg( "kwinrulesrc" ); KConfig cfg( "kwinrulesrc" );
QStringList groups = cfg.groupList(); QStringList groups = cfg.groupList();
for( QStringList::ConstIterator it = groups.begin(); for( QStringList::ConstIterator it = groups.constBegin();
it != groups.end(); it != groups.constEnd();
++it ) ++it )
cfg.deleteGroup( *it ); cfg.deleteGroup( *it );
cfg.group("General").writeEntry( "count", rules.count()); cfg.group("General").writeEntry( "count", rules.count());
int i = 1; int i = 1;
for( QList< Rules* >::ConstIterator it = rules.begin(); for( QList< Rules* >::ConstIterator it = rules.constBegin();
it != rules.end(); it != rules.constEnd();
++it ) ++it )
{ {
KConfigGroup cg( &cfg, QString::number( i )); KConfigGroup cg( &cfg, QString::number( i ));
@ -85,8 +85,8 @@ static Rules* findRule( const QList< Rules* >& rules, Window wid, bool whole_app
QByteArray machine = info.clientMachine().toLower(); QByteArray machine = info.clientMachine().toLower();
Rules* best_match = NULL; Rules* best_match = NULL;
int match_quality = 0; int match_quality = 0;
for( QList< Rules* >::ConstIterator it = rules.begin(); for( QList< Rules* >::ConstIterator it = rules.constBegin();
it != rules.end(); it != rules.constEnd();
++it ) ++it )
{ {
// try to find an exact match, i.e. not a generic rule // try to find an exact match, i.e. not a generic rule

View file

@ -178,14 +178,14 @@ void KCMRulesList::save()
{ {
KConfig cfg( QLatin1String("kwinrulesrc") ); KConfig cfg( QLatin1String("kwinrulesrc") );
QStringList groups = cfg.groupList(); QStringList groups = cfg.groupList();
for( QStringList::ConstIterator it = groups.begin(); for( QStringList::ConstIterator it = groups.constBegin();
it != groups.end(); it != groups.constEnd();
++it ) ++it )
cfg.deleteGroup( *it ); cfg.deleteGroup( *it );
cfg.group("General").writeEntry( "count", rules.count()); cfg.group("General").writeEntry( "count", rules.count());
int i = 1; int i = 1;
for( QVector< Rules* >::ConstIterator it = rules.begin(); for( QVector< Rules* >::ConstIterator it = rules.constBegin();
it != rules.end(); it != rules.constEnd();
++it ) ++it )
{ {
KConfigGroup cg( &cfg, QString::number( i )); KConfigGroup cg( &cfg, QString::number( i ));

View file

@ -101,8 +101,8 @@ void Workspace::updateClientLayer( Client* c )
return; return;
StackingUpdatesBlocker blocker( this ); StackingUpdatesBlocker blocker( this );
c->invalidateLayer(); // invalidate, will be updated when doing restacking c->invalidateLayer(); // invalidate, will be updated when doing restacking
for( ClientList::ConstIterator it = c->transients().begin(); for( ClientList::ConstIterator it = c->transients().constBegin();
it != c->transients().end(); it != c->transients().constEnd();
++it ) ++it )
updateClientLayer( *it ); updateClientLayer( *it );
} }
@ -202,9 +202,9 @@ void Workspace::propagateClients( bool propagate_new_clients )
cl = new Window[ desktops.count() + clients.count()]; cl = new Window[ desktops.count() + clients.count()];
pos = 0; pos = 0;
// TODO this is still not completely in the map order // TODO this is still not completely in the map order
for ( ClientList::ConstIterator it = desktops.begin(); it != desktops.end(); ++it ) for ( ClientList::ConstIterator it = desktops.constBegin(); it != desktops.constEnd(); ++it )
cl[pos++] = (*it)->window(); cl[pos++] = (*it)->window();
for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it ) for ( ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it )
cl[pos++] = (*it)->window(); cl[pos++] = (*it)->window();
rootInfo->setClientList( cl, pos ); rootInfo->setClientList( cl, pos );
delete [] cl; delete [] cl;
@ -212,7 +212,7 @@ void Workspace::propagateClients( bool propagate_new_clients )
cl = new Window[ stacking_order.count()]; cl = new Window[ stacking_order.count()];
pos = 0; pos = 0;
for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it) for ( ClientList::ConstIterator it = stacking_order.constBegin(); it != stacking_order.constEnd(); ++it)
cl[pos++] = (*it)->window(); cl[pos++] = (*it)->window();
rootInfo->setClientListStacking( cl, pos ); rootInfo->setClientListStacking( cl, pos );
delete [] cl; delete [] cl;
@ -571,8 +571,8 @@ ClientList Workspace::constrainedStackingOrder()
#endif #endif
// build the order from layers // build the order from layers
QHash< Group*, Layer > minimum_layer; QHash< Group*, Layer > minimum_layer;
for( ClientList::ConstIterator it = unconstrained_stacking_order.begin(); for( ClientList::ConstIterator it = unconstrained_stacking_order.constBegin();
it != unconstrained_stacking_order.end(); it != unconstrained_stacking_order.constEnd();
++it ) ++it )
{ {
Layer l = (*it)->layer(); Layer l = (*it)->layer();
@ -693,8 +693,8 @@ ClientList Workspace::ensureStackingOrder( const ClientList& list ) const
return list; return list;
// TODO is this worth optimizing? // TODO is this worth optimizing?
ClientList result = list; ClientList result = list;
for( ClientList::ConstIterator it = stacking_order.begin(); for( ClientList::ConstIterator it = stacking_order.constBegin();
it != stacking_order.end(); it != stacking_order.constEnd();
++it ) ++it )
if( result.removeAll( *it ) != 0 ) if( result.removeAll( *it ) != 0 )
result.append( *it ); result.append( *it );

View file

@ -223,8 +223,8 @@ unsigned long KDecorationOptionsPrivate::updateSettings( KConfig* config )
KDecorationDefines::BorderSize KDecorationOptionsPrivate::findPreferredBorderSize( BorderSize size, KDecorationDefines::BorderSize KDecorationOptionsPrivate::findPreferredBorderSize( BorderSize size,
QList< BorderSize > sizes ) const QList< BorderSize > sizes ) const
{ {
for( QList< BorderSize >::ConstIterator it = sizes.begin(); for( QList< BorderSize >::ConstIterator it = sizes.constBegin();
it != sizes.end(); it != sizes.constEnd();
++it ) ++it )
if( size <= *it ) // size is either a supported size, or *it is the closest larger supported if( size <= *it ) // size is either a supported size, or *it is the closest larger supported
return *it; return *it;

View file

@ -68,8 +68,8 @@ void KDecorationFactory::removeDecoration( KDecoration* deco )
void KDecorationFactory::resetDecorations( unsigned long changed ) void KDecorationFactory::resetDecorations( unsigned long changed )
{ {
for( QList< KDecoration* >::ConstIterator it = _decorations.begin(); for( QList< KDecoration* >::ConstIterator it = _decorations.constBegin();
it != _decorations.end(); it != _decorations.constEnd();
++it ) ++it )
(*it)->reset( changed ); (*it)->reset( changed );
} }

View file

@ -169,8 +169,8 @@ bool Client::manage( Window w, bool isMapped )
bool on_current = false; bool on_current = false;
Client* maincl = NULL; Client* maincl = NULL;
// this is slightly duplicated from Placement::placeOnMainWindow() // this is slightly duplicated from Placement::placeOnMainWindow()
for( ClientList::ConstIterator it = mainclients.begin(); for( ClientList::ConstIterator it = mainclients.constBegin();
it != mainclients.end(); it != mainclients.constEnd();
++it ) ++it )
{ {
if( mainclients.count() > 1 && (*it)->isSpecialWindow()) if( mainclients.count() > 1 && (*it)->isSpecialWindow())
@ -338,8 +338,8 @@ bool Client::manage( Window w, bool isMapped )
if( init_minimize && isTransient()) if( init_minimize && isTransient())
{ {
ClientList mainclients = mainClients(); ClientList mainclients = mainClients();
for( ClientList::ConstIterator it = mainclients.begin(); for( ClientList::ConstIterator it = mainclients.constBegin();
it != mainclients.end(); it != mainclients.constEnd();
++it ) ++it )
if( (*it)->isShown( true )) if( (*it)->isShown( true ))
init_minimize = false; // SELI even e.g. for NET::Utility? init_minimize = false; // SELI even e.g. for NET::Utility?
@ -351,8 +351,8 @@ bool Client::manage( Window w, bool isMapped )
// use allMainClients(), to include also main clients of group transients // use allMainClients(), to include also main clients of group transients
// that have been optimized out in Client::checkGroupTransients() // that have been optimized out in Client::checkGroupTransients()
ClientList mainclients = allMainClients(); ClientList mainclients = allMainClients();
for( ClientList::ConstIterator it = mainclients.begin(); for( ClientList::ConstIterator it = mainclients.constBegin();
it != mainclients.end(); it != mainclients.constEnd();
++it ) ++it )
if( (*it)->isShown( true )) if( (*it)->isShown( true ))
visible_parent = true; visible_parent = true;
@ -492,8 +492,8 @@ bool Client::manage( Window w, bool isMapped )
workspace()->setCurrentDesktop( desktop()); workspace()->setCurrentDesktop( desktop());
bool belongs_to_desktop = false; bool belongs_to_desktop = false;
for( ClientList::ConstIterator it = group()->members().begin(); for( ClientList::ConstIterator it = group()->members().constBegin();
it != group()->members().end(); it != group()->members().constEnd();
++it ) ++it )
if( (*it)->isDesktop()) if( (*it)->isDesktop())
{ {

View file

@ -187,7 +187,7 @@ void Placement::placeSmart(Client* c, const QRect& area, Policy /*next*/ )
cxl = x; cxr = x + cw; cxl = x; cxr = x + cw;
cyt = y; cyb = y + ch; cyt = y; cyb = y + ch;
ClientList::ConstIterator l; ClientList::ConstIterator l;
for(l = m_WorkspacePtr->stackingOrder().begin(); l != m_WorkspacePtr->stackingOrder().end() ; ++l) for(l = m_WorkspacePtr->stackingOrder().constBegin(); l != m_WorkspacePtr->stackingOrder().constEnd() ; ++l)
{ {
if((*l)->isOnDesktop(desktop) && if((*l)->isOnDesktop(desktop) &&
(*l)->isShown( false ) && (*l) != c) (*l)->isShown( false ) && (*l) != c)
@ -243,7 +243,7 @@ void Placement::placeSmart(Client* c, const QRect& area, Policy /*next*/ )
// compare to the position of each client on the same desk // compare to the position of each client on the same desk
ClientList::ConstIterator l; ClientList::ConstIterator l;
for(l = m_WorkspacePtr->stackingOrder().begin(); l != m_WorkspacePtr->stackingOrder().end() ; ++l) for(l = m_WorkspacePtr->stackingOrder().constBegin(); l != m_WorkspacePtr->stackingOrder().constEnd() ; ++l)
{ {
if ((*l)->isOnDesktop(desktop) && if ((*l)->isOnDesktop(desktop) &&
@ -278,7 +278,7 @@ void Placement::placeSmart(Client* c, const QRect& area, Policy /*next*/ )
//test the position of each window on the desk //test the position of each window on the desk
ClientList::ConstIterator l; ClientList::ConstIterator l;
for(l = m_WorkspacePtr->stackingOrder().begin(); l != m_WorkspacePtr->stackingOrder().end() ; ++l) for(l = m_WorkspacePtr->stackingOrder().constBegin(); l != m_WorkspacePtr->stackingOrder().constEnd() ; ++l)
{ {
if((*l)->isOnDesktop(desktop) && if((*l)->isOnDesktop(desktop) &&
(*l) != c && c->isShown( false )) (*l) != c && c->isShown( false ))
@ -481,8 +481,8 @@ void Placement::placeOnMainWindow(Client* c, QRect& area, Policy nextPlacement )
Client* place_on = NULL; Client* place_on = NULL;
Client* place_on2 = NULL; Client* place_on2 = NULL;
int mains_count = 0; int mains_count = 0;
for( ClientList::ConstIterator it = mainwindows.begin(); for( ClientList::ConstIterator it = mainwindows.constBegin();
it != mainwindows.end(); it != mainwindows.constEnd();
++it ) ++it )
{ {
if( mainwindows.count() > 1 && (*it)->isSpecialWindow()) if( mainwindows.count() > 1 && (*it)->isSpecialWindow())
@ -727,8 +727,8 @@ int Workspace::packPositionLeft( const Client* cl, int oldx, bool left_edge ) co
QPoint( cl->geometry().left() - 1, cl->geometry().center().y()), cl->desktop()).left(); QPoint( cl->geometry().left() - 1, cl->geometry().center().y()), cl->desktop()).left();
if( oldx <= newx ) if( oldx <= newx )
return oldx; return oldx;
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.constBegin();
it != clients.end(); it != clients.constEnd();
++it) ++it)
{ {
if( !(*it)->isShown( false ) || !(*it)->isOnDesktop( active_client->desktop())) if( !(*it)->isShown( false ) || !(*it)->isOnDesktop( active_client->desktop()))
@ -750,8 +750,8 @@ int Workspace::packPositionRight( const Client* cl, int oldx, bool right_edge )
QPoint( cl->geometry().right() + 1, cl->geometry().center().y()), cl->desktop()).right(); QPoint( cl->geometry().right() + 1, cl->geometry().center().y()), cl->desktop()).right();
if( oldx >= newx ) if( oldx >= newx )
return oldx; return oldx;
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.constBegin();
it != clients.end(); it != clients.constEnd();
++it) ++it)
{ {
if( !(*it)->isShown( false ) || !(*it)->isOnDesktop( cl->desktop())) if( !(*it)->isShown( false ) || !(*it)->isOnDesktop( cl->desktop()))
@ -773,8 +773,8 @@ int Workspace::packPositionUp( const Client* cl, int oldy, bool top_edge ) const
QPoint( cl->geometry().center().x(), cl->geometry().top() - 1 ), cl->desktop()).top(); QPoint( cl->geometry().center().x(), cl->geometry().top() - 1 ), cl->desktop()).top();
if( oldy <= newy ) if( oldy <= newy )
return oldy; return oldy;
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.constBegin();
it != clients.end(); it != clients.constEnd();
++it) ++it)
{ {
if( !(*it)->isShown( false ) || !(*it)->isOnDesktop( cl->desktop())) if( !(*it)->isShown( false ) || !(*it)->isOnDesktop( cl->desktop()))
@ -796,8 +796,8 @@ int Workspace::packPositionDown( const Client* cl, int oldy, bool bottom_edge )
QPoint( cl->geometry().center().x(), cl->geometry().bottom() + 1 ), cl->desktop()).bottom(); QPoint( cl->geometry().center().x(), cl->geometry().bottom() + 1 ), cl->desktop()).bottom();
if( oldy >= newy ) if( oldy >= newy )
return oldy; return oldy;
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.constBegin();
it != clients.end(); it != clients.constEnd();
++it) ++it)
{ {
if( !(*it)->isShown( false ) || !(*it)->isOnDesktop( cl->desktop())) if( !(*it)->isShown( false ) || !(*it)->isOnDesktop( cl->desktop()))

View file

@ -709,8 +709,8 @@ void WindowRules::discardTemporary()
void WindowRules::update( Client* c ) void WindowRules::update( Client* c )
{ {
bool updated = false; bool updated = false;
for( QVector< Rules* >::ConstIterator it = rules.begin(); for( QVector< Rules* >::ConstIterator it = rules.constBegin();
it != rules.end(); it != rules.constEnd();
++it ) ++it )
if( (*it)->update( c )) // no short-circuiting here if( (*it)->update( c )) // no short-circuiting here
updated = true; updated = true;
@ -724,8 +724,8 @@ type WindowRules::check##rule( type arg, bool init ) const \
if( rules.count() == 0 ) \ if( rules.count() == 0 ) \
return arg; \ return arg; \
type ret = arg; \ type ret = arg; \
for( QVector< Rules* >::ConstIterator it = rules.begin(); \ for( QVector< Rules* >::ConstIterator it = rules.constBegin(); \
it != rules.end(); \ it != rules.constEnd(); \
++it ) \ ++it ) \
{ \ { \
if( (*it)->apply##rule( ret, init )) \ if( (*it)->apply##rule( ret, init )) \
@ -935,14 +935,14 @@ void Workspace::writeWindowRules()
rulesUpdatedTimer.stop(); rulesUpdatedTimer.stop();
KConfig cfg( "kwinrulesrc", KConfig::NoGlobals ); KConfig cfg( "kwinrulesrc", KConfig::NoGlobals );
QStringList groups = cfg.groupList(); QStringList groups = cfg.groupList();
for( QStringList::ConstIterator it = groups.begin(); for( QStringList::ConstIterator it = groups.constBegin();
it != groups.end(); it != groups.constEnd();
++it ) ++it )
cfg.deleteGroup( *it ); cfg.deleteGroup( *it );
cfg.group("General").writeEntry( "count", rules.count()); cfg.group("General").writeEntry( "count", rules.count());
int i = 1; int i = 1;
for( QList< Rules* >::ConstIterator it = rules.begin(); for( QList< Rules* >::ConstIterator it = rules.constBegin();
it != rules.end(); it != rules.constEnd();
++it ) ++it )
{ {
if( (*it)->isTemporary()) if( (*it)->isTemporary())
@ -956,8 +956,8 @@ void Workspace::writeWindowRules()
void Workspace::gotTemporaryRulesMessage( const QString& message ) void Workspace::gotTemporaryRulesMessage( const QString& message )
{ {
bool was_temporary = false; bool was_temporary = false;
for( QList< Rules* >::ConstIterator it = rules.begin(); for( QList< Rules* >::ConstIterator it = rules.constBegin();
it != rules.end(); it != rules.constEnd();
++it ) ++it )
if( (*it)->isTemporary()) if( (*it)->isTemporary())
was_temporary = true; was_temporary = true;

View file

@ -50,8 +50,8 @@ void SceneBasic::paint( QRegion, ToplevelList windows )
val.subwindow_mode = IncludeInferiors; val.subwindow_mode = IncludeInferiors;
GC gc = XCreateGC( display(), composite_pixmap, GCForeground | GCSubwindowMode, &val ); GC gc = XCreateGC( display(), composite_pixmap, GCForeground | GCSubwindowMode, &val );
XFillRectangle( display(), composite_pixmap, gc, 0, 0, displayWidth(), displayHeight()); XFillRectangle( display(), composite_pixmap, gc, 0, 0, displayWidth(), displayHeight());
for( ToplevelList::ConstIterator it = windows.begin(); for( ToplevelList::ConstIterator it = windows.constBegin();
it != windows.end(); it != windows.constEnd();
++it ) ++it )
{ {
QRect r = (*it)->geometry().intersected( QRect( 0, 0, displayWidth(), displayHeight())); QRect r = (*it)->geometry().intersected( QRect( 0, 0, displayWidth(), displayHeight()));

View file

@ -208,7 +208,7 @@ void TabBox::reset( bool partial_reset )
// calculate maximum caption width // calculate maximum caption width
cw = fontMetrics().width(no_tasks)+20; cw = fontMetrics().width(no_tasks)+20;
for (ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it) for (ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it)
{ {
cw = fontMetrics().width( (*it)->caption() ); cw = fontMetrics().width( (*it)->caption() );
if ( cw > wmax ) wmax = cw; if ( cw > wmax ) wmax = cw;
@ -460,7 +460,7 @@ void TabBox::paintEvent( QPaintEvent* e )
} }
else else
{ {
for (ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it) for (ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it)
{ {
if ( workspace()->hasClient( *it ) ) // safety if ( workspace()->hasClient( *it ) ) // safety
{ {
@ -719,8 +719,8 @@ void TabBox::handleMouseEvent( XEvent* e )
if( mode() == TabBoxWindowsMode ) if( mode() == TabBoxWindowsMode )
{ {
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.constBegin();
it != clients.end(); it != clients.constEnd();
++it) ++it)
{ {
if( workspace()->hasClient( *it ) && (num == 0) ) // safety if( workspace()->hasClient( *it ) && (num == 0) ) // safety

View file

@ -1227,8 +1227,8 @@ void Client::setShortcut( const QString& _cut )
} }
QList< KShortcut > keys; QList< KShortcut > keys;
QStringList groups = cut.split( ' '); QStringList groups = cut.split( ' ');
for( QStringList::ConstIterator it = groups.begin(); for( QStringList::ConstIterator it = groups.constBegin();
it != groups.end(); it != groups.constEnd();
++it ) ++it )
{ {
QRegExp reg( "(.*\\+)\\((.*)\\)" ); QRegExp reg( "(.*\\+)\\((.*)\\)" );
@ -1246,15 +1246,15 @@ void Client::setShortcut( const QString& _cut )
} }
} }
} }
for( QList< KShortcut >::ConstIterator it = keys.begin(); for( QList< KShortcut >::ConstIterator it = keys.constBegin();
it != keys.end(); it != keys.constEnd();
++it ) ++it )
{ {
if( _shortcut == *it ) // current one is in the list if( _shortcut == *it ) // current one is in the list
return; return;
} }
for( QList< KShortcut >::ConstIterator it = keys.begin(); for( QList< KShortcut >::ConstIterator it = keys.constBegin();
it != keys.end(); it != keys.constEnd();
++it ) ++it )
{ {
if( workspace()->shortcutAvailable( *it, this )) if( workspace()->shortcutAvailable( *it, this ))
@ -1290,8 +1290,8 @@ void Client::delayedSetShortcut()
bool Workspace::shortcutAvailable( const KShortcut& cut, Client* ignore ) const bool Workspace::shortcutAvailable( const KShortcut& cut, Client* ignore ) const
{ {
// TODO check global shortcuts etc. // TODO check global shortcuts etc.
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.constBegin();
it != clients.end(); it != clients.constEnd();
++it ) ++it )
{ {
if( (*it) != ignore && (*it)->shortcut() == cut ) if( (*it) != ignore && (*it)->shortcut() == cut )

View file

@ -443,8 +443,8 @@ Workspace::~Workspace()
blockStackingUpdates( true ); blockStackingUpdates( true );
// TODO grabXServer(); // TODO grabXServer();
// use stacking_order, so that kwin --replace keeps stacking order // use stacking_order, so that kwin --replace keeps stacking order
for( ClientList::ConstIterator it = stacking_order.begin(); for( ClientList::ConstIterator it = stacking_order.constBegin();
it != stacking_order.end(); it != stacking_order.constEnd();
++it ) ++it )
{ {
// only release the window // only release the window
@ -455,8 +455,8 @@ Workspace::~Workspace()
clients.removeAll( *it ); clients.removeAll( *it );
desktops.removeAll( *it ); desktops.removeAll( *it );
} }
for( UnmanagedList::ConstIterator it = unmanaged.begin(); for( UnmanagedList::ConstIterator it = unmanaged.constBegin();
it != unmanaged.end(); it != unmanaged.constEnd();
++it ) ++it )
(*it)->release(); (*it)->release();
delete tab_box; delete tab_box;
@ -760,8 +760,8 @@ void Workspace::updateCurrentTopMenu()
{ {
if( menu_client->isFullScreen()) if( menu_client->isFullScreen())
block_desktop_menubar = true; block_desktop_menubar = true;
for( ClientList::ConstIterator it = menu_client->transients().begin(); for( ClientList::ConstIterator it = menu_client->transients().constBegin();
it != menu_client->transients().end(); it != menu_client->transients().constEnd();
++it ) ++it )
if( (*it)->isTopMenu()) if( (*it)->isTopMenu())
{ {
@ -776,8 +776,8 @@ void Workspace::updateCurrentTopMenu()
} }
if( !menubar ) if( !menubar )
{ // try to find any topmenu from the application (#72113) { // try to find any topmenu from the application (#72113)
for( ClientList::ConstIterator it = active_client->group()->members().begin(); for( ClientList::ConstIterator it = active_client->group()->members().constBegin();
it != active_client->group()->members().end(); it != active_client->group()->members().constEnd();
++it ) ++it )
if( (*it)->isTopMenu()) if( (*it)->isTopMenu())
{ {
@ -792,8 +792,8 @@ void Workspace::updateCurrentTopMenu()
Client* desktop = findDesktop( true, currentDesktop()); Client* desktop = findDesktop( true, currentDesktop());
if( desktop != NULL ) if( desktop != NULL )
{ {
for( ClientList::ConstIterator it = desktop->transients().begin(); for( ClientList::ConstIterator it = desktop->transients().constBegin();
it != desktop->transients().end(); it != desktop->transients().constEnd();
++it ) ++it )
if( (*it)->isTopMenu()) if( (*it)->isTopMenu())
{ {
@ -806,8 +806,8 @@ void Workspace::updateCurrentTopMenu()
// thus the topmenu is not transient for it :-/. // thus the topmenu is not transient for it :-/.
if( menubar == NULL ) if( menubar == NULL )
{ {
for( ClientList::ConstIterator it = topmenus.begin(); for( ClientList::ConstIterator it = topmenus.constBegin();
it != topmenus.end(); it != topmenus.constEnd();
++it ) ++it )
if( (*it)->wasOriginallyGroupTransient()) // kdesktop's topmenu has WM_TRANSIENT_FOR if( (*it)->wasOriginallyGroupTransient()) // kdesktop's topmenu has WM_TRANSIENT_FOR
{ // set pointing to the root window { // set pointing to the root window
@ -836,7 +836,7 @@ void Workspace::updateCurrentTopMenu()
} }
// ... then hide the other ones. Avoids flickers. // ... then hide the other ones. Avoids flickers.
for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it) for ( ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it)
{ {
if( (*it)->isTopMenu() && (*it) != menubar ) if( (*it)->isTopMenu() && (*it) != menubar )
(*it)->hideClient( true ); (*it)->hideClient( true );
@ -849,8 +849,8 @@ void Workspace::updateToolWindows( bool also_hide )
// TODO what if Client's transiency/group changes? should this be called too? (I'm paranoid, am I not?) // TODO what if Client's transiency/group changes? should this be called too? (I'm paranoid, am I not?)
if( !options->hideUtilityWindowsForInactive ) if( !options->hideUtilityWindowsForInactive )
{ {
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.constBegin();
it != clients.end(); it != clients.constEnd();
++it ) ++it )
(*it)->hideClient( false ); (*it)->hideClient( false );
return; return;
@ -875,8 +875,8 @@ void Workspace::updateToolWindows( bool also_hide )
// SELI but maybe it should - what if a new client has been added that's not in stacking order yet? // SELI but maybe it should - what if a new client has been added that's not in stacking order yet?
ClientList to_show, to_hide; ClientList to_show, to_hide;
for( ClientList::ConstIterator it = stacking_order.begin(); for( ClientList::ConstIterator it = stacking_order.constBegin();
it != stacking_order.end(); it != stacking_order.constEnd();
++it ) ++it )
{ {
if( (*it)->isUtility() || (*it)->isMenu() || (*it)->isToolbar()) if( (*it)->isUtility() || (*it)->isMenu() || (*it)->isToolbar())
@ -907,8 +907,8 @@ void Workspace::updateToolWindows( bool also_hide )
// have e.g. kicker as mainwindow // have e.g. kicker as mainwindow
if( mainclients.isEmpty()) if( mainclients.isEmpty())
show = true; show = true;
for( ClientList::ConstIterator it2 = mainclients.begin(); for( ClientList::ConstIterator it2 = mainclients.constBegin();
it2 != mainclients.end(); it2 != mainclients.constEnd();
++it2 ) ++it2 )
{ {
if( (*it2)->isSpecialWindow()) if( (*it2)->isSpecialWindow())
@ -928,8 +928,8 @@ void Workspace::updateToolWindows( bool also_hide )
to_show.at( i )->hideClient( false ); to_show.at( i )->hideClient( false );
if( also_hide ) if( also_hide )
{ {
for( ClientList::ConstIterator it = to_hide.begin(); for( ClientList::ConstIterator it = to_hide.constBegin();
it != to_hide.end(); it != to_hide.constEnd();
++it ) // from bottommost ++it ) // from bottommost
(*it)->hideClient( true ); (*it)->hideClient( true );
updateToolWindowsTimer.stop(); updateToolWindowsTimer.stop();
@ -1020,8 +1020,8 @@ void Workspace::slotReconfigure()
curtain.setGeometry( QApplication::desktop()->geometry() ); curtain.setGeometry( QApplication::desktop()->geometry() );
curtain.show(); curtain.show();
#endif #endif
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.constBegin();
it != clients.end(); it != clients.constEnd();
++it ) ++it )
{ {
(*it)->updateDecoration( true, true ); (*it)->updateDecoration( true, true );
@ -1269,8 +1269,8 @@ void ObscuringWindows::create( Client* c )
ObscuringWindows::~ObscuringWindows() ObscuringWindows::~ObscuringWindows()
{ {
max_cache_size = qMax( ( int )max_cache_size, obscuring_windows.count() + 4 ) - 1; max_cache_size = qMax( ( int )max_cache_size, obscuring_windows.count() + 4 ) - 1;
for( QList<Window>::ConstIterator it = obscuring_windows.begin(); for( QList<Window>::ConstIterator it = obscuring_windows.constBegin();
it != obscuring_windows.end(); it != obscuring_windows.constEnd();
++it ) ++it )
{ {
XUnmapWindow( display(), *it ); XUnmapWindow( display(), *it );
@ -1312,7 +1312,7 @@ bool Workspace::setCurrentDesktop( int new_desktop )
current_desktop = new_desktop; // change the desktop (so that Client::updateVisibility() works) current_desktop = new_desktop; // change the desktop (so that Client::updateVisibility() works)
for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it) for ( ClientList::ConstIterator it = stacking_order.constBegin(); it != stacking_order.constEnd(); ++it)
if ( !(*it)->isOnDesktop( new_desktop ) && (*it) != movingClient ) if ( !(*it)->isOnDesktop( new_desktop ) && (*it) != movingClient )
{ {
if( (*it)->isShown( true ) && (*it)->isOnDesktop( old_desktop )) if( (*it)->isShown( true ) && (*it)->isOnDesktop( old_desktop ))
@ -1581,8 +1581,8 @@ void Workspace::setNumberOfDesktops( int n )
// windows that would be hidden to the last visible desktop // windows that would be hidden to the last visible desktop
if( old_number_of_desktops > number_of_desktops ) if( old_number_of_desktops > number_of_desktops )
{ {
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.constBegin();
it != clients.end(); it != clients.constEnd();
++it) ++it)
{ {
if( !(*it)->isOnAllDesktops() && (*it)->desktop() > numberOfDesktops()) if( !(*it)->isOnAllDesktops() && (*it)->desktop() > numberOfDesktops())
@ -1635,8 +1635,8 @@ void Workspace::sendClientToDesktop( Client* c, int desk, bool dont_activate )
} }
ClientList transients_stacking_order = ensureStackingOrder( c->transients()); ClientList transients_stacking_order = ensureStackingOrder( c->transients());
for( ClientList::ConstIterator it = transients_stacking_order.begin(); for( ClientList::ConstIterator it = transients_stacking_order.constBegin();
it != transients_stacking_order.end(); it != transients_stacking_order.constEnd();
++it ) ++it )
sendClientToDesktop( *it, desk, dont_activate ); sendClientToDesktop( *it, desk, dont_activate );
updateClientArea(); updateClientArea();
@ -1708,8 +1708,8 @@ void Workspace::sendClientToScreen( Client* c, int screen )
c->size().width(), c->size().height()); c->size().width(), c->size().height());
c->checkWorkspacePosition(); c->checkWorkspacePosition();
ClientList transients_stacking_order = ensureStackingOrder( c->transients()); ClientList transients_stacking_order = ensureStackingOrder( c->transients());
for( ClientList::ConstIterator it = transients_stacking_order.begin(); for( ClientList::ConstIterator it = transients_stacking_order.constBegin();
it != transients_stacking_order.end(); it != transients_stacking_order.constEnd();
++it ) ++it )
sendClientToScreen( *it, screen ); sendClientToScreen( *it, screen );
if( c->isActive()) if( c->isActive())
@ -2374,8 +2374,8 @@ void Workspace::lostTopMenuSelection()
delete topmenu_space; delete topmenu_space;
topmenu_space = NULL; topmenu_space = NULL;
updateClientArea(); updateClientArea();
for( ClientList::ConstIterator it = topmenus.begin(); for( ClientList::ConstIterator it = topmenus.constBegin();
it != topmenus.end(); it != topmenus.constEnd();
++it ) ++it )
(*it)->checkWorkspacePosition(); (*it)->checkWorkspacePosition();
} }
@ -2523,15 +2523,15 @@ void Workspace::setShowingDesktop( bool showing )
ClientList cls = stackingOrder(); ClientList cls = stackingOrder();
// find them first, then minimize, otherwise transients may get minimized with the window // find them first, then minimize, otherwise transients may get minimized with the window
// they're transient for // they're transient for
for( ClientList::ConstIterator it = cls.begin(); for( ClientList::ConstIterator it = cls.constBegin();
it != cls.end(); it != cls.constEnd();
++it ) ++it )
{ {
if( (*it)->isOnCurrentDesktop() && (*it)->isShown( true ) && !(*it)->isSpecialWindow()) if( (*it)->isOnCurrentDesktop() && (*it)->isShown( true ) && !(*it)->isSpecialWindow())
showing_desktop_clients.prepend( *it ); // topmost first to reduce flicker showing_desktop_clients.prepend( *it ); // topmost first to reduce flicker
} }
for( ClientList::ConstIterator it = showing_desktop_clients.begin(); for( ClientList::ConstIterator it = showing_desktop_clients.constBegin();
it != showing_desktop_clients.end(); it != showing_desktop_clients.constEnd();
++it ) ++it )
(*it)->minimize(); (*it)->minimize();
--block_focus; --block_focus;
@ -2540,8 +2540,8 @@ void Workspace::setShowingDesktop( bool showing )
} }
else else
{ {
for( ClientList::ConstIterator it = showing_desktop_clients.begin(); for( ClientList::ConstIterator it = showing_desktop_clients.constBegin();
it != showing_desktop_clients.end(); it != showing_desktop_clients.constEnd();
++it ) ++it )
(*it)->unminimize(); (*it)->unminimize();
if( showing_desktop_clients.count() > 0 ) if( showing_desktop_clients.count() > 0 )
@ -2569,8 +2569,8 @@ void Workspace::resetShowingDesktop( bool keep_hidden )
++block_showing_desktop; ++block_showing_desktop;
if( !keep_hidden ) if( !keep_hidden )
{ {
for( ClientList::ConstIterator it = showing_desktop_clients.begin(); for( ClientList::ConstIterator it = showing_desktop_clients.constBegin();
it != showing_desktop_clients.end(); it != showing_desktop_clients.constEnd();
++it ) ++it )
(*it)->unminimize(); (*it)->unminimize();
} }
@ -2627,8 +2627,8 @@ void Workspace::slotBlockShortcuts( int data )
global_shortcuts_disabled_for_client = false; global_shortcuts_disabled_for_client = false;
} }
// update also Alt+LMB actions etc. // update also Alt+LMB actions etc.
for( ClientList::ConstIterator it = clients.begin(); for( ClientList::ConstIterator it = clients.constBegin();
it != clients.end(); it != clients.constEnd();
++it ) ++it )
(*it)->updateMouseGrab(); (*it)->updateMouseGrab();
} }

View file

@ -944,10 +944,10 @@ inline Client* Workspace::findClient( T predicate ) const
template< typename T1, typename T2 > template< typename T1, typename T2 >
inline void Workspace::forEachClient( T1 procedure, T2 predicate ) inline void Workspace::forEachClient( T1 procedure, T2 predicate )
{ {
for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it) for ( ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it)
if ( predicate( const_cast< const Client* >( *it))) if ( predicate( const_cast< const Client* >( *it)))
procedure( *it ); procedure( *it );
for ( ClientList::ConstIterator it = desktops.begin(); it != desktops.end(); ++it) for ( ClientList::ConstIterator it = desktops.constBegin(); it != desktops.constEnd(); ++it)
if ( predicate( const_cast< const Client* >( *it))) if ( predicate( const_cast< const Client* >( *it)))
procedure( *it ); procedure( *it );
} }
@ -967,7 +967,7 @@ inline Unmanaged* Workspace::findUnmanaged( T predicate ) const
template< typename T1, typename T2 > template< typename T1, typename T2 >
inline void Workspace::forEachUnmanaged( T1 procedure, T2 predicate ) inline void Workspace::forEachUnmanaged( T1 procedure, T2 predicate )
{ {
for ( UnmanagedList::ConstIterator it = unmanaged.begin(); it != unmanaged.end(); ++it) for ( UnmanagedList::ConstIterator it = unmanaged.constBegin(); it != unmanaged.constEnd(); ++it)
if ( predicate( const_cast< const Unmanaged* >( *it))) if ( predicate( const_cast< const Unmanaged* >( *it)))
procedure( *it ); procedure( *it );
} }