diff --git a/plugins/group/groups.cpp b/plugins/group/groups.cpp index d99d3d7..b61e737 100755 --- a/plugins/group/groups.cpp +++ b/plugins/group/groups.cpp @@ -2,7 +2,7 @@ * This file is a part of Winix * and is not publicly distributed * - * Copyright (c) 2011-2012, Tomasz Sowa + * Copyright (c) 2011-2013, Tomasz Sowa * All rights reserved. * */ @@ -63,27 +63,31 @@ size_t i, v; // loop through all values in the group for(v=0 ; vtable.find(key); + std::wstring * vali = group.spaces[v]->GetValue(key); - if( vali != group.spaces[v]->table.end() && vali->second.size() == 1 ) + if( vali ) { - GroupIndex::iterator g = group_index.find(vali->second[0]); + GroupIndex::iterator g = group_index.find(*vali); if( g == group_index.end() ) { - group_index[vali->second[0]] = i; + group_index[*vali] = i; v += 1; } else { slog << logwarning << "set: " << set.name << " has a group with a duplicated value: " - << vali->second[0] << " (skipping)" << logend; + << *vali << " (skipping)" << logend; + group.spaces.erase(group.spaces.begin() + v); } } else { - slog << logwarning << "set: " << set.name << " has a group without a value (skipping)" << logend; + log << log1 << "key: " << key << " was not found" << logend; + slog << logwarning << "set: " << set.name + << " has a group without a value (skipping)" << logend; + group.spaces.erase(group.spaces.begin() + v); } }