Changeset 1450 for trunk


Ignore:
Timestamp:
11/13/19 15:15:33 (4 years ago)
Author:
bnemhaus
Message:

Fixed bug I introduced in the delete image file on delete expeditee picture. Bug was causing issues with non-shift delete of pictures, this is fixed now.

Location:
trunk/src/org/expeditee
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gio/gesture/StandardGestureActions.java

    r1448 r1450  
    19821982                // the current frame as well as the overlay frame
    19831983                Frame currentFrame = DisplayController.getCurrentFrame();
    1984                 currentFrame.addToUndoDelete(new ItemsList(itemList));
     1984                currentFrame.addToUndoDelete(new ItemsList(itemList), false);
    19851985                itemList.clear();
    19861986                if (bReparse) {
     
    33053305                        SessionStats.DeletedItems(toUndo);
    33063306                        if (parent != null) {
    3307                                 parent.addToUndoDelete(new ItemsList(toUndo));
     3307                                parent.addToUndoDelete(new ItemsList(toUndo), !canditateFilesToDelete.isEmpty());
    33083308                                parent.removeAllItems(toUndo); // toDelete.getConnected()
    33093309                                deleteUnusedFiles(canditateFilesToDelete);
  • trunk/src/org/expeditee/gui/Frame.java

    r1449 r1450  
    10641064        /**
    10651065         * Adds the given History event to the stack.
    1066          *
    1067          * @param stack The stack to add to
    10681066         * @param items The items to put in the event
    10691067         * @param type  The type of event that occurred
    1070          */
    1071         private void addToUndo(ItemsList items, History.Type type) {
     1068         * @param undoDeleteAssociatedFiles TODO
     1069         * @param stack The stack to add to
     1070         */
     1071        private void addToUndo(ItemsList items, History.Type type, boolean undoDeleteAssociatedFiles) {
    10721072                if (items.size() < 1) {
    10731073                        return;
    10741074                }
    10751075
    1076                 _undo.push(new History(items, type));
    1077         }
    1078        
    1079         public void addToUndoDelete(ItemsList items) {
    1080                 addToUndo(items, History.Type.deletion);
     1076                _undo.push(new History(items, type, undoDeleteAssociatedFiles));
     1077        }
     1078       
     1079        public void addToUndoDelete(ItemsList items, boolean undoDeleteAssociatedFiles) {
     1080                addToUndo(items, History.Type.deletion, undoDeleteAssociatedFiles);
    10811081        }
    10821082       
    10831083        public void addToUndoMove(ItemsList items) {
    1084                 addToUndo(items, History.Type.movement);
     1084                addToUndo(items, History.Type.movement, false);
    10851085        }
    10861086
     
    11011101                        _redo.push(undo);
    11021102                for(Item i : undo.items) {
    1103                         if (i instanceof org.expeditee.items.Picture) {
     1103                        if (i instanceof org.expeditee.items.Picture && undo.undoDeleteAssociatedFiles) {
    11041104                                String destination = ((Picture) i).getPath();
    11051105                                Path destinationPath = Paths.get(destination);
     
    11281128                        ItemsList changed = new ItemsList(body);
    11291129                        changed.retainAll(undo.items);
    1130                         _redo.push(new History(changed, History.Type.movement));
     1130                        _redo.push(new History(changed, History.Type.movement, false));
    11311131                        for(Item i : undo.items) {
    11321132                                int index;
     
    11901190                        ItemsList changed = new ItemsList(body);
    11911191                        changed.retainAll(redo.items);
    1192                         _undo.push(new History(changed, History.Type.movement));
     1192                        _undo.push(new History(changed, History.Type.movement, false));
    11931193                        for(Item i : redo.items) {
    11941194                                int index;
     
    18341834               
    18351835                _body.removeAll(newBody);
    1836                 addToUndoDelete(_body);
     1836                addToUndoDelete(_body, false);
    18371837                _body = newBody;
    18381838                change();
     
    18651865                }
    18661866               
    1867                 addToUndoDelete(deleted);
     1867                addToUndoDelete(deleted, false);
    18681868                change();
    18691869               
     
    30193019               
    30203020                public final Type type;
    3021                
    3022                 public History(ItemsList changed, Type type)
     3021
     3022                public final boolean undoDeleteAssociatedFiles;
     3023               
     3024                public History(ItemsList changed, Type type, boolean undoDeleteAssociatedFiles)
    30233025                {
     3026                        this.undoDeleteAssociatedFiles = undoDeleteAssociatedFiles;
    30243027                        this.items = new ItemsList(changed);
    30253028                        this.type = type;
Note: See TracChangeset for help on using the changeset viewer.