Ticket #19448: Preferences__save_on_put_in_specialized_methods.patch

File Preferences__save_on_put_in_specialized_methods.patch, 6.4 KB (added by hiddewie, 6 years ago)
  • core/scripts/TagInfoExtract.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    620620     */
    621621    private void init() throws IOException {
    622622        Logging.setLogLevel(Logging.LEVEL_INFO);
    623         Preferences.main().enableSaveOnPut(false);
     623        Preferences.main().disableSaveOnPut();
    624624        Config.setPreferencesInstance(Preferences.main());
    625625        Config.setBaseDirectoriesProvider(JosmBaseDirectories.getInstance());
    626626        Config.setUrlsProvider(JosmUrls.getInstance());
  • core/src/org/openstreetmap/josm/data/Preferences.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    914914    /**
    915915     * Enables or not the preferences file auto-save mechanism (save each time a setting is changed).
    916916     * This behaviour is enabled by default.
     917     *
    917918     * @param enable if {@code true}, makes JOSM save preferences file each time a setting is changed
     919     * @deprecated use {@link Preferences#disableSaveOnPut()} or {@link Preferences#enableSaveOnPut()}
    918920     * @since 7085
    919921     */
     922    @Deprecated(since = "16726")
    920923    public final void enableSaveOnPut(boolean enable) {
    921924        synchronized (this) {
    922925            saveOnPut = enable;
    923926        }
    924927    }
     928
     929    /**
     930     * Enables the preferences file auto-save mechanism (save each time a setting is changed).
     931     * This behaviour is the default.
     932     *
     933     * @since 16726
     934     */
     935    public void enableSaveOnPut() {
     936        enableSaveOnPut(true);
     937    }
     938
     939    /**
     940     * Disables the preferences file auto-save mechanism (save each time a setting is changed).
     941     *
     942     * @since 16726
     943     */
     944    public void disableSaveOnPut() {
     945        enableSaveOnPut(false);
     946    }
    925947}
  • core/test/unit/org/openstreetmap/josm/gui/io/CustomConfiguratorTest.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    8888        // Test 2 - read(file, pref) + replace
    8989        Preferences pref = new Preferences();
    9090        // avoid messing up preferences file (that makes all following unit tests fail)
    91         pref.enableSaveOnPut(false);
     91        pref.disableSaveOnPut();
    9292        pref.putList("lorem_ipsum", Arrays.asList("only 1 string"));
    9393        assertEquals(1, pref.getList("lorem_ipsum").size());
    9494        CustomConfigurator.readXML(new File(TestUtils.getTestDataRoot() + "customconfigurator", "replace.xml"), pref);
  • core/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    525525            final Map<String, Setting<?>> defaultsMap = (Map<String, Setting<?>>) TestUtils.getPrivateField(pref, "defaultsMap");
    526526            defaultsMap.clear();
    527527            pref.resetToInitialState();
    528             pref.enableSaveOnPut(false);
     528            pref.disableSaveOnPut();
    529529            // No pref init -> that would only create the preferences file.
    530530            // We force the use of a wrong API server, just in case anyone attempts an upload
    531531            Config.getPref().put("osm-server.url", "http://invalid");
  • core/test/unit/org/openstreetmap/josm/JOSMFixture.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    112112        Config.setUrlsProvider(JosmUrls.getInstance());
    113113        HttpClient.setFactory(Http1Client::new);
    114114        pref.resetToInitialState();
    115         pref.enableSaveOnPut(false);
     115        pref.disableSaveOnPut();
    116116        I18n.init();
    117117        // initialize the plaform hook, and
    118118        // call the really early hook before we anything else
  • plugins/conflation/test/unit/org/openstreetmap/josm/plugins/conflation/ConflationPluginTest.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    173173    public static void setUpBeforeClass() {
    174174      if (!isInitialized) {
    175175          //System.setProperty("josm.home", "test/data/preferences");
    176           Preferences.main().enableSaveOnPut(false);
     176          Preferences.main().disableSaveOnPut();
    177177          I18n.init();
    178178          Preferences.main().init(false);
    179179          I18n.set(Config.getPref().get("language", "en"));
  • plugins/pt_assistant/test/unit/org/openstreetmap/josm/plugins/pt_assistant/TestUtil.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    3838  public static synchronized void initPlugin() {
    3939    if (!isInitialized) {
    4040      System.setProperty("josm.home", "test/data/preferences");
    41       Preferences.main().enableSaveOnPut(false);
     41      Preferences.main().disableSaveOnPut();
    4242      I18n.init();
    4343      PlatformManager.getPlatform().preStartupHook();
    4444      Preferences.main().init(false);