forked from qt-creator/qt-creator
Add override to IDocument hierarchy
Change-Id: I6884f59fe0f06e380254c1f8076dd561d9df4ee3 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -42,13 +42,15 @@ class AndroidManifestDocument : public TextEditor::TextDocument
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit AndroidManifestDocument(AndroidManifestEditorWidget *editorWidget);
|
explicit AndroidManifestDocument(AndroidManifestEditorWidget *editorWidget);
|
||||||
bool save(QString *errorString, const QString &fileName = QString(), bool autoSave = false);
|
bool save(QString *errorString, const QString &fileName = QString(),
|
||||||
|
bool autoSave = false) override;
|
||||||
|
|
||||||
QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
|
|
||||||
|
bool isModified() const override;
|
||||||
|
bool isSaveAsAllowed() const override;
|
||||||
|
|
||||||
bool isModified() const;
|
|
||||||
bool isSaveAsAllowed() const;
|
|
||||||
private:
|
private:
|
||||||
AndroidManifestEditorWidget *m_editorWidget;
|
AndroidManifestEditorWidget *m_editorWidget;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ class JavaDocument : public TextEditor::TextDocument
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
JavaDocument();
|
JavaDocument();
|
||||||
QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,12 +57,12 @@ class AutotoolsProjectFile : public Core::IDocument
|
|||||||
public:
|
public:
|
||||||
AutotoolsProjectFile(AutotoolsProject *project, const QString &fileName);
|
AutotoolsProjectFile(AutotoolsProject *project, const QString &fileName);
|
||||||
|
|
||||||
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
|
||||||
QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
bool isModified() const;
|
bool isModified() const override;
|
||||||
bool isSaveAsAllowed() const;
|
bool isSaveAsAllowed() const override;
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AutotoolsProject *m_project;
|
AutotoolsProject *m_project;
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ public:
|
|||||||
this, SLOT(provideNewRange(quint64)));
|
this, SLOT(provideNewRange(quint64)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool setContents(const QByteArray &contents)
|
bool setContents(const QByteArray &contents) override
|
||||||
{
|
{
|
||||||
if (!contents.isEmpty())
|
if (!contents.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
@@ -247,13 +247,13 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const
|
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override
|
||||||
{
|
{
|
||||||
Q_UNUSED(state)
|
Q_UNUSED(state)
|
||||||
return type == TypeRemoved ? BehaviorSilent : BehaviorAsk;
|
return type == TypeRemoved ? BehaviorSilent : BehaviorAsk;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool save(QString *errorString, const QString &fn, bool autoSave)
|
bool save(QString *errorString, const QString &fn, bool autoSave) override
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!autoSave, return true); // bineditor does not support autosave - it would be a bit expensive
|
QTC_ASSERT(!autoSave, return true); // bineditor does not support autosave - it would be a bit expensive
|
||||||
const FileName fileNameToUse = fn.isEmpty() ? filePath() : FileName::fromString(fn);
|
const FileName fileNameToUse = fn.isEmpty() ? filePath() : FileName::fromString(fn);
|
||||||
@@ -265,7 +265,8 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenResult open(QString *errorString, const QString &fileName, const QString &realFileName)
|
OpenResult open(QString *errorString, const QString &fileName,
|
||||||
|
const QString &realFileName) override
|
||||||
{
|
{
|
||||||
QTC_CHECK(fileName == realFileName); // The bineditor can do no autosaving
|
QTC_CHECK(fileName == realFileName); // The bineditor can do no autosaving
|
||||||
return openImpl(errorString, fileName);
|
return openImpl(errorString, fileName);
|
||||||
@@ -338,23 +339,26 @@ private slots:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
QString defaultPath() const { return QString(); }
|
QString defaultPath() const override { return QString(); }
|
||||||
|
|
||||||
QString suggestedFileName() const { return QString(); }
|
QString suggestedFileName() const override { return QString(); }
|
||||||
|
|
||||||
bool isModified() const { return isTemporary()/*e.g. memory view*/ ? false
|
bool isModified() const override
|
||||||
: m_widget->isModified(); }
|
{
|
||||||
|
return isTemporary()/*e.g. memory view*/ ? false
|
||||||
|
: m_widget->isModified();
|
||||||
|
}
|
||||||
|
|
||||||
bool isFileReadOnly() const {
|
bool isFileReadOnly() const override {
|
||||||
const FileName fn = filePath();
|
const FileName fn = filePath();
|
||||||
if (fn.isEmpty())
|
if (fn.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
return !fn.toFileInfo().isWritable();
|
return !fn.toFileInfo().isWritable();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isSaveAsAllowed() const { return true; }
|
bool isSaveAsAllowed() const override { return true; }
|
||||||
|
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) {
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override {
|
||||||
if (flag == FlagIgnore)
|
if (flag == FlagIgnore)
|
||||||
return true;
|
return true;
|
||||||
if (type == TypePermissions) {
|
if (type == TypePermissions) {
|
||||||
|
|||||||
@@ -240,8 +240,8 @@ class CMakeDocument : public TextDocument
|
|||||||
public:
|
public:
|
||||||
CMakeDocument();
|
CMakeDocument();
|
||||||
|
|
||||||
QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
CMakeDocument::CMakeDocument()
|
CMakeDocument::CMakeDocument()
|
||||||
|
|||||||
@@ -44,16 +44,16 @@ class CMakeFile : public Core::IDocument
|
|||||||
public:
|
public:
|
||||||
CMakeFile(CMakeProject *parent, const Utils::FileName &fileName);
|
CMakeFile(CMakeProject *parent, const Utils::FileName &fileName);
|
||||||
|
|
||||||
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
|
||||||
|
|
||||||
QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
|
|
||||||
bool isModified() const;
|
bool isModified() const override;
|
||||||
bool isSaveAsAllowed() const;
|
bool isSaveAsAllowed() const override;
|
||||||
|
|
||||||
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
|
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override;
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CMakeProject *m_project;
|
CMakeProject *m_project;
|
||||||
|
|||||||
@@ -116,12 +116,12 @@ private:
|
|||||||
class RestoredDocument : public IDocument
|
class RestoredDocument : public IDocument
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool save(QString *, const QString &, bool) { return false; }
|
bool save(QString *, const QString &, bool) override { return false; }
|
||||||
QString defaultPath() const { return filePath().toFileInfo().absolutePath(); }
|
QString defaultPath() const override { return filePath().toFileInfo().absolutePath(); }
|
||||||
QString suggestedFileName() const { return filePath().fileName(); }
|
QString suggestedFileName() const override { return filePath().fileName(); }
|
||||||
bool isModified() const { return false; }
|
bool isModified() const override { return false; }
|
||||||
bool isSaveAsAllowed() const { return false; }
|
bool isSaveAsAllowed() const override { return false; }
|
||||||
bool reload(QString *, ReloadFlag, ChangeType) { return true; }
|
bool reload(QString *, ReloadFlag, ChangeType) override { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
DocumentModelPrivate::DocumentModelPrivate() :
|
DocumentModelPrivate::DocumentModelPrivate() :
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
IDocument(QObject *parent = 0);
|
IDocument(QObject *parent = 0);
|
||||||
virtual ~IDocument();
|
~IDocument() override;
|
||||||
|
|
||||||
void setId(Id id);
|
void setId(Id id);
|
||||||
Id id() const;
|
Id id() const;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public:
|
|||||||
typedef Utils::TextFileFormat::ReadResult ReadResult;
|
typedef Utils::TextFileFormat::ReadResult ReadResult;
|
||||||
|
|
||||||
explicit BaseTextDocument(QObject *parent = 0);
|
explicit BaseTextDocument(QObject *parent = 0);
|
||||||
virtual ~BaseTextDocument();
|
~BaseTextDocument() override;
|
||||||
|
|
||||||
Utils::TextFileFormat format() const;
|
Utils::TextFileFormat format() const;
|
||||||
const QTextCodec *codec() const;
|
const QTextCodec *codec() const;
|
||||||
|
|||||||
@@ -120,10 +120,6 @@ CppEditorDocument::CppEditorDocument()
|
|||||||
// See also onFilePathChanged() for more initialization
|
// See also onFilePathChanged() for more initialization
|
||||||
}
|
}
|
||||||
|
|
||||||
CppEditorDocument::~CppEditorDocument()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CppEditorDocument::isObjCEnabled() const
|
bool CppEditorDocument::isObjCEnabled() const
|
||||||
{
|
{
|
||||||
return m_isObjCEnabled;
|
return m_isObjCEnabled;
|
||||||
|
|||||||
@@ -53,10 +53,9 @@ class CppEditorDocument : public TextEditor::TextDocument
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CppEditorDocument();
|
explicit CppEditorDocument();
|
||||||
~CppEditorDocument();
|
|
||||||
|
|
||||||
bool isObjCEnabled() const;
|
bool isObjCEnabled() const;
|
||||||
TextEditor::CompletionAssistProvider *completionAssistProvider() const;
|
TextEditor::CompletionAssistProvider *completionAssistProvider() const override;
|
||||||
|
|
||||||
void semanticRehighlight();
|
void semanticRehighlight();
|
||||||
CppTools::SemanticInfo recalculateSemanticInfo(); // TODO: Remove me
|
CppTools::SemanticInfo recalculateSemanticInfo(); // TODO: Remove me
|
||||||
@@ -80,7 +79,7 @@ public slots:
|
|||||||
void scheduleProcessDocument();
|
void scheduleProcessDocument();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void applyFontSettings();
|
void applyFontSettings() override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void invalidateFormatterCache();
|
void invalidateFormatterCache();
|
||||||
|
|||||||
@@ -68,16 +68,17 @@ public:
|
|||||||
void setIgnoreWhitespace(bool ignore);
|
void setIgnoreWhitespace(bool ignore);
|
||||||
bool ignoreWhitespace() const;
|
bool ignoreWhitespace() const;
|
||||||
|
|
||||||
bool setContents(const QByteArray &contents);
|
bool setContents(const QByteArray &contents) override;
|
||||||
QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
QString suggestedFileName() const Q_DECL_OVERRIDE;
|
QString suggestedFileName() const override;
|
||||||
|
|
||||||
bool isModified() const { return false; }
|
bool isModified() const override { return false; }
|
||||||
bool isSaveAsAllowed() const { return true; }
|
bool isSaveAsAllowed() const override { return true; }
|
||||||
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
|
||||||
void reload();
|
void reload();
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
|
||||||
OpenResult open(QString *errorString, const QString &fileName, const QString &realFileName);
|
OpenResult open(QString *errorString, const QString &fileName,
|
||||||
|
const QString &realFileName) override;
|
||||||
|
|
||||||
QString plainText() const;
|
QString plainText() const;
|
||||||
|
|
||||||
|
|||||||
@@ -124,16 +124,16 @@ class GenericProjectFile : public Core::IDocument
|
|||||||
public:
|
public:
|
||||||
GenericProjectFile(GenericProject *parent, QString fileName, GenericProject::RefreshOptions options);
|
GenericProjectFile(GenericProject *parent, QString fileName, GenericProject::RefreshOptions options);
|
||||||
|
|
||||||
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
|
||||||
|
|
||||||
QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
|
|
||||||
bool isModified() const;
|
bool isModified() const override;
|
||||||
bool isSaveAsAllowed() const;
|
bool isSaveAsAllowed() const override;
|
||||||
|
|
||||||
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
|
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override;
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GenericProject *m_project;
|
GenericProject *m_project;
|
||||||
|
|||||||
@@ -63,20 +63,21 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
ImageViewerFile();
|
ImageViewerFile();
|
||||||
~ImageViewerFile();
|
~ImageViewerFile() override;
|
||||||
|
|
||||||
OpenResult open(QString *errorString, const QString &fileName, const QString &realFileName);
|
OpenResult open(QString *errorString, const QString &fileName,
|
||||||
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
const QString &realFileName) override;
|
||||||
bool setContents(const QByteArray &contents);
|
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
|
||||||
|
bool setContents(const QByteArray &contents) override;
|
||||||
|
|
||||||
QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
|
|
||||||
bool isModified() const;
|
bool isModified() const override;
|
||||||
bool isSaveAsAllowed() const;
|
bool isSaveAsAllowed() const override;
|
||||||
|
|
||||||
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
|
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override;
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
|
||||||
|
|
||||||
bool isPaused() const;
|
bool isPaused() const;
|
||||||
void setPaused(bool paused);
|
void setPaused(bool paused);
|
||||||
|
|||||||
@@ -44,9 +44,6 @@ QbsProjectFile::QbsProjectFile(QbsProject *parent, QString fileName) : Core::IDo
|
|||||||
setFilePath(Utils::FileName::fromString(fileName));
|
setFilePath(Utils::FileName::fromString(fileName));
|
||||||
}
|
}
|
||||||
|
|
||||||
QbsProjectFile::~QbsProjectFile()
|
|
||||||
{ }
|
|
||||||
|
|
||||||
bool QbsProjectFile::save(QString *, const QString &, bool)
|
bool QbsProjectFile::save(QString *, const QString &, bool)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -44,19 +44,18 @@ class QbsProjectFile : public Core::IDocument
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
QbsProjectFile(QbsProject *parent, QString fileName);
|
QbsProjectFile(QbsProject *parent, QString fileName);
|
||||||
~QbsProjectFile();
|
|
||||||
|
|
||||||
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
|
||||||
bool isReadOnly() const;
|
bool isReadOnly() const;
|
||||||
|
|
||||||
QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
|
|
||||||
bool isModified() const;
|
bool isModified() const override;
|
||||||
bool isSaveAsAllowed() const;
|
bool isSaveAsAllowed() const override;
|
||||||
|
|
||||||
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
|
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override;
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QbsProject *m_project;
|
QbsProject *m_project;
|
||||||
|
|||||||
@@ -170,12 +170,12 @@ class ProFileDocument : public TextDocument
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ProFileDocument();
|
ProFileDocument();
|
||||||
QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
|
|
||||||
// qmake project files doesn't support UTF8-BOM
|
// qmake project files doesn't support UTF8-BOM
|
||||||
// If the BOM would be added qmake would fail and QtCreator couldn't parse the project file
|
// If the BOM would be added qmake would fail and QtCreator couldn't parse the project file
|
||||||
bool supportsUtf8Bom() { return false; }
|
bool supportsUtf8Bom() override { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
ProFileDocument::ProFileDocument()
|
ProFileDocument::ProFileDocument()
|
||||||
|
|||||||
@@ -234,16 +234,16 @@ class QmakePriFile : public Core::IDocument
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QmakePriFile(QmakePriFileNode *qmakePriFile);
|
QmakePriFile(QmakePriFileNode *qmakePriFile);
|
||||||
virtual bool save(QString *errorString, const QString &fileName, bool autoSave);
|
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
|
||||||
|
|
||||||
virtual QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
virtual QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
|
|
||||||
virtual bool isModified() const;
|
bool isModified() const override;
|
||||||
virtual bool isSaveAsAllowed() const;
|
bool isSaveAsAllowed() const override;
|
||||||
|
|
||||||
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
|
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override;
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QmakePriFileNode *m_priFile;
|
QmakePriFileNode *m_priFile;
|
||||||
|
|||||||
@@ -100,16 +100,16 @@ class QmakeProjectFile : public Core::IDocument
|
|||||||
public:
|
public:
|
||||||
QmakeProjectFile(const QString &filePath, QObject *parent = 0);
|
QmakeProjectFile(const QString &filePath, QObject *parent = 0);
|
||||||
|
|
||||||
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
|
||||||
|
|
||||||
QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
|
|
||||||
bool isModified() const;
|
bool isModified() const override;
|
||||||
bool isSaveAsAllowed() const;
|
bool isSaveAsAllowed() const override;
|
||||||
|
|
||||||
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
|
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override;
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Watches folders for QmakePriFile nodes
|
/// Watches folders for QmakePriFile nodes
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class QMLJSEDITOR_EXPORT QmlJSEditorDocument : public TextEditor::TextDocument
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QmlJSEditorDocument();
|
QmlJSEditorDocument();
|
||||||
~QmlJSEditorDocument();
|
~QmlJSEditorDocument() override;
|
||||||
|
|
||||||
const QmlJSTools::SemanticInfo &semanticInfo() const;
|
const QmlJSTools::SemanticInfo &semanticInfo() const;
|
||||||
bool isSemanticInfoOutdated() const;
|
bool isSemanticInfoOutdated() const;
|
||||||
@@ -63,8 +63,8 @@ signals:
|
|||||||
void semanticInfoUpdated(const QmlJSTools::SemanticInfo &semanticInfo);
|
void semanticInfoUpdated(const QmlJSTools::SemanticInfo &semanticInfo);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void applyFontSettings();
|
void applyFontSettings() override;
|
||||||
void triggerPendingUpdates();
|
void triggerPendingUpdates() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class Internal::QmlJSEditorDocumentPrivate; // sending signals
|
friend class Internal::QmlJSEditorDocumentPrivate; // sending signals
|
||||||
|
|||||||
@@ -47,10 +47,6 @@ QmlProjectFile::QmlProjectFile(QmlProject *parent, const Utils::FileName &fileNa
|
|||||||
setFilePath(fileName);
|
setFilePath(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlProjectFile::~QmlProjectFile()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool QmlProjectFile::save(QString *, const QString &, bool)
|
bool QmlProjectFile::save(QString *, const QString &, bool)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -45,18 +45,17 @@ class QmlProjectFile : public Core::IDocument
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
QmlProjectFile(QmlProject *parent, const Utils::FileName &fileName);
|
QmlProjectFile(QmlProject *parent, const Utils::FileName &fileName);
|
||||||
virtual ~QmlProjectFile();
|
|
||||||
|
|
||||||
virtual bool save(QString *errorString, const QString &fileName, bool autoSave);
|
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
|
||||||
|
|
||||||
virtual QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
virtual QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
|
|
||||||
virtual bool isModified() const;
|
bool isModified() const override;
|
||||||
virtual bool isSaveAsAllowed() const;
|
bool isSaveAsAllowed() const override;
|
||||||
|
|
||||||
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
|
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override;
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QmlProject *m_project;
|
QmlProject *m_project;
|
||||||
|
|||||||
@@ -57,17 +57,18 @@ public:
|
|||||||
ResourceEditorDocument(QObject *parent = 0);
|
ResourceEditorDocument(QObject *parent = 0);
|
||||||
|
|
||||||
//IDocument
|
//IDocument
|
||||||
OpenResult open(QString *errorString, const QString &fileName, const QString &realFileName);
|
OpenResult open(QString *errorString, const QString &fileName,
|
||||||
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
const QString &realFileName) override;
|
||||||
|
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
|
||||||
QString plainText() const;
|
QString plainText() const;
|
||||||
bool setContents(const QByteArray &contents);
|
bool setContents(const QByteArray &contents) override;
|
||||||
bool shouldAutoSave() const;
|
bool shouldAutoSave() const override;
|
||||||
bool isModified() const;
|
bool isModified() const override;
|
||||||
bool isSaveAsAllowed() const;
|
bool isSaveAsAllowed() const override;
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
|
||||||
QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
void setFilePath(const Utils::FileName &newName);
|
void setFilePath(const Utils::FileName &newName) override;
|
||||||
void setBlockDirtyChanged(bool value);
|
void setBlockDirtyChanged(bool value);
|
||||||
|
|
||||||
RelativeResourceModel *model() const;
|
RelativeResourceModel *model() const;
|
||||||
|
|||||||
@@ -113,16 +113,16 @@ class ResourceFileWatcher : public Core::IDocument
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
ResourceFileWatcher(ResourceTopLevelNode *node);
|
ResourceFileWatcher(ResourceTopLevelNode *node);
|
||||||
virtual bool save(QString *errorString, const QString &fileName, bool autoSave);
|
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
|
||||||
|
|
||||||
virtual QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
virtual QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
|
|
||||||
virtual bool isModified() const;
|
bool isModified() const override;
|
||||||
virtual bool isSaveAsAllowed() const;
|
bool isSaveAsAllowed() const override;
|
||||||
|
|
||||||
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
|
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override;
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
|
||||||
private:
|
private:
|
||||||
ResourceTopLevelNode *m_node;
|
ResourceTopLevelNode *m_node;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -46,9 +46,6 @@ TaskFile::TaskFile(QObject *parent) : Core::IDocument(parent)
|
|||||||
setId("TaskList.TaskFile");
|
setId("TaskList.TaskFile");
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskFile::~TaskFile()
|
|
||||||
{ }
|
|
||||||
|
|
||||||
bool TaskFile::save(QString *errorString, const QString &fileName, bool autoSave)
|
bool TaskFile::save(QString *errorString, const QString &fileName, bool autoSave)
|
||||||
{
|
{
|
||||||
Q_UNUSED(errorString)
|
Q_UNUSED(errorString)
|
||||||
|
|||||||
@@ -42,18 +42,17 @@ class TaskFile : public Core::IDocument
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TaskFile(QObject *parent);
|
TaskFile(QObject *parent);
|
||||||
~TaskFile();
|
|
||||||
|
|
||||||
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
|
||||||
|
|
||||||
QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
|
|
||||||
bool isModified() const;
|
bool isModified() const override;
|
||||||
bool isSaveAsAllowed() const;
|
bool isSaveAsAllowed() const override;
|
||||||
|
|
||||||
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
|
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override;
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
|
||||||
|
|
||||||
bool load(QString *errorString, const QString &fileName);
|
bool load(QString *errorString, const QString &fileName);
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class TEXTEDITOR_EXPORT TextDocument : public Core::BaseTextDocument
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TextDocument(Core::Id id = Core::Id());
|
explicit TextDocument(Core::Id id = Core::Id());
|
||||||
virtual ~TextDocument();
|
~TextDocument() override;
|
||||||
|
|
||||||
static QMap<QString, QString> openedTextDocumentContents();
|
static QMap<QString, QString> openedTextDocumentContents();
|
||||||
static QMap<QString, QTextCodec *> openedTextDocumentEncodings();
|
static QMap<QString, QTextCodec *> openedTextDocumentEncodings();
|
||||||
@@ -101,23 +101,24 @@ public:
|
|||||||
void removeMarkFromMarksCache(TextMark *mark);
|
void removeMarkFromMarksCache(TextMark *mark);
|
||||||
|
|
||||||
// IDocument implementation.
|
// IDocument implementation.
|
||||||
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
|
||||||
bool setContents(const QByteArray &contents);
|
bool setContents(const QByteArray &contents) override;
|
||||||
bool shouldAutoSave() const;
|
bool shouldAutoSave() const override;
|
||||||
bool isFileReadOnly() const;
|
bool isFileReadOnly() const override;
|
||||||
bool isModified() const;
|
bool isModified() const override;
|
||||||
bool isSaveAsAllowed() const;
|
bool isSaveAsAllowed() const override;
|
||||||
void checkPermissions();
|
void checkPermissions() override;
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
|
||||||
void setFilePath(const Utils::FileName &newName);
|
void setFilePath(const Utils::FileName &newName) override;
|
||||||
|
|
||||||
QString defaultPath() const;
|
QString defaultPath() const override;
|
||||||
QString suggestedFileName() const;
|
QString suggestedFileName() const override;
|
||||||
|
|
||||||
void setDefaultPath(const QString &defaultPath);
|
void setDefaultPath(const QString &defaultPath);
|
||||||
void setSuggestedFileName(const QString &suggestedFileName);
|
void setSuggestedFileName(const QString &suggestedFileName);
|
||||||
|
|
||||||
OpenResult open(QString *errorString, const QString &fileName, const QString &realFileName);
|
OpenResult open(QString *errorString, const QString &fileName,
|
||||||
|
const QString &realFileName) override;
|
||||||
virtual bool reload(QString *errorString);
|
virtual bool reload(QString *errorString);
|
||||||
|
|
||||||
bool setPlainText(const QString &text);
|
bool setPlainText(const QString &text);
|
||||||
|
|||||||
@@ -47,16 +47,17 @@ public:
|
|||||||
explicit SubmitEditorFile(const VcsBaseSubmitEditorParameters *parameters,
|
explicit SubmitEditorFile(const VcsBaseSubmitEditorParameters *parameters,
|
||||||
VcsBaseSubmitEditor *parent = 0);
|
VcsBaseSubmitEditor *parent = 0);
|
||||||
|
|
||||||
OpenResult open(QString *errorString, const QString &fileName, const QString &realFileName);
|
OpenResult open(QString *errorString, const QString &fileName,
|
||||||
bool setContents(const QByteArray &contents);
|
const QString &realFileName) override;
|
||||||
QString defaultPath() const { return QString(); }
|
bool setContents(const QByteArray &contents) override;
|
||||||
QString suggestedFileName() const { return QString(); }
|
QString defaultPath() const override { return QString(); }
|
||||||
|
QString suggestedFileName() const override { return QString(); }
|
||||||
|
|
||||||
bool isModified() const { return m_modified; }
|
bool isModified() const override { return m_modified; }
|
||||||
bool isSaveAsAllowed() const { return false; }
|
bool isSaveAsAllowed() const override { return false; }
|
||||||
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
|
||||||
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
|
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override;
|
||||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
|
||||||
|
|
||||||
void setModified(bool modified = true);
|
void setModified(bool modified = true);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user