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

This commit is contained in:
Le Tan 2018-02-26 19:30:44 +08:00
parent da5218452f
commit ed44ec4ee8
2 changed files with 2 additions and 1 deletions

View File

@ -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()

View File

@ -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) {