Ignore:
Timestamp:
07.03.2010 14:34:27 (2 years ago)
Author:
Gubaer
Message:

fixed #4681: Open Street Bug Plugin Crashed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/UpdateModifiedAction.java

    r3083 r3092  
    3232    } 
    3333 
     34    // FIXME: overrides the behaviour of UpdateSelectionAction. Doesn't update 
     35    // the enabled state based on the current selection because 
     36    // it doesn't depend on it. 
     37    // The action should be enabled/disabled based on whether there is a least 
     38    // one modified object in the current dataset. Unfortunately, there is no 
     39    // efficient way to find out here. getDataSet().allModifiedPrimitives() is 
     40    // too heavy weight because it loops over the whole dataset. 
     41    // Perhaps this action should  be a DataSetListener? Or it could listen to the 
     42    // REQUIRES_SAVE_TO_DISK_PROP and REQUIRES_UPLOAD_TO_SERVER_PROP properties 
     43    // in the OsmLayer? 
     44    // 
    3445    @Override 
    35     protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) { 
    36         super.updateEnabledState(getData()); 
     46    protected void updateEnabledState() { 
     47        setEnabled(getCurrentDataSet() != null); 
    3748    } 
    3849 
    3950    @Override 
    40     protected Collection<OsmPrimitive> getData() { 
    41         return getCurrentDataSet().allModifiedPrimitives(); 
     51    protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) { 
    4252    } 
    4353} 
Note: See TracChangeset for help on using the changeset viewer.