diff options
-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/ }; |