save all paths in .iml relatively except for the ones under USER_HOME (IDEA-60906)

reason: fixes the issue and I don't see any problems it could cause
This commit is contained in:
peter.gromov
2010-11-18 19:32:31 +03:00
parent f45755e795
commit 08de853c05
2 changed files with 2 additions and 13 deletions
@@ -45,18 +45,7 @@ public class ModulePathMacroManager extends BasePathMacroManager {
public ReplacePathToMacroMap getReplacePathMap() {
ReplacePathToMacroMap result = super.getReplacePathMap();
if (!myModule.isDisposed()) {
String projectDir = ProjectPathMacroManager.getProjectDir(myModule.getProject());
if (projectDir != null) {
projectDir = projectDir.replace('/', File.separatorChar);
}
String stopAt = projectDir;
final String userHome = getUserHome();
if (stopAt != null && stopAt.startsWith(userHome)) {
stopAt = userHome;
}
addFileHierarchyReplacements(result, PathMacrosImpl.MODULE_DIR_MACRO_NAME, getModuleDir(myModule.getModuleFilePath()), stopAt);
addFileHierarchyReplacements(result, PathMacrosImpl.MODULE_DIR_MACRO_NAME, getModuleDir(myModule.getModuleFilePath()), getUserHome());
}
return result;
}
@@ -81,7 +81,7 @@ public class BasePathMacroManager extends PathMacroManager {
}
protected static String getUserHome() {
return SystemProperties.getUserHome();
return StringUtil.trimEnd(SystemProperties.getUserHome(), "/");
}