Fix closing a pattern file.

Window title was still not cleaned properly.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-10-18 14:01:18 +03:00
parent 95d6bceb9b
commit 36d5f245b9
3 changed files with 10 additions and 1 deletions

View File

@ -3043,7 +3043,8 @@ void MainWindow::Clear()
{ {
watcher->removePath(AbsoluteMPath(qApp->GetPatternPath(), doc->MPath())); watcher->removePath(AbsoluteMPath(qApp->GetPatternPath(), doc->MPath()));
} }
doc->clear(); doc->Clear();
UpdateWindowTitle();
UpdateVisibilityGroups(); UpdateVisibilityGroups();
detailsWidget->UpdateList(); detailsWidget->UpdateList();
qCDebug(vMainWindow, "Clearing scenes."); qCDebug(vMainWindow, "Clearing scenes.");

View File

@ -628,8 +628,14 @@ void VAbstractPattern::setCursor(const quint32 &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VAbstractPattern::setXMLContent(const QString &fileName) void VAbstractPattern::setXMLContent(const QString &fileName)
{ {
Clear();
VDomDocument::setXMLContent(fileName); VDomDocument::setXMLContent(fileName);
}
//---------------------------------------------------------------------------------------------------------------------
void VAbstractPattern::Clear()
{
clear();
*patternNumberCached = unknownCharacter; *patternNumberCached = unknownCharacter;
*labelDateFormatCached = unknownCharacter; *labelDateFormatCached = unknownCharacter;
*patternNameCached = unknownCharacter; *patternNameCached = unknownCharacter;

View File

@ -116,6 +116,8 @@ public:
virtual void UpdateToolData(const quint32 &id, VContainer *data)=0; virtual void UpdateToolData(const quint32 &id, VContainer *data)=0;
virtual void Clear();
static VDataTool* getTool(quint32 id); static VDataTool* getTool(quint32 id);
static void AddTool(quint32 id, VDataTool *tool); static void AddTool(quint32 id, VDataTool *tool);
static void RemoveTool(quint32 id); static void RemoveTool(quint32 id);