Skip to content

Commit

Permalink
- Added the locale_support config-key. (enabled by default)
Browse files Browse the repository at this point in the history
- Fixed a few warnings in some special cases.
  • Loading branch information
trizen committed Oct 29, 2017
1 parent b47358c commit c6105ac
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions obmenu-generator
Expand Up @@ -247,6 +247,7 @@ my %CONFIG = (
icon_size => 48,
force_icon_size => 0,
generic_fallback => 0,
locale_support => 1,

VERSION => $version,
);
Expand Down Expand Up @@ -380,9 +381,9 @@ sub get_icon_path {
my ($name) = @_;

state $gtk = do {
delete $INC{'Exporter.pm'};
delete $INC{'Carp.pm'};
delete $INC{'Tie/Hash.pm'};
delete $INC{'Exporter.pm'} if !defined($INC{'Exporter.pm'});
delete $INC{'Carp.pm'} if !defined($INC{'Carp.pm'});
delete $INC{'Tie/Hash.pm'} if !defined($INC{'Tie/Hash.pm'});
require Gtk2;
require Digest::MD5;
'Gtk2'->init;
Expand Down Expand Up @@ -507,14 +508,14 @@ foreach my $file ($desk_obj->get_desktop_files) {

eval {
state $x = do {
delete $INC{'Exporter.pm'};
delete $INC{'Carp.pm'};
delete $INC{'Exporter.pm'} if !defined($INC{'Exporter.pm'});
delete $INC{'Carp.pm'} if !defined($INC{'Carp.pm'});
require Encode;
require File::DesktopEntry;
};
my $fde = File::DesktopEntry->new($file);
$info{Name} = Encode::encode_utf8($fde->get('Name'));
};
} if $CONFIG{locale_support};

state $entities = {
'&' => '&',
Expand Down

0 comments on commit c6105ac

Please sign in to comment.