Browse Source

bug-fix: use second accuracy to detect file change outside

Le Tan 7 years ago
parent
commit
ed44ec4ee8
2 changed files with 2 additions and 1 deletions
  1. 1 1
      src/vfile.cpp
  2. 1 0
      src/vmdtab.cpp

+ 1 - 1
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()

+ 1 - 0
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) {