aboutsummaryrefslogtreecommitdiffstats
path: root/AdminPanel
diff options
context:
space:
mode:
authorMatteo Pasotti <matteo@mageia.org>2013-01-15 15:08:55 +0000
committerMatteo Pasotti <matteo@mageia.org>2013-01-15 15:08:55 +0000
commit4345045d3cf8e367af99f8ed1336e17a1e461cbd (patch)
tree116cbe00b8b075aedc5c9b89e167be8d4a5ee074 /AdminPanel
parent1ade940bd86aa26438f363c9d06e397c867cb886 (diff)
downloadmanatools-4345045d3cf8e367af99f8ed1336e17a1e461cbd.tar
manatools-4345045d3cf8e367af99f8ed1336e17a1e461cbd.tar.gz
manatools-4345045d3cf8e367af99f8ed1336e17a1e461cbd.tar.bz2
manatools-4345045d3cf8e367af99f8ed1336e17a1e461cbd.tar.xz
manatools-4345045d3cf8e367af99f8ed1336e17a1e461cbd.zip
- gui.pm: fixed some warnings
- icon.pm: renamed get_icon to get_icon_path - rpmdragora: fixed wrong viewbox_callback argument (hash by ref)
Diffstat (limited to 'AdminPanel')
-rw-r--r--AdminPanel/Rpmdragora/gui.pm13
-rw-r--r--AdminPanel/Rpmdragora/icon.pm6
2 files changed, 9 insertions, 10 deletions
diff --git a/AdminPanel/Rpmdragora/gui.pm b/AdminPanel/Rpmdragora/gui.pm
index 62064923..77dc9cc1 100644
--- a/AdminPanel/Rpmdragora/gui.pm
+++ b/AdminPanel/Rpmdragora/gui.pm
@@ -37,7 +37,6 @@ use common;
# TO WORKAROUND LOCALIZATION ISSUE
use AdminPanel::Rpmdragora::localization;
-use yui;
use AdminPanel::rpmdragora;
use AdminPanel::Rpmdragora::open_db;
use AdminPanel::Rpmdragora::formatting;
@@ -45,6 +44,7 @@ use AdminPanel::Rpmdragora::init;
use AdminPanel::Rpmdragora::icon;
use AdminPanel::Rpmdragora::pkg;
use AdminPanel::Shared;
+use yui;
use feature 'state';
our @EXPORT = qw(
@@ -443,12 +443,10 @@ sub add_parent {
my $treeItem;
if($i == 0){
$parent = $item;
- $treeItem = new yui::YTreeItem($item,get_icon($item,0),0);
+ $treeItem = new yui::YTreeItem($item,get_icon_path($item,0),0);
if(!defined($groups_tree{$parent})) {
- $groups_tree{$parent} = {
- parent => $treeItem,
- children => ()
- };
+ $groups_tree{$parent}{parent} = $treeItem;
+ $groups_tree{$parent}{children} = ();
$tree->addItem($groups_tree{$parent}{'parent'});
}
}else{
@@ -456,7 +454,7 @@ sub add_parent {
# push @{$groups_tree{$parent}{'children'}}, $item;
#}
if(!defined($groups_tree{$parent}{'children'}{$item})){
- $treeItem = new yui::YTreeItem($item,get_icon($item,$parent),0);
+ $treeItem = new yui::YTreeItem($item,get_icon_path($item,$parent),0);
$groups_tree{$parent}{'children'}{$item} = $treeItem;
$groups_tree{$parent}{'parent'}->addChild($treeItem);
}
@@ -1021,6 +1019,7 @@ sub build_tree {
my ($tree, $tree_model, $elems, $options, $force_rebuild, $flat, $mode) = @_;
state $old_mode;
$mode = $options->{rmodes}{$mode} || $mode;
+ $old_mode = '' if(!defined($old_mode));
return if $old_mode eq $mode && !$force_rebuild;
$old_mode = $mode;
undef $force_rebuild;
diff --git a/AdminPanel/Rpmdragora/icon.pm b/AdminPanel/Rpmdragora/icon.pm
index 38ed61ca..d9ba2b1f 100644
--- a/AdminPanel/Rpmdragora/icon.pm
+++ b/AdminPanel/Rpmdragora/icon.pm
@@ -27,13 +27,13 @@ package AdminPanel::Rpmdragora::icon;
use strict;
our @ISA = qw(Exporter);
use lib qw(/usr/lib/libDrakX);
-use common;
use POSIX;
+use common;
# TO WORKAROUND LOCALIZATION ISSUE
use AdminPanel::Rpmdragora::localization;
-our @EXPORT = qw(get_icon);
+our @EXPORT = qw(get_icon_path);
#- /usr/share/rpmlint/config (duplicates are normal, so that we are not too far away from .py)
my %group_icons = (
N("All") => 'system_section',
@@ -222,7 +222,7 @@ my %group_icons = (
);
-sub get_icon {
+sub get_icon_path {
my ($group, $parent) = @_;
my $path;
if(isdigit($parent) && $parent == 0){