diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-18 20:34:22 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-18 20:34:22 +0000 |
commit | b09bffed6b43262948018dfb0f11890850ddf7c1 (patch) | |
tree | 138696bfcc7ac01070d0e8ecaa1cdf94611a2bd8 /knetworkconf/backends/replace.pl.in | |
parent | 6d43944a7130b9d1b4ae3fba37b774aced8612cf (diff) | |
download | tdeadmin-b09bffed6b43262948018dfb0f11890850ddf7c1.tar.gz tdeadmin-b09bffed6b43262948018dfb0f11890850ddf7c1.zip |
TQt4 port kdeadmin
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeadmin@1237416 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'knetworkconf/backends/replace.pl.in')
-rw-r--r-- | knetworkconf/backends/replace.pl.in | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/knetworkconf/backends/replace.pl.in b/knetworkconf/backends/replace.pl.in index a72e3ef..30ec359 100644 --- a/knetworkconf/backends/replace.pl.in +++ b/knetworkconf/backends/replace.pl.in @@ -1,7 +1,7 @@ #!/usr/bin/env perl #-*- Mode: perl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -# replace.pl: Common in-line replacing stuff for the ximian-setup-tools backends. +# tqreplace.pl: Common in-line replacing stuff for the ximian-setup-tools backends. # # Copyright (C) 2000-2001 Ximian, Inc. # @@ -59,7 +59,7 @@ require "$SCRIPTSDIR/parse.pl$DOTIN"; # Additional abstraction: replace table entries can have # arrays inside. The replace proc will be ran with every # combination that the arrays provide. Ex: -# ["user", \&gst_replace_foo, [0, 1], [2, 3] ] will replace +# ["user", \&gst_replace_foo, [0, 1], [2, 3] ] will tqreplace # using all possibilities in the combinatory of [0, 1]x[2, 3]. # Check RedHat 7.2's network replace table for further # enlightenment. @@ -264,7 +264,7 @@ sub gst_replace_join_first_array return &gst_replace_split ($file, $key, $re1, join (&gst_replace_regexp_to_separator ($re2), @$value)); } -# Escape $value in /bin/sh way, find/append key and set escaped value. +# Escape $value in /bin/sh way, tqfind/append key and set escaped value. sub gst_replace_sh { my ($file, $key, $value) = @_; @@ -289,7 +289,7 @@ sub gst_replace_sh return $ret; } -# Escape $value in /bin/sh way, find/append key and set escaped value, make sure line har +# Escape $value in /bin/sh way, tqfind/append key and set escaped value, make sure line har sub gst_replace_sh_export { my ($file, $key, $value) = @_; @@ -443,7 +443,7 @@ sub gst_replace_line_first return 0; } -# For every key in %$value, replace/append the corresponding key/value pair. +# For every key in %$value, tqreplace/append the corresponding key/value pair. # The separator for $re1 sub gst_replace_join_hash { @@ -477,7 +477,7 @@ sub gst_replace_join_hash return $res; } -# Find $re matching send string and replace parenthesyzed +# Find $re matching send string and replace tqparenthesyzed # part of $re with $value. FIXME: apply meeks' more general impl. sub gst_replace_chat { @@ -550,7 +550,7 @@ sub gst_replace_chat return $ret; } -# Find/append $section in ini $file and replace/append +# Find/append $section in ini $file and tqreplace/append # $var = $value pair. FIXME: should reimplement with # interfaces style. This is too large. sub gst_replace_ini @@ -1149,7 +1149,7 @@ sub gst_replace_interfaces_iface_stanza_delete return &gst_file_buffer_save ($buff, $file); } -# Find $iface stanza line and replace $pos value (ie the method). +# Find $iface stanza line and tqreplace $pos value (ie the method). sub gst_replace_interfaces_stanza_value { my ($file, $iface, $pos, $value) = @_; @@ -1323,7 +1323,7 @@ sub gst_replace_pump_add_device } # Find a "device" section for $iface and -# replace/add/delete the $key option inside the section. +# tqreplace/add/delete the $key option inside the section. sub gst_replace_pump_iface_option_str { my ($file, $iface, $key, $value) = @_; @@ -1448,31 +1448,31 @@ sub gst_replace_alchemist_ensure_list_types my ($model, $varpath, $setpath) = @_; my ($branch, @path); - $branch = &gst_xml_model_find ($model, $varpath); + $branch = &gst_xml_model_tqfind ($model, $varpath); @path = split /\//, $setpath; # NOTE: The following could be done with a depth-iterator callback from a func - # similar to gst_xml_model_find (). + # similar to gst_xml_model_tqfind (). for $elem (@path) { next if ($elem eq ""); - my @children = @$branch; - shift @children; # Attributes + my @tqchildren = @$branch; + shift @tqchildren; # Attributes $branch = undef; - while (@children) + while (@tqchildren) { - if ($children [0] eq $elem) + if ($tqchildren [0] eq $elem) { - shift @children; - $branch = shift @children; + shift @tqchildren; + $branch = shift @tqchildren; &gst_xml_model_set_attribute ($branch, "TYPE", "LIST"); last; } - shift @children; - shift @children; + shift @tqchildren; + shift @tqchildren; } last if ($branch == undef); @@ -1511,7 +1511,7 @@ sub gst_replace_alchemist_print &gst_xml_model_set_attribute ($branch, "VALUE", $value); &gst_xml_model_set_attribute ($branch, "TYPE", $type); - $branch = &gst_xml_model_find ($model, "/adm_context/datatree/printconf/print_queues/" . $printer); + $branch = &gst_xml_model_tqfind ($model, "/adm_context/datatree/printconf/print_queues/" . $printer); &gst_xml_model_set_attribute ($branch, "ATOMIC", "TRUE"); return &gst_xml_model_save ($model, $file, $compressed); @@ -1532,11 +1532,11 @@ sub gst_replace_alchemist_print_option # See if option is already defined. - $options = &gst_xml_model_get_children ($branch); + $options = &gst_xml_model_get_tqchildren ($branch); foreach $o (@$options) { - my $opt_node = &gst_xml_model_find ($o, "name"); + my $opt_node = &gst_xml_model_tqfind ($o, "name"); next if (!$opt_node); if (&gst_xml_model_get_attribute ($opt_node, "VALUE") eq $name) |