data: refreshing with DB

* database stores modification time of files.
* FileManager updates internal state based on database info.
* reimplemented FileManager's check if a file is in project.
* implemented clearing data of updated or removed files before reparsing the updated and added files.
This commit is contained in:
malte_langkabel
2015-09-16 18:53:33 +02:00
parent 73b1b77ca8
commit 3d94b78b8c
22 changed files with 406 additions and 109 deletions
+9 -6
View File
@@ -29,7 +29,7 @@ bool Project::loadProjectSettings(const FilePath& projectSettingsFile)
{
m_projectSettingsFilepath = projectSettingsFile;
m_fileManager.reset();
//m_fileManager.reset();
updateFileManager();
}
return success;
@@ -59,7 +59,7 @@ void Project::clearProjectSettings()
m_projectSettingsFilepath = FilePath();
ProjectSettings::getInstance()->clear();
m_fileManager.reset();
//m_fileManager.reset();
}
void Project::reloadProjectSettings()
@@ -91,11 +91,13 @@ void Project::parseCode()
std::set<FilePath> updatedFilePaths = m_fileManager.getUpdatedFilePaths();
std::set<FilePath> removedFilePaths = m_fileManager.getRemovedFilePaths();
utility::append(updatedFilePaths, m_storage->getDependingFilePathsAndRemoveFileNodes(updatedFilePaths));
utility::append(updatedFilePaths, m_storage->getDependingFilePathsAndRemoveFileNodes(removedFilePaths));
utility::append(updatedFilePaths, m_storage->getDependingFilePaths(updatedFilePaths));
utility::append(removedFilePaths, m_storage->getDependingFilePaths(removedFilePaths));
m_storage->clearFileData(updatedFilePaths);
m_storage->clearFileData(removedFilePaths);
m_storage->clearFileElements(updatedFilePaths);
m_storage->clearFileElements(removedFilePaths);
m_storage->removeUnusedNames();
std::vector<FilePath> filesToParse;
filesToParse.insert(filesToParse.end(), addedFilePaths.begin(), addedFilePaths.end());
@@ -167,5 +169,6 @@ Parser::Arguments Project::getParserArguments() const
Project::Project(StorageAccessProxy* storageAccessProxy)
: m_storageAccessProxy(storageAccessProxy)
, m_fileManager(storageAccessProxy)
{
}