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
+11
View File
@@ -94,6 +94,17 @@ std::vector<FileInfo> FileSystem::getFileInfosFromPaths(
return files;
}
TimePoint FileSystem::getLastWriteTime(const FilePath& filePath)
{
boost::posix_time::ptime lastWriteTime;
if (FileSystem::exists(filePath.str()))
{
std::time_t t = boost::filesystem::last_write_time(filePath.path());
lastWriteTime = boost::posix_time::from_time_t(t);
}
return TimePoint(lastWriteTime);
}
std::string FileSystem::getTimeStringNow() // TODO: move to utility
{
return boost::posix_time::to_iso_string(boost::posix_time::second_clock::universal_time());