]> jfr.im git - irc/xchat.git/commitdiff
reloadall should also look in the plugins directory
authorlsitu <redacted>
Sat, 20 Feb 2010 22:37:37 +0000 (22:37 +0000)
committerlsitu <redacted>
Sat, 20 Feb 2010 22:37:37 +0000 (22:37 +0000)
git-svn-id: svn://svn.code.sf.net/p/xchat/svn@1396 893a96be-7f27-4fdf-9d1e-6aeec9d3cce1

plugins/perl/Xchat.pm

index 9c7654fa5fb59710aebb3faea0d6e9f24bdb5e30..c537f98af37e9b8553906a6e7bd27e7eda4fb211 100644 (file)
@@ -623,19 +623,22 @@ sub reload {
 }
 
 sub reload_all {
-       my $dir = Xchat::get_info( "xchatdirfs" ) || Xchat::get_info( "xchatdir" );
-       my $auto_load_glob = File::Spec->catfile( $dir, "*.pl" );
-       my @scripts = map { $_->{filename} }
-               sort { $a->{loaded_at} <=> $b->{loaded_at} } values %scripts;
-       push @scripts, File::Glob::bsd_glob( $auto_load_glob );
-
-       my %seen;
-       @scripts = grep { !$seen{ $_ }++ } @scripts;
-
-       unload_all();
-       for my $script ( @scripts ) {
-               if( !pkg_info( file2pkg( $script ) ) ) {
-                       load( $script );
+       my @dirs = Xchat::get_info( "xchatdirfs" ) || Xchat::get_info( "xchatdir" );
+       push @dirs, File::Spec->catdir( $dirs[0], "plugins" );
+       for my $dir ( @dirs ) {
+               my $auto_load_glob = File::Spec->catfile( $dir, "*.pl" );
+               my @scripts = map { $_->{filename} }
+                       sort { $a->{loaded_at} <=> $b->{loaded_at} } values %scripts;
+               push @scripts, File::Glob::bsd_glob( $auto_load_glob );
+
+               my %seen;
+               @scripts = grep { !$seen{ $_ }++ } @scripts;
+
+               unload_all();
+               for my $script ( @scripts ) {
+                       if( !pkg_info( file2pkg( $script ) ) ) {
+                               load( $script );
+                       }
                }
        }
 }