Changeset 9911 in josm


Ignore:
Timestamp:
2016-03-02T10:48:41+01:00 (4 years ago)
Author:
simon04
Message:

Remove code to be removed end of 2015

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r9829 r9911  
    9797
    9898    private static final String[] OBSOLETE_PREF_KEYS = {
    99             "remote.control.host", // replaced by individual values for IPv4 and IPv6. To remove end of 2015
    100             "osm.notes.enableDownload", // was used prior to r8071 when notes was an hidden feature. To remove end of 2015
    101             "mappaint.style.migration.switchedToMapCSS", // was used prior to 8315 for MapCSS switch. To remove end of 2015
    102             "mappaint.style.migration.changedXmlName" // was used prior to 8315 for MapCSS switch. To remove end of 2015
    10399    };
    104100
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java

    r9645 r9911  
    22package org.openstreetmap.josm.tools;
    33
    4 import static org.openstreetmap.josm.tools.I18n.marktr;
    54import static org.openstreetmap.josm.tools.I18n.tr;
    65
     
    3837        // They just insist on painting themselves...
    3938        Utils.updateSystemProperty("apple.laf.useScreenMenuBar", "true");
    40         migrateOldDirectory();
    4139    }
    4240
     
    346344        return new File(System.getProperty("user.home")+"/Library", "JOSM");
    347345    }
    348 
    349     /***
    350      * Prior to r7834, JOSM used the same Unix directory ~/.josm for all local files (preferences,
    351      * caches, user data). This method migrates the existing preferences and plugins to new directories
    352      * if applicable. Old directory, including cache, is deleted.
    353      * Method to remove end of 2015.
    354      * @since 7835
    355      */
    356     public static void migrateOldDirectory() {
    357         File oldDir = new File(System.getProperty("user.home"), ".josm");
    358         if (oldDir.exists()) {
    359             boolean error = false;
    360 
    361             File oldPref = new File(oldDir, "preferences.xml");
    362             if (oldPref.exists()) {
    363                 File newPref = Main.pref.getPreferenceFile();
    364                 if (!newPref.exists()) {
    365                     try {
    366                         Utils.mkDirs(Main.pref.getPreferencesDirectory());
    367                         Main.info("Copying old preferences file to new location");
    368                         Utils.copyFile(oldPref, newPref);
    369                         Utils.deleteFile(oldPref, marktr("Unable to delete old preferences file {0}"));
    370                     } catch (IOException e) {
    371                         Main.error(e);
    372                         error = true;
    373                     }
    374                 }
    375             }
    376 
    377             File oldPlugins = new File(oldDir, "plugins");
    378             if (oldPlugins.exists()) {
    379                 File newPlugins = Main.pref.getPluginsDirectory();
    380                 if (!newPlugins.exists()) {
    381                     try {
    382                         Utils.copyDirectory(oldPlugins, newPlugins);
    383                     } catch (IOException e) {
    384                         Main.error(e);
    385                         error = true;
    386                     }
    387                 }
    388             }
    389 
    390             if (!error) {
    391                 Main.info("Deleting old preferences directory");
    392                 if (!Utils.deleteDirectory(oldDir)) {
    393                     Main.warn("Unable to delete old preferences directory");
    394                 }
    395             }
    396         }
    397     }
    398346}
Note: See TracChangeset for help on using the changeset viewer.