mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't treat files in project folder as project files (IDEA-170271)
This commit is contained in:
@@ -287,7 +287,7 @@ public class ProjectUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
final File projectFile = new File(projectFilePath);
|
||||
File projectFile = new File(projectFilePath);
|
||||
if (projectFile.isDirectory()) {
|
||||
return FileUtil.pathsEqual(projectFilePath, existingBaseDirPath);
|
||||
}
|
||||
@@ -298,9 +298,10 @@ public class ProjectUtil {
|
||||
|
||||
File parent = projectFile.getParentFile();
|
||||
if (parent.getName().equals(Project.DIRECTORY_STORE_FOLDER)) {
|
||||
projectFile = parent;
|
||||
parent = parent.getParentFile();
|
||||
}
|
||||
return parent != null && FileUtil.pathsEqual(parent.getPath(), existingBaseDirPath);
|
||||
return parent != null && FileUtil.pathsEqual(parent.getPath(), existingBaseDirPath) && projectFile.getName().equals(Project.DIRECTORY_STORE_FOLDER);
|
||||
}
|
||||
|
||||
public static void focusProjectWindow(final Project p, boolean executeIfAppInactive) {
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@ public class ProjectOpeningTest extends PlatformTestCase {
|
||||
assertTrue(ProjectUtil.isSameProject(projectDir.getAbsolutePath(), dirBasedProject));
|
||||
assertFalse(ProjectUtil.isSameProject(createTempDir("project2").getAbsolutePath(), dirBasedProject));
|
||||
File iprFilePath = new File(projectDir, "project.ipr");
|
||||
assertTrue(ProjectUtil.isSameProject(iprFilePath.getAbsolutePath(), dirBasedProject));
|
||||
assertFalse(ProjectUtil.isSameProject(iprFilePath.getAbsolutePath(), dirBasedProject));
|
||||
File miscXmlFilePath = new File(projectDir, ".idea/misc.xml");
|
||||
assertTrue(ProjectUtil.isSameProject(miscXmlFilePath.getAbsolutePath(), dirBasedProject));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user