-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprojectdocument.cpp
More file actions
41 lines (33 loc) · 1.03 KB
/
Copy pathprojectdocument.cpp
File metadata and controls
41 lines (33 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "projectdocument.h"
#include "phpqt5constants.h"
#include "projecteditorwidget.h"
#include "qmljstools/qmljstoolsconstants.h"
namespace PHPQt5 {
namespace Internal {
ProjectDocument::ProjectDocument(ProjectEditorWidget *editorWidget)
: QmlJSEditor::QmlJSEditorDocument(),
m_editorWidget(editorWidget)
{
setId(Constants::PROJECT_EDITOR_ID);
setMimeType(QLatin1String(QmlJSTools::Constants::JSON_MIMETYPE));
setSuspendAllowed(false);
connect(editorWidget, &ProjectEditorWidget::guiChanged,
this, &Core::IDocument::changed);
}
bool ProjectDocument::save(QString *errorString, const QString &fileName, bool autoSave)
{
m_editorWidget->preSave();
bool result = TextDocument::save(errorString, fileName, autoSave);
m_editorWidget->postSave();
return result;
}
bool ProjectDocument::isModified() const
{
return TextDocument::isModified() || m_editorWidget->isModified();
}
bool ProjectDocument::isSaveAsAllowed() const
{
return false;
}
} // namespace Internal
} // namespace PHPQt5