From f8d7a5ec250323ca84c8c9dc9d468383fe699d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 4 Jan 2007 17:16:16 +0000 Subject: [PATCH] More transiency checks. svn path=/trunk/KDE/kdebase/workspace/; revision=619879 --- group.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/group.cpp b/group.cpp index 9e7d0139f4..b2f62ded4c 100644 --- a/group.cpp +++ b/group.cpp @@ -60,6 +60,16 @@ bool performTransiencyCheck() { if( (*it1)->deleting ) continue; + if( (*it1)->in_group == NULL ) + { + kdDebug() << "TC: " << *it1 << " in not in a group" << endl; + ret = false; + } + else if( !(*it1)->in_group->members().contains( *it1 )) + { + kdDebug() << "TC: " << *it1 << " has a group " << (*it1)->in_group << " but group does not contain it" << endl; + ret = false; + } if( !(*it1)->isTransient()) { if( !(*it1)->mainClients().isEmpty()) @@ -112,6 +122,23 @@ bool performTransiencyCheck() } } } + GroupList groups = Workspace::self()->groups; + for( GroupList::ConstIterator it1 = groups.begin(); + it1 != groups.end(); + ++it1 ) + { + ClientList members = (*it1)->members(); + for( ClientList::ConstIterator it2 = members.begin(); + it2 != members.end(); + ++it2 ) + { + if( (*it2)->in_group != *it1 ) + { + kdDebug() << "TC: Group " << *it1 << " contains client " << *it2 << " but client is not in that group" << endl; + ret = false; + } + } + } return ret; }