Changeset 8249 in josm for trunk/src/org


Ignore:
Timestamp:
2015-04-23T18:32:29+02:00 (9 years ago)
Author:
simon04
Message:

see #11356 - Remote control: fix opening overpass query

The compatibility code calling DownloadOsmTask had not been executed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java

    r8197 r8249  
    3333    protected void handleRequest() throws RequestHandlerErrorException {
    3434        try {
    35             if (Main.pref.getBoolean("remotecontrol.import.interactive", true)) {
     35            if (suitableDownloadTasks.isEmpty()) {
     36                // It should maybe be better to reject the request in that case ?
     37                // For compatibility reasons with older instances of JOSM, arbitrary choice of DownloadOsmTask
     38                // As of 2015-04, Overpass Turbo requires this branch of code ...
     39                Main.debug("Remote control, /import: defaulting to DownloadOsmTask");
     40                new DownloadOsmTask().loadUrl(isLoadInNewLayer(), url.toExternalForm(), null);
     41            } else if (Main.pref.getBoolean("remotecontrol.import.interactive", true)) {
    3642                // OpenLocationAction queries the user if more than one task is suitable
    3743                new OpenLocationAction().openUrl(isLoadInNewLayer(), url.toExternalForm());
     
    105111        // Find download tasks for the given URL
    106112        suitableDownloadTasks = Main.main.menu.openLocation.findDownloadTasks(urlString, true);
    107         if (suitableDownloadTasks.isEmpty()) {
    108             // It should maybe be better to reject the request in that case ?
    109             // For compatibility reasons with older instances of JOSM, arbitrary choice of DownloadOsmTask
    110             suitableDownloadTasks.add(new DownloadOsmTask());
    111         }
    112113    }
    113114}
Note: See TracChangeset for help on using the changeset viewer.