summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-07-16 17:31:02 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-07-16 02:30:49 +0000
commit3827bb9f227f90806560251c7dd048d30c081c25 (patch)
tree4f056fa40e83284e2b3d3f02a1710b0b9cad3f53
parent0a3043f44b7aa23f4153ebe41c27c6ae896e6a2d (diff)
parent3dc53513db1a072e47e4b2c0c111ba4b91e4d709 (diff)
downloadidea-3827bb9f227f90806560251c7dd048d30c081c25.tar.gz
Merge "72680: Handle Studio settings upgrades more automatically"
-rw-r--r--platform/platform-impl/src/com/intellij/openapi/application/ConfigImportHelper.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/platform/platform-impl/src/com/intellij/openapi/application/ConfigImportHelper.java b/platform/platform-impl/src/com/intellij/openapi/application/ConfigImportHelper.java
index 36bd876c15b4..ed40589a7d20 100644
--- a/platform/platform-impl/src/com/intellij/openapi/application/ConfigImportHelper.java
+++ b/platform/platform-impl/src/com/intellij/openapi/application/ConfigImportHelper.java
@@ -133,6 +133,27 @@ public class ConfigImportHelper {
maxFile = file;
}
}
+
+ // Android Studio: Attempt to find user settings from earlier versions where the settings names
+ // are different from the current setting name
+ if (maxFile == null) {
+ File preview = new File(PathManager.getDefaultConfigPathFor("AndroidStudioPreview"));
+ File beta = new File(PathManager.getDefaultConfigPathFor("AndroidStudioBeta")); // relevant when we switch from beta to stable
+ for (File file : new File[] { preview, beta }) {
+ if (!file.isDirectory()) {
+ continue;
+ }
+ File options = new File(file, CONFIG_RELATED_PATH + OPTIONS_XML);
+ if (options.exists()) {
+ final long modified = options.lastModified();
+ if (modified > lastModified) {
+ lastModified = modified;
+ maxFile = file;
+ }
+ }
+ }
+ }
+
return maxFile != null ? new File(maxFile, CONFIG_RELATED_PATH) : null;
}