ui: file not up to date display

* the codeview now displays a hatched background for a filename when the file's content has changed or the file does not exist anymore.
* added TimePoint class to encapsulate boost.
This commit is contained in:
malte_langkabel
2015-11-03 10:29:29 +01:00
parent 42ab36fbad
commit a524a7a71c
18 changed files with 161 additions and 20 deletions
+6
View File
@@ -5,6 +5,7 @@
#include "utility/file/FileSystem.h"
#include "utility/logging/logging.h"
#include "utility/TimePoint.h"
#include "utility/utility.h"
#include "utility/utilityString.h"
@@ -1219,6 +1220,11 @@ std::shared_ptr<TextAccess> Storage::getFileContent(const FilePath& filePath) co
return m_sqliteStorage.getFileContentByPath(filePath.str());
}
TimePoint Storage::getFileModificationTime(const FilePath& filePath) const
{
return TimePoint(m_sqliteStorage.getFileByPath(filePath.str()).modificationTime);
}
Id Storage::addNodeHierarchy(Node::NodeType nodeType, NameHierarchy nameHierarchy, bool defined, bool distinct)
{
std::vector<Id> nameIds = addNameHierarchyElements(nameHierarchy);
+1 -2
View File
@@ -161,8 +161,7 @@ public:
virtual std::shared_ptr<TokenLocationFile> getTokenLocationOfParentScope(const TokenLocation* child) const;
virtual std::shared_ptr<TextAccess> getFileContent(const FilePath& filePath) const;
virtual TimePoint getFileModificationTime(const FilePath& filePath) const;
private:
Id addNodeHierarchy(Node::NodeType nodeType, NameHierarchy nameHierarchy, bool defined, bool distinct = false);
+2
View File
@@ -17,6 +17,7 @@ class TextAccess;
class TokenLocation;
class TokenLocationCollection;
class TokenLocationFile;
class TimePoint;
class StorageAccess
{
@@ -56,6 +57,7 @@ public:
virtual std::shared_ptr<TokenLocationFile> getTokenLocationOfParentScope(const TokenLocation* child) const = 0;
virtual std::shared_ptr<TextAccess> getFileContent(const FilePath& filePath) const = 0;
virtual TimePoint getFileModificationTime(const FilePath& filePath) const = 0;
};
#endif // STORAGE_ACCESS_H
@@ -6,6 +6,7 @@
#include "utility/logging/logging.h"
#include "utility/file/FileInfo.h"
#include "utility/TimePoint.h"
StorageAccessProxy::StorageAccessProxy()
: m_subject(nullptr)
@@ -243,3 +244,13 @@ std::shared_ptr<TextAccess> StorageAccessProxy::getFileContent(const FilePath& f
return nullptr;
}
TimePoint StorageAccessProxy::getFileModificationTime(const FilePath& filePath) const
{
if (hasSubject())
{
return m_subject->getFileModificationTime(filePath);
}
return TimePoint(boost::posix_time::not_a_date_time);
}
+1
View File
@@ -47,6 +47,7 @@ public:
virtual std::shared_ptr<TokenLocationFile> getTokenLocationOfParentScope(const TokenLocation* child) const;
virtual std::shared_ptr<TextAccess> getFileContent(const FilePath& filePath) const;
virtual TimePoint getFileModificationTime(const FilePath& filePath) const;
private:
StorageAccess* m_subject;