Changeset 18940 in josm


Ignore:
Timestamp:
2024-01-16T08:06:33+01:00 (5 months ago)
Author:
GerdP
Message:

see #23415/r18939 ( MarkerLayerTest still failed)

  • restore most of the old behaviour of destroy() and destroyInstance() as it was before r18937
  • don't call destroy inside updateLayers() as this code is also used in unit tests
  • check in layerRemoving() if dialog should be destroyed

Hope this now fixes all unit tests. Some of them fail on my machine because the expect to run in English while my machine is configured to German. Have to find out where this can be changed...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java

    r18939 r18940  
    147147        MapFrame map = MainApplication.getMap();
    148148        synchronized (ImageViewerDialog.class) {
    149             if (dialog != null) {
    150                 if (map != null && map.getToggleDialog(ImageViewerDialog.class) != null) {
    151                     map.removeToggleDialog(dialog);
    152                 }
    153                 if (!dialog.isDestroyed()) {
    154                     dialog.destroy();
    155                 }
     149            if (dialog != null && map != null && map.getToggleDialog(ImageViewerDialog.class) != null) {
     150                map.removeToggleDialog(dialog);
    156151            }
    157152        }
     
    303298        if (geoImageLayers.isEmpty()) {
    304299            this.layers.setVisible(false);
    305             hideNotify();
    306             if (hasInstance())
    307                 destroyInstance();
    308300        } else {
    309301            this.layers.setVisible(true);
     
    430422    }
    431423
    432     private boolean isDestroyed() {
    433         return this.titleBar == null;
    434     }
    435 
    436424    /**
    437425     * This literally exists to silence sonarlint complaints.
     
    11281116        }
    11291117        this.updateLayers(true);
     1118        if (!layers.isVisible()) {
     1119            hideNotify();
     1120            destroy();
     1121        }
    11301122    }
    11311123
Note: See TracChangeset for help on using the changeset viewer.