diff --git a/java/idea-ui/src/com/intellij/ide/RecentProjectsManagerImpl.java b/java/idea-ui/src/com/intellij/ide/RecentProjectsManagerImpl.java index 8157595c4c97..aad53e4a2e8f 100644 --- a/java/idea-ui/src/com/intellij/ide/RecentProjectsManagerImpl.java +++ b/java/idea-ui/src/com/intellij/ide/RecentProjectsManagerImpl.java @@ -20,7 +20,6 @@ import com.intellij.openapi.components.RoamingType; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.platform.PlatformProjectOpenProcessor; @@ -48,8 +47,9 @@ public class RecentProjectsManagerImpl extends RecentProjectsManagerBase { @Override protected void doOpenProject(@NotNull String projectPath, Project projectToClose, boolean forceOpenInNewFrame) { - if (new File(projectPath).isDirectory() && !new File(projectPath, Project.DIRECTORY_STORE_FOLDER).exists()) { - VirtualFile projectDir = LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(projectPath)); + File projectFile = new File(projectPath); + if (projectFile.isDirectory() && !new File(projectFile, Project.DIRECTORY_STORE_FOLDER).exists()) { + VirtualFile projectDir = LocalFileSystem.getInstance().findFileByIoFile(projectFile); PlatformProjectOpenProcessor processor = PlatformProjectOpenProcessor.getInstanceIfItExists(); if (projectDir != null && processor != null) { processor.doOpenProject(projectDir, projectToClose, forceOpenInNewFrame); diff --git a/java/idea-ui/src/com/intellij/ide/impl/NewProjectUtil.java b/java/idea-ui/src/com/intellij/ide/impl/NewProjectUtil.java index e46e74833e95..62184dfc35d6 100644 --- a/java/idea-ui/src/com/intellij/ide/impl/NewProjectUtil.java +++ b/java/idea-ui/src/com/intellij/ide/impl/NewProjectUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -98,8 +98,7 @@ public class NewProjectUtil { LOG.assertTrue(projectDir != null, "Cannot create project in '" + projectFilePath + "': no parent file exists"); FileUtil.ensureExists(projectDir); if (StorageScheme.DIRECTORY_BASED == dialog.getStorageScheme()) { - final File ideaDir = new File(projectFilePath, Project.DIRECTORY_STORE_FOLDER); - FileUtil.ensureExists(ideaDir); + FileUtil.ensureExists(new File(projectFilePath, Project.DIRECTORY_STORE_FOLDER)); } final Project newProject; diff --git a/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java b/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java index a25ff877207f..bdc5923b535f 100644 --- a/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java +++ b/java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,16 +29,17 @@ import java.io.File; public class ProjectDirCheckoutListener implements CheckoutListener { @Override public boolean processCheckedOutDirectory(Project project, File directory) { - if (new File(directory, Project.DIRECTORY_STORE_FOLDER).exists()) { - String message = VcsBundle.message("checkout.open.project.dir.prompt", - ProjectCheckoutListener.getProductNameWithArticle(), directory.getPath()); - int rc = Messages.showYesNoDialog(project, message, VcsBundle.message("checkout.title"), Messages.getQuestionIcon()); - if (rc == Messages.YES) { - ProjectUtil.openProject(directory.getPath(), project, false); - } - return true; + // todo Rider project layout — several .idea.solution-name names + if (!new File(directory, Project.DIRECTORY_STORE_FOLDER).exists()) { + return false; } - return false; + + String message = VcsBundle.message("checkout.open.project.dir.prompt", + ProjectCheckoutListener.getProductNameWithArticle(), directory.getPath()); + if (Messages.showYesNoDialog(project, message, VcsBundle.message("checkout.title"), Messages.getQuestionIcon()) == Messages.YES) { + ProjectUtil.openProject(directory.getPath(), project, false); + } + return true; } @Override