From d90793944583f66c1c8917f1d91ac4a3c722f5f6 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Fri, 25 Dec 2009 03:06:54 +0000 Subject: [PATCH] Add return values to client group decoration functions that can safely work when the window isn't in a client group at all. BUG: 218086 svn path=/trunk/KDE/kdebase/workspace/; revision=1065963 --- bridge.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/bridge.cpp b/bridge.cpp index 0f138c5ca1..1915cf855d 100644 --- a/bridge.cpp +++ b/bridge.cpp @@ -215,12 +215,20 @@ QRect Bridge::transparentRect() const bool Bridge::isClientGroupActive() { - return c->clientGroup()->containsActiveClient(); + if( c->clientGroup() ) + return c->clientGroup()->containsActiveClient(); + return isActive(); } QList< ClientGroupItem > Bridge::clientGroupItems() const { - return c->clientGroup()->items(); + if( c->clientGroup() ) + return c->clientGroup()->items(); + QList< ClientGroupItem > items; + QIcon icon( c->icon() ); + icon.addPixmap( c->miniIcon() ); + items.append( ClientGroupItem( c->caption(), icon )); + return items; } long Bridge::itemId( int index ) @@ -231,7 +239,9 @@ long Bridge::itemId( int index ) int Bridge::visibleClientGroupItem() { - return c->clientGroup()->indexOfVisibleClient(); + if( c->clientGroup() ) + return c->clientGroup()->indexOfVisibleClient(); + return 0; } void Bridge::setVisibleClientGroupItem( int index )