# HG changeset patch # User timkelly # Date 1257176883 21600 # Node ID 9198c2581dd629f9d606fb7efc16f47bd8b51d23 # Parent dc7d28d9b9114533c125e2fc294b4a0e8df2a8de Remove file counting (too slow performance on slow drive connections). See bug 9997. diff -r dc7d28d9b911 -r 9198c2581dd6 project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/ProjectPropertiesPage.java --- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/ProjectPropertiesPage.java Mon Nov 02 08:19:18 2009 -0600 +++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/importWizards/ProjectPropertiesPage.java Mon Nov 02 09:48:03 2009 -0600 @@ -52,7 +52,6 @@ private Text projectName; private Text rootDirectory; private Button browseButton; - private long MAX_FILE_COUNT_UNDER_ROOT = 20000; String projectNameText = ""; //$NON-NLS-1$ IPath rootDirectoryPath = null; @@ -254,40 +253,25 @@ return true; } - if (rootDirectoryPath.isRoot()){ - long resCount = countFilesRecursivelyWithMax(rootDirectoryPath.toFile(), 0); - // Don't show warning, if by chance there's few sources under the root - if (resCount >= MAX_FILE_COUNT_UNDER_ROOT){ + if (rootDirectoryPath.isRoot() || rootDirectoryPath.segmentCount() == 1){ + + if (rootDirectoryPath.segmentCount() == 1){ + for (ISymbianBuildContext context : parsedWithConfigs){ + IPath sdkRoot = new Path(context.getSDK().getEPOCROOT()); + if (rootDirectoryPath.isPrefixOf(sdkRoot) || sdkRoot.isPrefixOf(rootDirectoryPath)){ + setMessage(Messages.ProjectPropertiesPage_directoryIsRoot, IStatus.WARNING); + break; + } + } + } else { setMessage(Messages.ProjectPropertiesPage_directoryIsRoot, IStatus.WARNING); } - return true; + } return true; } - /** - * Recursively count the # of files under a given directory. Stops counting when count >= MAX_FILE_COUNT_UNDER_ROOT - * @param directory - Start directory - * @param start count, current count - * @return - */ - private long countFilesRecursivelyWithMax(File directory, long inCount) { - if (inCount >= MAX_FILE_COUNT_UNDER_ROOT) - return MAX_FILE_COUNT_UNDER_ROOT; - if (directory.isDirectory()) { - String[] children = directory.list(); - inCount = children.length + inCount; // increment the file count for this directory - for (int i=0; i