Ignore:
Timestamp:
2009-12-09T21:24:32+01:00 (14 years ago)
Author:
Gubaer
Message:

comment to follow in a later commit
Have to break up a commit because of SSL problem in SVN (filed a ticket - #4093)

File:
1 edited

Legend:

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

    r2569 r2598  
    2323        OsmApi api = OsmApi.getOsmApi();
    2424        try {
     25            // FIXME: this should run asynchronously and a progress monitor
     26            // should be displayed.
    2527            api.initialize(NullProgressMonitor.INSTANCE);
    2628            long maxNodes = 0;
     
    2830                maxNodes = api.getCapabilities().getLong("waynodes","maximum");
    2931            }
    30             long maxElements = 0;
    31             if (api.getCapabilities().isDefined("changesets", "maximum_elements")) {
    32                 maxElements = api.getCapabilities().getLong("changesets", "maximum_elements");
    33             }
    34 
    3532            if (maxNodes > 0) {
    3633                if( !checkMaxNodes(apiData.getPrimitivesToAdd(), maxNodes))
     
    4037                if( !checkMaxNodes(apiData.getPrimitivesToDelete(), maxNodes))
    4138                    return false;
    42             }
    43 
    44             if (maxElements  > 0) {
    45                 int total = 0;
    46                 total = apiData.getPrimitivesToAdd().size() + apiData.getPrimitivesToUpdate().size() + apiData.getPrimitivesToDelete().size();
    47                 if(total > maxElements) {
    48                     JOptionPane.showMessageDialog(
    49                             Main.parent,
    50                             tr("Current number of changes exceeds the max. number of changes, current is {0}, max is {1}",
    51                                     total,
    52                                     maxElements
    53                             ),
    54                             tr("API Capabilities Violation"),
    55                             JOptionPane.ERROR_MESSAGE
    56                     );
    57                     return false;
    58                 }
    5939            }
    6040        } catch (OsmApiInitializationException e) {
Note: See TracChangeset for help on using the changeset viewer.