Changeset 4757 for extensions/pLoader


Ignore:
Timestamp:
Jan 26, 2010, 7:50:43 PM (14 years ago)
Author:
ronosman
Message:

Bug 1403 fixed : re-upload choice may be overridden by default values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/pLoader/trunk/src/Uploader/ImageList.pm

    r4747 r4757  
    430430}
    431431
    432 sub RemoveImage {
    433     my ( $self, $index ) = @_;
    434 
    435     return if (! defined $self->image_selection );
    436     return if (! defined $index );
    437        
    438     $self->DeleteImage($index);
    439     splice @{$self->sums}, $index, 1 ;
    440     $self->wx_thumb_imglist->Remove($index);
    441    
    442 }
    443432
    444433# used for display in GUI. has to fit a square box ( wxImageList )
     
    809798            1+$self->count
    810799        );
    811         # remove thumbnail, resized, HD files
     800        # remove thumbnail, resized
    812801        # to make sure everything is clean
    813         map{
    814             unlink $self->current_image->$_ if -e $self->current_image->$_;
    815         }
    816         qw/ site_resized_file site_high_file site_thumb_file/;
     802        # keep site_high_file because it can be the original !!!
     803        $self->_remove_resized_from_cache;
    817804    }
    818805
     
    823810
    824811    $self->_upload_selection_final_log();
     812}
     813
     814
     815sub _remove_resized_from_cache {
     816    my ( $self ) = @_;
     817
     818    unlink $self->current_image->site_thumb_file if -e $self->current_image->site_thumb_file;
     819
     820    map {
     821        my $file = File::Spec->catfile(
     822            $self->site_resized_dir,
     823            sprintf(
     824                "%s.%s",
     825                 $_,
     826                $self->type,
     827            )
     828        );
     829        unlink $file if -e $file;
     830    } qw /resized high/;
     831
     832
    825833}
    826834
     
    10171025            $self->site_resized_dir,
    10181026            sprintf(
    1019                 "%s_%sx%s.%s",
    1020 #                $filename,
     1027                "%s.%s",
    10211028                'resized',
    1022                 $self->resize_w,
    1023                 $self->resize_h,
    10241029                $self->type,
    10251030            )
     
    11951200                sprintf(
    11961201                    "%s.%s",
    1197                      'high_file',
     1202                     'high',
    11981203                    $self->type,
    11991204                )
     
    12441249    my ( $self ) = @_;
    12451250
    1246    
     1251    # set default values only if not defined
     1252    # || operator is not used because 0 is a choice value
     1253    $self->reupload_action_files(1)
     1254        unless defined $self->reupload_action_files;
     1255
     1256    $self->pwg->reupload_action_properties(1)
     1257        unless defined $self->pwg->reupload_action_properties;
     1258
     1259    $self->pwg->reupload_action_properties_m(1)
     1260        unless defined $self->pwg->reupload_action_properties_m;
     1261
    12471262    $self->pwg->reupload_action_files(
    1248         $self->reupload_action_files||1
     1263        $self->reupload_action_files
    12491264    );
    12501265    $self->pwg->reupload_action_properties(
    1251         $self->reupload_action_properties||2
     1266        $self->reupload_action_properties
    12521267    );
    12531268
    12541269    $self->pwg->reupload_action_properties_m(
    1255         $self->reupload_action_properties_m||1
     1270        $self->reupload_action_properties_m
    12561271    );
    12571272   
Note: See TracChangeset for help on using the changeset viewer.