diff --git a/src/lib/utility/TimePoint.cpp b/src/lib/utility/TimePoint.cpp index e91f8046..e7554b9a 100644 --- a/src/lib/utility/TimePoint.cpp +++ b/src/lib/utility/TimePoint.cpp @@ -24,6 +24,11 @@ TimePoint::TimePoint(std::string s) } } +bool TimePoint::isValid() const +{ + return m_time != boost::posix_time::not_a_date_time; +} + std::string TimePoint::toString() const { std::stringstream stream; diff --git a/src/lib/utility/TimePoint.h b/src/lib/utility/TimePoint.h index b0acf6e0..12edef2b 100644 --- a/src/lib/utility/TimePoint.h +++ b/src/lib/utility/TimePoint.h @@ -11,6 +11,8 @@ public: //TimePoint(time_t t); TimePoint(std::string s); + bool isValid() const; + std::string toString() const; inline bool operator==(const TimePoint& rhs){ return m_time == rhs.m_time; } diff --git a/src/lib_gui/qt/element/QtCodeFile.cpp b/src/lib_gui/qt/element/QtCodeFile.cpp index a5266d81..eb91c1dc 100644 --- a/src/lib_gui/qt/element/QtCodeFile.cpp +++ b/src/lib_gui/qt/element/QtCodeFile.cpp @@ -111,8 +111,11 @@ QtCodeFile::~QtCodeFile() void QtCodeFile::setModificationTime(TimePoint modificationTime) { - m_modificationTime = modificationTime; - updateTitleBar(); + if (modificationTime.isValid()) + { + m_modificationTime = modificationTime; + updateTitleBar(); + } } const FilePath& QtCodeFile::getFilePath() const