mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-14 21:07:44 -05:00
Centralize file-changed logic in the callback. Ignore watched files for 5 seconds, when saving them. On Windows, there is a fuzzy delay between the time a file is written and when the signal fires in Qt, and we can't rely on blocking signals or temporarily removing the watched filepaths. It also fires three or four duplicate times for a single file.
This commit is contained in:
@@ -314,6 +314,7 @@ bool MainWindow::openProject(QString dir) {
|
||||
&& setMap(getDefaultMap(), true);
|
||||
} else {
|
||||
QString open_map = editor->map->name;
|
||||
editor->project->fileWatcher.removePaths(editor->project->fileWatcher.files());
|
||||
editor->project->clearMapCache();
|
||||
editor->project->clearTilesetCache();
|
||||
success = loadDataStructures() && populateMapList() && setMap(open_map, true);
|
||||
@@ -1260,7 +1261,6 @@ void MainWindow::on_actionUse_Encounter_Json_triggered(bool checked)
|
||||
|
||||
void MainWindow::on_actionMonitor_Project_Files_triggered(bool checked)
|
||||
{
|
||||
editor->project->fileWatcher.blockSignals(!checked);
|
||||
porymapConfig.setMonitorFiles(checked);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user