Designer: Use static pattern for FormEditorW singleton

Change-Id: Icf4a0135d9bc8441d468fd77abe29adcee677bb9
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
hjk
2014-09-03 16:03:35 +02:00
parent f70ba9930e
commit 1e28e75904
14 changed files with 294 additions and 292 deletions

View File

@@ -29,6 +29,7 @@
#include "formwindowfile.h"
#include "designerconstants.h"
#include "resourcehandler.h"
#include <utils/qtcassert.h>
@@ -60,6 +61,10 @@ FormWindowFile::FormWindowFile(QDesignerFormWindowInterface *form, QObject *pare
connect(m_formWindow->commandHistory(), SIGNAL(indexChanged(int)),
this, SLOT(setShouldAutoSave()));
connect(m_formWindow, SIGNAL(changed()), SLOT(updateIsModified()));
m_resourceHandler = new ResourceHandler(form);
connect(this, SIGNAL(filePathChanged(QString,QString)),
m_resourceHandler, SLOT(updateResources()));
}
bool FormWindowFile::save(QString *errorString, const QString &name, bool autoSave)
@@ -217,6 +222,11 @@ QString FormWindowFile::formWindowContents() const
return m_formWindow->contents();
}
ResourceHandler *FormWindowFile::resourceHandler() const
{
return m_resourceHandler;
}
void FormWindowFile::slotFormWindowRemoved(QDesignerFormWindowInterface *w)
{
// Release formwindow as soon as the FormWindowManager removes