Changeset 847
- Timestamp:
- 11/09/08 02:30:39 (3 years ago)
- Location:
- trunk/lib/Padre
- Files:
-
- 2 edited
-
Document.pm (modified) (2 diffs)
-
Wx/MainWindow.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Padre/Document.pm
r781 r847 181 181 $self->set_mimetype( $self->guess_mimetype ); 182 182 } 183 $self->rebless ($class);183 $self->rebless; 184 184 185 185 return $self; … … 187 187 188 188 sub rebless { 189 my ($self , $class) = @_;190 191 # If we blessed as the base class, and the mime type has a192 # specific subclass, rebless it.189 my ($self) = @_; 190 191 # Rebless as either to a subclass if there is a mime-type or 192 # to the the base class, 193 193 # This isn't exactly the most elegant way to do this, but will 194 194 # do for a first implementation. 195 if ( $class eq __PACKAGE__ ) { 196 my $subclass = $MIME_CLASS{$self->mimetype}; 197 if ( $subclass ) { 198 Class::Autouse->autouse($subclass); 199 bless $self, $subclass; 200 } 195 my $subclass = $MIME_CLASS{$self->mimetype} || __PACKAGE__; 196 if ( $subclass ) { 197 Class::Autouse->autouse($subclass); 198 bless $self, $subclass; 201 199 } 202 200 -
trunk/lib/Padre/Wx/MainWindow.pm
r846 r847 1052 1052 $doc->set_mimetype( $doc->guess_mimetype ); 1053 1053 $doc->editor->padre_setup; 1054 $doc->rebless; 1054 1055 1055 1056 $self->refresh_all;
Note: See TracChangeset
for help on using the changeset viewer.
