Changeset 9911 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2016-03-02T10:48:41+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
r9645 r9911 2 2 package org.openstreetmap.josm.tools; 3 3 4 import static org.openstreetmap.josm.tools.I18n.marktr;5 4 import static org.openstreetmap.josm.tools.I18n.tr; 6 5 … … 38 37 // They just insist on painting themselves... 39 38 Utils.updateSystemProperty("apple.laf.useScreenMenuBar", "true"); 40 migrateOldDirectory();41 39 } 42 40 … … 346 344 return new File(System.getProperty("user.home")+"/Library", "JOSM"); 347 345 } 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 directories352 * if applicable. Old directory, including cache, is deleted.353 * Method to remove end of 2015.354 * @since 7835355 */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 }398 346 }
Note:
See TracChangeset
for help on using the changeset viewer.