This commit is contained in:
Vladimir Krivosheev
2016-09-21 17:03:33 +02:00
parent 0f1af32765
commit ea67eafba4
3 changed files with 16 additions and 16 deletions
@@ -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);
@@ -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;
@@ -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