From e70b93f0257ee88cb16fc10490bfba4caef6c622 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 14 Feb 2005 17:06:59 +0000 Subject: update_gnomekderc: modify the default group (entries at the top of the file not preceded by a group name) if category is undef --- MDK/Common/System.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'MDK/Common') diff --git a/MDK/Common/System.pm b/MDK/Common/System.pm index 2a03ff7..4ad4aea 100644 --- a/MDK/Common/System.pm +++ b/MDK/Common/System.pm @@ -410,7 +410,8 @@ sub update_gnomekderc { my %subst = map { lc($_) => [ $_, $subst_{$_} ] } keys %subst_; my $s; - foreach (MDK::Common::File::cat_($file), "[NOCATEGORY]\n") { + defined($category) or $category = "DEFAULTCATEGORY"; + foreach ("[DEFAULTCATEGORY]\n", MDK::Common::File::cat_($file), "[NOCATEGORY]\n") { if (my $i = /^\s*\[\Q$category\E\]/i ... /^\[/) { if ($i =~ /E/) { #- for last line of category chomp $s; $s .= "\n"; @@ -422,10 +423,10 @@ sub update_gnomekderc { } } } - $s .= $_ if !/^\Q[NOCATEGORY]/; + $s .= $_ if !/^\[(NO|DEFAULT)CATEGORY\]/; } - #- if category has not been found above. + #- if category has not been found above (DEFAULTCATEGORY is always found). if (keys %subst) { chomp $s; $s .= "\n[$category]\n"; -- cgit v1.2.1