secure clientGroup pointer accesses
BUG: 251388 CCBUG: 195907 CCBUG: 233756 svn path=/trunk/KDE/kdebase/workspace/; revision=1183245
This commit is contained in:
parent
f7c3dc23df
commit
9b10dc7974
1 changed files with 16 additions and 6 deletions
10
bridge.cpp
10
bridge.cpp
|
@ -233,6 +233,8 @@ QList< ClientGroupItem > Bridge::clientGroupItems() const
|
||||||
|
|
||||||
long Bridge::itemId( int index )
|
long Bridge::itemId( int index )
|
||||||
{
|
{
|
||||||
|
if( !c->clientGroup() )
|
||||||
|
return 0;
|
||||||
const ClientList list = c->clientGroup()->clients();
|
const ClientList list = c->clientGroup()->clients();
|
||||||
return reinterpret_cast<long>( list.at( index ));
|
return reinterpret_cast<long>( list.at( index ));
|
||||||
}
|
}
|
||||||
|
@ -246,11 +248,13 @@ int Bridge::visibleClientGroupItem()
|
||||||
|
|
||||||
void Bridge::setVisibleClientGroupItem( int index )
|
void Bridge::setVisibleClientGroupItem( int index )
|
||||||
{
|
{
|
||||||
|
if( c->clientGroup() )
|
||||||
c->clientGroup()->setVisible( index );
|
c->clientGroup()->setVisible( index );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bridge::moveItemInClientGroup( int index, int before )
|
void Bridge::moveItemInClientGroup( int index, int before )
|
||||||
{
|
{
|
||||||
|
if( c->clientGroup() )
|
||||||
c->clientGroup()->move( index, before );
|
c->clientGroup()->move( index, before );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,17 +266,21 @@ void Bridge::moveItemToClientGroup( long itemId, int before )
|
||||||
kWarning(1212) << "****** ARBITRARY CODE EXECUTION ATTEMPT DETECTED ******";
|
kWarning(1212) << "****** ARBITRARY CODE EXECUTION ATTEMPT DETECTED ******";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if( item->clientGroup() )
|
||||||
c->workspace()->moveItemToClientGroup( item->clientGroup(), item->clientGroup()->indexOfClient( item ),
|
c->workspace()->moveItemToClientGroup( item->clientGroup(), item->clientGroup()->indexOfClient( item ),
|
||||||
c->clientGroup(), before );
|
c->clientGroup(), before );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bridge::removeFromClientGroup( int index, const QRect& newGeom )
|
void Bridge::removeFromClientGroup( int index, const QRect& newGeom )
|
||||||
{
|
{
|
||||||
|
if( c->clientGroup() )
|
||||||
c->clientGroup()->remove( index, newGeom );
|
c->clientGroup()->remove( index, newGeom );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bridge::closeClientGroupItem( int index )
|
void Bridge::closeClientGroupItem( int index )
|
||||||
{
|
{
|
||||||
|
if( !c->clientGroup() )
|
||||||
|
return;
|
||||||
const ClientList list = c->clientGroup()->clients();
|
const ClientList list = c->clientGroup()->clients();
|
||||||
if( index >= 0 || index <= list.count() )
|
if( index >= 0 || index <= list.count() )
|
||||||
list.at( index )->closeWindow();
|
list.at( index )->closeWindow();
|
||||||
|
@ -280,11 +288,13 @@ void Bridge::closeClientGroupItem( int index )
|
||||||
|
|
||||||
void Bridge::closeAllInClientGroup()
|
void Bridge::closeAllInClientGroup()
|
||||||
{
|
{
|
||||||
|
if( c->clientGroup() )
|
||||||
c->clientGroup()->closeAll();
|
c->clientGroup()->closeAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bridge::displayClientMenu( int index, const QPoint& pos )
|
void Bridge::displayClientMenu( int index, const QPoint& pos )
|
||||||
{
|
{
|
||||||
|
if( c->clientGroup() )
|
||||||
c->clientGroup()->displayClientMenu( index, pos );
|
c->clientGroup()->displayClientMenu( index, pos );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue