PDA

View Full Version : [Slim-Checkins] r5878 - in /trunk/server/Slim:Music/TitleFormatter.pmUtils/Misc.pm Utils/OSDetect.pm Utils/PluginManager.pm Utils/Strings.pmUtils/Unicode.pm Web/HTTP.pm



Grotus
2006-01-27, 11:01
You might want to add import Slim::Utils::Misc; to the ones you changed
from use to require. Otherwise msg and bt will need to be fully qualified.

dsully (AT) svn (DOT) slimdevices.com wrote:
> Author: dsully
> Date: Fri Jan 27 09:23:06 2006
> New Revision: 5878
>
> URL: http://svn.slimdevices.com?rev=5878&view=rev
> Log:
> Bug: N/A
> Description: Fix PluginManager/OSDetect use ordering.
>
> Modified:
> trunk/server/Slim/Music/TitleFormatter.pm
> trunk/server/Slim/Utils/Misc.pm
> trunk/server/Slim/Utils/OSDetect.pm
> trunk/server/Slim/Utils/PluginManager.pm
> trunk/server/Slim/Utils/Strings.pm
> trunk/server/Slim/Utils/Unicode.pm
> trunk/server/Slim/Web/HTTP.pm
>
> Modified: trunk/server/Slim/Music/TitleFormatter.pm
> URL: http://svn.slimdevices.com/trunk/server/Slim/Music/TitleFormatter.pm?rev=5878&r1=5877&r2=5878&view=diff
> ================================================== ============================
> --- trunk/server/Slim/Music/TitleFormatter.pm (original)
> +++ trunk/server/Slim/Music/TitleFormatter.pm Fri Jan 27 09:23:06 2006
> @@ -445,7 +445,7 @@
> if ($str && $] > 5.007) {
>
> eval {
> - Encode::from_to($str, $Slim::Utils::Unicode::locale, 'utf8');
> + Encode::from_to($str, Slim::Utils::Unicode::currentLocale(), 'utf8');
> Encode::_utf8_on($str);
> };
>
>
> Modified: trunk/server/Slim/Utils/Misc.pm
> URL: http://svn.slimdevices.com/trunk/server/Slim/Utils/Misc.pm?rev=5878&r1=5877&r2=5878&view=diff
> ================================================== ============================
> --- trunk/server/Slim/Utils/Misc.pm (original)
> +++ trunk/server/Slim/Utils/Misc.pm Fri Jan 27 09:23:06 2006
> @@ -815,7 +815,7 @@
> $osDetails->{'osName'},
> ($osDetails->{'osArch'} || 'Unknown'),
> Slim::Utils::Prefs::get('language'),
> - $Slim::Utils::Unicode::locale,
> + Slim::Utils::Unicode::currentLocale(),
> );
>
> return $userAgentString;
> @@ -834,7 +834,7 @@
> $::REVISION,
> $osDetails->{'osName'},
> Slim::Utils::Prefs::get('language'),
> - $Slim::Utils::Unicode::locale,
> + Slim::Utils::Unicode::currentLocale(),
> );
>
> return $diagString;
>
> Modified: trunk/server/Slim/Utils/OSDetect.pm
> URL: http://svn.slimdevices.com/trunk/server/Slim/Utils/OSDetect.pm?rev=5878&r1=5877&r2=5878&view=diff
> ================================================== ============================
> --- trunk/server/Slim/Utils/OSDetect.pm (original)
> +++ trunk/server/Slim/Utils/OSDetect.pm Fri Jan 27 09:23:06 2006
> @@ -9,7 +9,8 @@
>
> use strict;
> use Config;
> -use Slim::Utils::Misc;
> +
> +require Slim::Utils::Misc;
>
> my $detectedOS = undef;
> my %osDetails = ();
>
> Modified: trunk/server/Slim/Utils/PluginManager.pm
> URL: http://svn.slimdevices.com/trunk/server/Slim/Utils/PluginManager.pm?rev=5878&r1=5877&r2=5878&view=diff
> ================================================== ============================
> --- trunk/server/Slim/Utils/PluginManager.pm (original)
> +++ trunk/server/Slim/Utils/PluginManager.pm Fri Jan 27 09:23:06 2006
> @@ -19,9 +19,9 @@
> use File::Spec::Functions qw(updir);
> use FindBin qw($Bin);
>
> -use Slim::Utils::OSDetect;
> -use Slim::Utils::Prefs;
> -use Slim::Utils::Misc;
> +require Slim::Utils::Misc;
> +require Slim::Utils::Prefs;
> +require Slim::Utils::Unicode;
>
> my $addGroups = 0;
> my $plugins_read;
> @@ -35,7 +35,7 @@
>
> if (!scalar @pluginDirs) {
>
> - if (Slim::Utils::OSDetect::OS() eq 'mac') {
> + if ($^O eq 'darwin') {
> push @pluginDirs, $ENV{'HOME'} . "/Library/SlimDevices/Plugins/";
> push @pluginDirs, "/Library/SlimDevices/Plugins/";
> }
> @@ -197,7 +197,7 @@
> $strings = pack "U0C*", unpack "C*", $strings;
> } else {
> # for the 5.6 laggers.
> - if ($Slim::Utils::Unicode::locale =~ /^iso-8859/) {
> + if (Slim::Utils::Unicode::currentLocale() =~ /^iso-8859/) {
> $strings = Slim::Utils::Unicode::utf8toLatin1($strings);
> }
> }
>
> Modified: trunk/server/Slim/Utils/Strings.pm
> URL: http://svn.slimdevices.com/trunk/server/Slim/Utils/Strings.pm?rev=5878&r1=5877&r2=5878&view=diff
> ================================================== ============================
> --- trunk/server/Slim/Utils/Strings.pm (original)
> +++ trunk/server/Slim/Utils/Strings.pm Fri Jan 27 09:23:06 2006
> @@ -117,7 +117,7 @@
>
> $strings = <STRINGS>;
>
> - if ($Slim::Utils::Unicode::locale =~ /^iso-8859/) {
> + if (Slim::Utils::Unicode::currentLocale() =~ /^iso-8859/) {
> $strings = Slim::Utils::Unicode::utf8toLatin1($strings);
> }
>
>
> Modified: trunk/server/Slim/Utils/Unicode.pm
> URL: http://svn.slimdevices.com/trunk/server/Slim/Utils/Unicode.pm?rev=5878&r1=5877&r2=5878&view=diff
> ================================================== ============================
> --- trunk/server/Slim/Utils/Unicode.pm (original)
> +++ trunk/server/Slim/Utils/Unicode.pm Fri Jan 27 09:23:06 2006
> @@ -352,6 +352,10 @@
> $decomposeRE = qr/($decomposeRE)/o;
> }
>
> +sub currentLocale {
> + return $locale;
> +}
> +
> sub utf8decode {
> return utf8decode_guess(@_);
> }
>
> Modified: trunk/server/Slim/Web/HTTP.pm
> URL: http://svn.slimdevices.com/trunk/server/Slim/Web/HTTP.pm?rev=5878&r1=5877&r2=5878&view=diff
> ================================================== ============================
> --- trunk/server/Slim/Web/HTTP.pm (original)
> +++ trunk/server/Slim/Web/HTTP.pm Fri Jan 27 09:23:06 2006
> @@ -1019,7 +1019,7 @@
> if ($] > 5.007) {
> $contentType .= '; charset=utf-8';
> } else {
> - $contentType .= "; charset=$Slim::Utils::Unicode::locale";
> + $contentType .= sprintf("; charset=%s", Slim::Utils::Unicode::currentLocale());
> }
> }
>
> @@ -1727,7 +1727,7 @@
>
> } else {
>
> - $params->{'LOCALE'} = $Slim::Utils::Unicode::locale || 'iso-8859-1';
> + $params->{'LOCALE'} = Slim::Utils::Unicode::currentLocale() || 'iso-8859-1';
> }
>
> # BUG 2842: find out how we get here without a defined template
>
>

Dan Sully
2006-01-27, 11:08
* Robert Moser shaped the electrons to say...

>You might want to add import Slim::Utils::Misc; to the ones you changed
>from use to require. Otherwise msg and bt will need to be fully qualified.

They'll get pulled in later - the issue there is redefinition of funcs.

-D
--
You know, for kids.

Triode
2006-01-27, 19:02
>* Robert Moser shaped the electrons to say...
>
>>You might want to add import Slim::Utils::Misc; to the ones you changed
>>from use to require. Otherwise msg and bt will need to be fully qualified.
>
> They'll get pulled in later - the issue there is redefinition of funcs.
>

I'm getting errors with --d_plugins following this:

[slimserver@vig ~]$ ./slimserver.pl --d_plugins
2006-01-28 02:00:40.9209 BROWSE_MUSIC does not exist. creating...
2006-01-28 02:00:40.9236 Registering screensaver Now Playing (Jump back on wake.)
2006-01-28 02:00:40.9242 Registering screensaver None
Undefined subroutine &Slim::Utils::PluginManager::msg called at /usr/local/slimserver/Slim/Utils/PluginManager.pm line 177.
Undefined subroutine &Slim::Utils::PluginManager::msg called at /usr/local/slimserver/Slim/Utils/PluginManager.pm line 471.
END failed--call queue aborted.

Dan Sully
2006-01-27, 19:07
* Triode shaped the electrons to say...

>I'm getting errors with --d_plugins following this:

Fixed.

-D
--
( ( ( [ ] ) ) )
In Stereo Where
Available