Ignore:
Timestamp:
2016-01-18T21:58:38+01:00 (9 years ago)
Author:
simon04
Message:

JOSM/reverter - Update to core changes - see #josm4003 see #josm12400

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reverter/src/reverter/ReverterUploadHook.java

    r29663 r32005  
    11package reverter;
    2 
    3 import java.util.Map;
    42
    53import org.openstreetmap.josm.Main;
     
    75import org.openstreetmap.josm.command.Command;
    86import org.openstreetmap.josm.data.APIDataSet;
    9 import org.openstreetmap.josm.data.Version;
    10 import org.openstreetmap.josm.gui.io.UploadDialog;
    117
    128public class ReverterUploadHook implements UploadHook {
     
    2622        }
    2723
    28         UploadDialog ud = UploadDialog.getUploadDialog();
    29         Map<String, String> tags = ud.getDefaultChangesetTags();
    30         String created_by = tags.get("created_by");
    31         if (created_by == null || "".equals(created_by)) {
    32             if (hasRevertions) {
    33                 tags.put("created_by", Version.getInstance().getAgentString(false) + ";" + pluginString);
    34                 ud.setDefaultChangesetTags(tags);
    35             }
    36             return true;
     24        if (hasRevertions) {
     25            Main.main.getCurrentDataSet().addChangeSetTag("created_by", "reverter");
    3726        }
    38         if (hasRevertions) {
    39             if (!created_by.contains(pluginString)) {
    40                 tags.put("created_by", created_by + ";" + pluginString);
    41             }
    42         } else {
    43             if (created_by.contains(";" + pluginString)) {
    44                 tags.put("created_by", created_by.replace(";" + pluginString, ""));
    45             }
    46         }
    47         ud.setDefaultChangesetTags(tags);
    4827        return true;
    4928    }
Note: See TracChangeset for help on using the changeset viewer.