Assign editor->map to nullptr after clearing map cache
This commit is contained in:
parent
c382190e8b
commit
afb157beb3
4 changed files with 8 additions and 0 deletions
|
@ -128,6 +128,7 @@ private slots:
|
|||
void onWildMonDataChanged();
|
||||
void openNewMapPopupWindow(int, QVariant);
|
||||
void onNewMapCreated();
|
||||
void onMapCacheCleared();
|
||||
|
||||
void on_action_NewMap_triggered();
|
||||
void on_actionNew_Tileset_triggered();
|
||||
|
|
|
@ -219,6 +219,7 @@ private:
|
|||
signals:
|
||||
void reloadProject();
|
||||
void uncheckMonitorFilesAction();
|
||||
void mapCacheCleared();
|
||||
};
|
||||
|
||||
#endif // PROJECT_H
|
||||
|
|
|
@ -326,6 +326,7 @@ bool MainWindow::openProject(QString dir) {
|
|||
editor->closeProject();
|
||||
editor->project = new Project(this);
|
||||
QObject::connect(editor->project, SIGNAL(reloadProject()), this, SLOT(on_action_Reload_Project_triggered()));
|
||||
QObject::connect(editor->project, SIGNAL(mapCacheCleared()), this, SLOT(onMapCacheCleared()));
|
||||
QObject::connect(editor->project, &Project::uncheckMonitorFilesAction, [this] () { ui->actionMonitor_Project_Files->setChecked(false); });
|
||||
on_actionMonitor_Project_Files_triggered(porymapConfig.getMonitorFiles());
|
||||
editor->project->set_root(dir);
|
||||
|
@ -2217,6 +2218,10 @@ void MainWindow::onMapNeedsRedrawing() {
|
|||
redrawMapScene();
|
||||
}
|
||||
|
||||
void MainWindow::onMapCacheCleared() {
|
||||
editor->map = nullptr;
|
||||
}
|
||||
|
||||
void MainWindow::onTilesetsSaved(QString primaryTilesetLabel, QString secondaryTilesetLabel) {
|
||||
this->editor->updatePrimaryTileset(primaryTilesetLabel, true);
|
||||
this->editor->updateSecondaryTileset(secondaryTilesetLabel, true);
|
||||
|
|
|
@ -143,6 +143,7 @@ void Project::clearMapCache() {
|
|||
Map *map = mapCache->take(mapName);
|
||||
if (map) delete map;
|
||||
}
|
||||
emit mapCacheCleared();
|
||||
}
|
||||
|
||||
void Project::clearTilesetCache() {
|
||||
|
|
Loading…
Reference in a new issue