logic: reduce access to filesystem while indexing

* use canonical filepath cache in cxx indexer
* made constructors of FilePath explicit
* use FilePath at more places instead of string
* forward declares FilePath wherever possible
This commit is contained in:
malte_langkabel
2017-05-04 10:55:16 +02:00
parent 55d3f9c189
commit 054b8fab17
156 changed files with 656 additions and 444 deletions
+6 -6
View File
@@ -110,7 +110,7 @@ void ApplicationSettings::setUseAnimations(bool useAnimations)
FilePath ApplicationSettings::getColorSchemePath() const
{
FilePath defaultPath(ResourcePaths::getColorSchemesPath() + "bright.xml");
FilePath defaultPath(ResourcePaths::getColorSchemesPath().concat(FilePath("bright.xml")));
FilePath path(getValue<std::string>("application/color_scheme", defaultPath.str()));
if (path != defaultPath && !path.exists())
@@ -276,14 +276,14 @@ void ApplicationSettings::setJavaMaximumMemory(int size)
setValue<int>("indexing/java/java_maximum_memory", size);
}
std::string ApplicationSettings::getMavenPath() const
FilePath ApplicationSettings::getMavenPath() const
{
return getValue<std::string>("indexing/java/maven_path", "");
return FilePath(getValue<std::string>("indexing/java/maven_path", ""));
}
void ApplicationSettings::setMavenPath(const std::string path)
void ApplicationSettings::setMavenPath(const FilePath& path)
{
setValue<std::string>("indexing/java/maven_path", path);
setValue<std::string>("indexing/java/maven_path", path.str());
}
std::vector<FilePath> ApplicationSettings::getHeaderSearchPaths() const
@@ -369,7 +369,7 @@ std::vector<FilePath> ApplicationSettings::getRecentProjects() const
}
else
{
recentProjects.push_back(UserPaths::getSampleProjectsPath() + project.str());
recentProjects.push_back(UserPaths::getSampleProjectsPath().concat(project));
}
}
return recentProjects;