From ed44ec4ee8658a3767888713981328fd3a23ddd1 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Mon, 26 Feb 2018 19:30:44 +0800 Subject: [PATCH] bug-fix: use second accuracy to detect file change outside --- src/vfile.cpp | 2 +- src/vmdtab.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vfile.cpp b/src/vfile.cpp index 37547dab..8ea85069 100644 --- a/src/vfile.cpp +++ b/src/vfile.cpp @@ -112,7 +112,7 @@ bool VFile::isInternalImageFolder(const QString &p_path) const bool VFile::isChangedOutside() const { QDateTime lm = QFileInfo(fetchPath()).lastModified(); - return lm != m_lastModified; + return lm.toSecsSinceEpoch() != m_lastModified.toSecsSinceEpoch(); } void VFile::reload() diff --git a/src/vmdtab.cpp b/src/vmdtab.cpp index 1bb48387..5934126b 100644 --- a/src/vmdtab.cpp +++ b/src/vmdtab.cpp @@ -339,6 +339,7 @@ bool VMdTab::saveFile() QMessageBox::Ok, QMessageBox::Ok, this); ret = false; } else { + m_checkFileChange = false; m_editor->saveFile(); ret = m_file->save(); if (!ret) {