X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FReaction%2FUI%2FView.pm;h=358fcf12251bc238805c72594a186549c6034182;hb=8b498574c015710a13644328549b298cef385f74;hp=1b492b859228967457e684c50365c4fe9e2711e9;hpb=349a57a4fc068a20f80a90e36fb38efa00142f47;p=catagits%2FReaction.git diff --git a/lib/Reaction/UI/View.pm b/lib/Reaction/UI/View.pm index 1b492b8..358fcf1 100644 --- a/lib/Reaction/UI/View.pm +++ b/lib/Reaction/UI/View.pm @@ -10,7 +10,6 @@ use aliased 'Path::Class::Dir'; class View which { - has '_widget_class_cache' => (is => 'ro', default => sub { {} }); has '_widget_cache' => (is => 'ro', default => sub { {} }); has '_layout_set_cache' => (is => 'ro', default => sub { {} }); @@ -42,8 +41,8 @@ class View which { my ($self) = @_; Skin->new( name => $self->skin_name, view => $self, - skin_base_path => # returns a File, not a Dir. Thanks, Catalyst. - Dir->new($self->app->path_to('share', 'skin', $self->skin_name)), + # path_to returns a File, not a Dir. Thanks, Catalyst. + skin_base_dir => Dir->new($self->app->path_to('share', 'skin')), ); }; @@ -77,30 +76,6 @@ class View which { ); }; - implements 'widget_class_for' => as { - my ($self, $layout_set) = @_; - my $base = $self->blessed; - my $widget_type = $layout_set->widget_type; - my $app_name = ref $self->app || $self->app; - return $self->_widget_class_cache->{$widget_type} ||= do { - - my @search_path = ($base, $app_name, 'Reaction::UI'); - my @haystack = map {join('::', $_, 'Widget', $widget_type)} @search_path; - - foreach my $class (@haystack) { - #if the class is already loaded skip the call to Installed etc. - return $class if Class::MOP::is_class_loaded($class); - next unless Class::Inspector->installed($class); - - my $ok = eval { Class::MOP::load_class($class) }; - confess("Failed to load widget '${class}': $@") if $@; - return $class; - } - confess "Couldn't locate widget '${widget_type}' for layout " - ."'${\$layout_set->name}': tried: ".join(", ", @haystack); - }; - }; - implements 'layout_set_for' => as { my ($self, $vp) = @_; #print STDERR "Getting layoutset for VP ".(ref($vp) || "SC:".$vp)."\n";