if ((odl.requiresSaveToFile() || (odl.requiresUploadToServer() && !odl.isUploadDiscouraged())) && odl.isModified()) {
layersWithUnmodifiedChanges.add(odl);
}
}
if (exit) {
dialog.prepareForSavingAndUpdatingLayersBeforeExit();
} else {
dialog.prepareForSavingAndUpdatingLayersBeforeDelete();
}
if (!layersWithUnmodifiedChanges.isEmpty()) {
dialog.getModel().populate(layersWithUnmodifiedChanges);