Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 676644
Collapse All | Expand All

(-)shotwell-0.30.1/src/Photo.vala (-10 / +6 lines)
Lines 429-435 public abstract class Photo : PhotoSourc Link Here
429
                
429
                
430
                // need to remove all transformations as they're keyed to the editable's
430
                // need to remove all transformations as they're keyed to the editable's
431
                // coordinate system
431
                // coordinate system
432
                internal_remove_all_transformations(false);
432
                remove_all_transformations(false);
433
            }
433
            }
434
        }
434
        }
435
        
435
        
Lines 1519-1525 public abstract class Photo : PhotoSourc Link Here
1519
            row.master = original_master;
1519
            row.master = original_master;
1520
            row.master.copy_from(reimport_state.row.master);
1520
            row.master.copy_from(reimport_state.row.master);
1521
            if (!reimport_state.metadata_only)
1521
            if (!reimport_state.metadata_only)
1522
                internal_remove_all_transformations(false);
1522
                remove_all_transformations(false);
1523
        }
1523
        }
1524
        
1524
        
1525
        if (reimport_state.metadata != null)
1525
        if (reimport_state.metadata != null)
Lines 1596-1602 public abstract class Photo : PhotoSourc Link Here
1596
            lock (row) {
1596
            lock (row) {
1597
                editable = reimport_state.backing_state;
1597
                editable = reimport_state.backing_state;
1598
                set_orientation(reimport_state.backing_state.original_orientation);
1598
                set_orientation(reimport_state.backing_state.original_orientation);
1599
                internal_remove_all_transformations(false);
1599
                remove_all_transformations(false);
1600
            }
1600
            }
1601
        } else {
1601
        } else {
1602
            set_orientation(reimport_state.backing_state.original_orientation);
1602
            set_orientation(reimport_state.backing_state.original_orientation);
Lines 2820-2830 public abstract class Photo : PhotoSourc Link Here
2820
        return committed;
2820
        return committed;
2821
    }
2821
    }
2822
    
2822
    
2823
    public void remove_all_transformations() {
2823
    public void remove_all_transformations(bool notify = true) {
2824
        internal_remove_all_transformations(true);
2825
    }
2826
    
2827
    private void internal_remove_all_transformations(bool notify) {
2828
        bool is_altered = false;
2824
        bool is_altered = false;
2829
        lock (row) {
2825
        lock (row) {
2830
            is_altered = PhotoTable.get_instance().remove_all_transformations(row.photo_id);
2826
            is_altered = PhotoTable.get_instance().remove_all_transformations(row.photo_id);
Lines 3907-3913 public abstract class Photo : PhotoSourc Link Here
3907
        // transformations are in the master's coordinate system, not the editable's ... don't 
3903
        // transformations are in the master's coordinate system, not the editable's ... don't 
3908
        // notify photo is altered *yet* because update_editable will notify, and want to avoid 
3904
        // notify photo is altered *yet* because update_editable will notify, and want to avoid 
3909
        // stacking them up
3905
        // stacking them up
3910
        internal_remove_all_transformations(false);
3906
        remove_all_transformations(false);
3911
        update_editable(false, file_format.create_reader(file.get_path()));
3907
        update_editable(false, file_format.create_reader(file.get_path()));
3912
    }
3908
    }
3913
    
3909
    
Lines 4077-4083 public abstract class Photo : PhotoSourc Link Here
4077
        }
4073
        }
4078
        
4074
        
4079
        if (remove_transformations)
4075
        if (remove_transformations)
4080
            internal_remove_all_transformations(false);
4076
            remove_all_transformations(false);
4081
        
4077
        
4082
        if (has_editable) {
4078
        if (has_editable) {
4083
            notify_baseline_replaced();
4079
            notify_baseline_replaced();
(-)shotwell-0.30.1/src/direct/DirectPhotoPage.vala (-4 / +4 lines)
Lines 295-301 public class DirectPhotoPage : EditingHo Link Here
295
        base.update_actions(selected_count, count);
295
        base.update_actions(selected_count, count);
296
    }
296
    }
297
    
297
    
298
    private bool check_ok_to_close_photo(Photo? photo) {
298
    private bool check_ok_to_close_photo(Photo? photo, bool notify = true) {
299
        // Means we failed to load the photo for some reason. Do not block
299
        // Means we failed to load the photo for some reason. Do not block
300
        // shutdown
300
        // shutdown
301
        if (photo == null)
301
        if (photo == null)
Lines 307-313 public class DirectPhotoPage : EditingHo Link Here
307
        if (drop_if_dirty) {
307
        if (drop_if_dirty) {
308
            // need to remove transformations, or else they stick around in memory (reappearing
308
            // need to remove transformations, or else they stick around in memory (reappearing
309
            // if the user opens the file again)
309
            // if the user opens the file again)
310
            photo.remove_all_transformations();
310
            photo.remove_all_transformations(notify);
311
            
311
            
312
            return true;
312
            return true;
313
        }
313
        }
Lines 320-326 public class DirectPhotoPage : EditingHo Link Here
320
            _("Close _without Saving"));
320
            _("Close _without Saving"));
321
321
322
        if (response == Gtk.ResponseType.YES)
322
        if (response == Gtk.ResponseType.YES)
323
            photo.remove_all_transformations();
323
            photo.remove_all_transformations(notify);
324
        else if (response == Gtk.ResponseType.NO) {
324
        else if (response == Gtk.ResponseType.NO) {
325
            if (is_writeable)
325
            if (is_writeable)
326
                save(photo.get_file(), 0, ScaleConstraint.ORIGINAL, Jpeg.Quality.HIGH,
326
                save(photo.get_file(), 0, ScaleConstraint.ORIGINAL, Jpeg.Quality.HIGH,
Lines 336-342 public class DirectPhotoPage : EditingHo Link Here
336
    }
336
    }
337
    
337
    
338
    public bool check_quit() {
338
    public bool check_quit() {
339
        return check_ok_to_close_photo(get_photo());
339
        return check_ok_to_close_photo(get_photo(), false);
340
    }
340
    }
341
    
341
    
342
    protected override bool confirm_replace_photo(Photo? old_photo, Photo new_photo) {
342
    protected override bool confirm_replace_photo(Photo? old_photo, Photo new_photo) {

Return to bug 676644