fix: project's unit file not correctly add to watch after renamed

This commit is contained in:
royqh1979@gmail.com 2021-11-17 23:21:53 +08:00
parent e60b909294
commit a2e514e98a
2 changed files with 3 additions and 3 deletions

View File

@ -3143,7 +3143,7 @@ void MainWindow::onFileChanged(const QString &path)
if (e) {
if (fileExists(path)) {
e->activate();
if (QMessageBox::question(this,tr("Compile"),
if (QMessageBox::question(this,tr("File Changed"),
tr("File '%1' was changed.").arg(path)+"<BR /><BR />" + tr("Reload its content from disk?"),
QMessageBox::Yes|QMessageBox::No,
QMessageBox::No) == QMessageBox::Yes) {
@ -3154,7 +3154,7 @@ void MainWindow::onFileChanged(const QString &path)
}
}
} else {
if (QMessageBox::question(this,tr("Compile"),
if (QMessageBox::question(this,tr("File Changed"),
tr("File '%1' was removed.").arg(path)+"<BR /><BR />" + tr("Keep it open?"),
QMessageBox::Yes|QMessageBox::No,
QMessageBox::Yes) == QMessageBox::No) {

View File

@ -1969,7 +1969,7 @@ bool ProjectModel::setData(const QModelIndex &index, const QVariant &value, int
}
// Add new filename to file minitor
pMainWindow->fileSystemWatcher()->removePath(oldName);
pMainWindow->fileSystemWatcher()->addPath(newName);
return true;
} else {
//change folder name