Commit 4ae7d5cd authored by Eike Ziller's avatar Eike Ziller

Manifest, pro file and CMake editor can have fixed mime type set

Can be set directly from the document constructor, no need to do that
later.

Change-Id: I4326757e1b1cb1e48c157c4b330ccb2abb8f3b1f
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent c72546fb
...@@ -44,6 +44,7 @@ AndroidManifestDocument::AndroidManifestDocument(AndroidManifestEditorWidget *ed ...@@ -44,6 +44,7 @@ AndroidManifestDocument::AndroidManifestDocument(AndroidManifestEditorWidget *ed
: TextEditor::BaseTextDocument(), : TextEditor::BaseTextDocument(),
m_editorWidget(editorWidget) m_editorWidget(editorWidget)
{ {
setMimeType(QLatin1String(Constants::ANDROID_MANIFEST_MIME_TYPE));
} }
bool AndroidManifestDocument::save(QString *errorString, const QString &fileName, bool autoSave) bool AndroidManifestDocument::save(QString *errorString, const QString &fileName, bool autoSave)
......
...@@ -102,9 +102,7 @@ AndroidManifestEditorWidget::AndroidManifestEditorWidget(QWidget *parent) ...@@ -102,9 +102,7 @@ AndroidManifestEditorWidget::AndroidManifestEditorWidget(QWidget *parent)
m_setAppName(false), m_setAppName(false),
m_appNameInStringsXml(false) m_appNameInStringsXml(false)
{ {
QSharedPointer<AndroidManifestDocument> doc(new AndroidManifestDocument(this)); setBaseTextDocument(QSharedPointer<AndroidManifestDocument>(new AndroidManifestDocument(this)));
doc->setMimeType(QLatin1String(Constants::ANDROID_MANIFEST_MIME_TYPE));
setBaseTextDocument(doc);
configure(QLatin1String(Constants::ANDROID_MANIFEST_MIME_TYPE)); configure(QLatin1String(Constants::ANDROID_MANIFEST_MIME_TYPE));
......
...@@ -118,9 +118,7 @@ void CMakeEditor::build() ...@@ -118,9 +118,7 @@ void CMakeEditor::build()
CMakeEditorWidget::CMakeEditorWidget(QWidget *parent) CMakeEditorWidget::CMakeEditorWidget(QWidget *parent)
: BaseTextEditorWidget(parent) : BaseTextEditorWidget(parent)
{ {
QSharedPointer<CMakeDocument> doc(new CMakeDocument); setBaseTextDocument(QSharedPointer<CMakeDocument>(new CMakeDocument));
doc->setMimeType(QLatin1String(CMakeProjectManager::Constants::CMAKEMIMETYPE));
setBaseTextDocument(doc);
baseTextDocument()->setSyntaxHighlighter(new CMakeHighlighter); baseTextDocument()->setSyntaxHighlighter(new CMakeHighlighter);
...@@ -227,6 +225,7 @@ CMakeEditorWidget::Link CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, ...@@ -227,6 +225,7 @@ CMakeEditorWidget::Link CMakeEditorWidget::findLinkAt(const QTextCursor &cursor,
CMakeDocument::CMakeDocument() CMakeDocument::CMakeDocument()
: TextEditor::BaseTextDocument() : TextEditor::BaseTextDocument()
{ {
setMimeType(QLatin1String(CMakeProjectManager::Constants::CMAKEMIMETYPE));
} }
QString CMakeDocument::defaultPath() const QString CMakeDocument::defaultPath() const
......
...@@ -86,7 +86,6 @@ ProFileEditorWidget::ProFileEditorWidget(ProFileEditorFactory *factory, QWidget ...@@ -86,7 +86,6 @@ ProFileEditorWidget::ProFileEditorWidget(ProFileEditorFactory *factory, QWidget
: BaseTextEditorWidget(parent), m_factory(factory) : BaseTextEditorWidget(parent), m_factory(factory)
{ {
QSharedPointer<ProFileDocument> doc(new ProFileDocument()); QSharedPointer<ProFileDocument> doc(new ProFileDocument());
doc->setMimeType(QLatin1String(Constants::PROFILE_MIMETYPE));
setBaseTextDocument(doc); setBaseTextDocument(doc);
baseTextDocument()->setSyntaxHighlighter(new ProFileHighlighter); baseTextDocument()->setSyntaxHighlighter(new ProFileHighlighter);
...@@ -204,6 +203,7 @@ void ProFileEditorWidget::contextMenuEvent(QContextMenuEvent *e) ...@@ -204,6 +203,7 @@ void ProFileEditorWidget::contextMenuEvent(QContextMenuEvent *e)
ProFileDocument::ProFileDocument() ProFileDocument::ProFileDocument()
: TextEditor::BaseTextDocument() : TextEditor::BaseTextDocument()
{ {
setMimeType(QLatin1String(Constants::PROFILE_MIMETYPE));
} }
QString ProFileDocument::defaultPath() const QString ProFileDocument::defaultPath() const
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment