Changeset 307

Show
Ignore:
Timestamp:
03/05/06 09:30:37
Author:
miyagawa
Message:
  • Added clone, clear_entries to $feed
  • Added source to $entry, if it's copied to SmartFeed?
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Entry.pm

    r208 r307  
    4646} 
    4747 
    48 sub clone { 
    49     my $self = shift; 
    50     my $clone = Storable::dclone($self); 
    51     $clone; 
    52 } 
    53  
    5448sub id_safe { 
    5549    my $self = shift; 
  • trunk/plagger/lib/Plagger/Feed.pm

    r212 r307  
    33 
    44use base qw( Plagger::Thing ); 
    5 __PACKAGE__->mk_accessors(qw( link url image description language author updated tags meta type source_xml )); 
     5__PACKAGE__->mk_accessors(qw( link url image description language author updated tags meta type source_xml source )); 
    66 
    77use Digest::MD5 qw(md5_hex); 
     
    7171} 
    7272 
     73sub clear_entries { 
     74    my $self = shift; 
     75    $self->{entries} = []; 
     76} 
     77 
    73781; 
  • trunk/plagger/lib/Plagger/Plugin/SmartFeed.pm

    r138 r307  
    3030sub feed_entry { 
    3131    my($self, $context, $args) = @_; 
    32     $self->{feed}->add_entry($args->{entry}->clone); 
     32 
     33    my $entry = $args->{entry}->clone; 
     34    my $feed  = $args->{feed}->clone; 
     35       $feed->clear_entries; 
     36    $entry->source($feed); # xxx is it only valid for SmartFeed 
     37 
     38    $self->{feed}->add_entry($entry); 
    3339} 
    3440 
  • trunk/plagger/lib/Plagger/Thing.pm

    r208 r307  
    1717} 
    1818 
     19sub clone { 
     20    my $self = shift; 
     21    my $clone = Storable::dclone($self); 
     22    $clone; 
     23} 
     24 
    19251;