From a909f9790a4610ec74ce80b8cdf61cf868365ad5 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Tue, 27 Nov 2012 16:52:35 +0100 Subject: [PATCH] check group existence and delete group using KConfig methods directly. --- clients/oxygen/oxygenexceptionlist.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/clients/oxygen/oxygenexceptionlist.cpp b/clients/oxygen/oxygenexceptionlist.cpp index 937de72ee5..391b43ae29 100644 --- a/clients/oxygen/oxygenexceptionlist.cpp +++ b/clients/oxygen/oxygenexceptionlist.cpp @@ -39,7 +39,7 @@ namespace Oxygen _exceptions.clear(); QString groupName; - for( int index = 0; KConfigGroup( config, groupName = exceptionGroupName( index ) ).exists(); ++index ) + for( int index = 0; config->hasGroup( groupName = exceptionGroupName( index ) ); ++index ) { // create exception @@ -78,21 +78,12 @@ namespace Oxygen { // remove all existing exceptions - int index(0); - while( true ) - { - KConfigGroup group( config.data(), exceptionGroupName( index ) ); - if( group.exists() ) - { - - group.deleteGroup(); - ++index; - - } else break; - } + QString groupName; + for( int index = 0; config->hasGroup( groupName = exceptionGroupName( index ) ); ++index ) + { config->deleteGroup( groupName ); } // rewrite current exceptions - index = 0; + int index = 0; foreach( const ConfigurationPtr& exception, _exceptions ) {