diff options
author | Daouda Lo <daouda@mandriva.com> | 2003-06-27 17:05:34 +0000 |
---|---|---|
committer | Daouda Lo <daouda@mandriva.com> | 2003-06-27 17:05:34 +0000 |
commit | 5a54312a349f93f7962c76d328676fe00dc36594 (patch) | |
tree | 0182dadf46f6f27199cfe60e86e7cc1919a0ca28 | |
parent | b55164ae2328bafe18f38bbf0ec68cc98f93f8de (diff) | |
download | userdrake-5a54312a349f93f7962c76d328676fe00dc36594.tar userdrake-5a54312a349f93f7962c76d328676fe00dc36594.tar.gz userdrake-5a54312a349f93f7962c76d328676fe00dc36594.tar.bz2 userdrake-5a54312a349f93f7962c76d328676fe00dc36594.tar.xz userdrake-5a54312a349f93f7962c76d328676fe00dc36594.zip |
- no warnings when $ctx is about to be defined
-rwxr-xr-x | userdrake | 44 |
1 files changed, 20 insertions, 24 deletions
@@ -36,27 +36,23 @@ my $conffile = '/etc/sysconfig/userdrake'; my $secfile = '/etc/sysconfig/msec'; my $pixdir = '/usr/share/userdrake/pixmaps/'; -c::bind_textdomain_codeset('userdrake', 'UTF8'); -sub translate { - my ($s) = @_; - my $r = ''; - if ($s) { - $r = c::dgettext('userdrake', $s); - $r eq $s and $r = Locale::gettext::iconv(c::dgettext('urpmi', $s), undef, "UTF-8"); - c::set_tagged_utf8($r); - } - $r; -} -sub sprintf_fixutf8 { - my $need_upgrade; - $need_upgrade |= to_bool(c::is_tagged_utf8($_)) + 1 foreach @_; - if ($need_upgrade == 3) { c::upgrade_utf8($_) foreach @_ }; - sprintf shift, @_; -} -sub N { - my $s = shift @_; my $t = translate($s); - sprintf_fixutf8 $t, @_; -} +#c::bind_textdomain_codeset('userdrake', 'UTF8'); +#sub translate { + # my ($s) = @_; + # my $r = $s ? c::dgettext('userdrake', $s) : ''; + # c::set_tagged_utf8($r); + # $r; +#} +#sub sprintf_fixutf8 { + # my $need_upgrade; + # $need_upgrade |= to_bool(c::is_tagged_utf8($_)) + 1 foreach @_; + # if ($need_upgrade == 3) { c::upgrade_utf8($_) foreach @_ }; + # sprintf shift, @_; +#} +#sub N { + # my $s = shift @_; my $t = translate($s); + # sprintf_fixutf8 $t, @_; +#} my $in = interactive->vnew('su'); @@ -165,8 +161,8 @@ sub NotebookSwitch { sub RefreshUsersFull { my ($filterusers, $strfilt) = @_; my ($users, $gid, $group, $groupnm); - $users = $ctx->UsersEnumerateFull(); - $utree_model->clear(); + defined $ctx and $users = $ctx->UsersEnumerateFull; + $utree_model->clear; my @UserReal; LOOP: foreach my $l (@$users) { next LOOP if ($filterusers && $l->Uid($GetValue) <= 499 || $l->Uid($GetValue) == 65534) ; push(@UserReal, $l) if $l->UserName($GetValue) =~ /^\Q$strfilt/; }; foreach my $l (@UserReal) { @@ -177,7 +173,7 @@ sub RefreshUsersFull { } sub RefreshGroupsFull { my ($filtergroups, $strfilt) = @_; - my $groups = $ctx->GroupsEnumerateFull(); + defined $ctx and my $groups = $ctx->GroupsEnumerateFull(); $gtree_model->clear(); my @GroupReal; LOOP:foreach my $g (@$groups) { next LOOP if ($filtergroups && $g->Gid($GetValue) <= 499 || $g->Gid($GetValue) == 65534); push(@GroupReal, $g) if $g->GroupName($GetValue) =~ /^\Q$strfilt/ }; |