summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeandro Melo <leandro.melo@nokia.com>2010-09-07 15:06:54 +0200
committerLeandro Melo <leandro.melo@nokia.com>2010-09-08 16:39:26 +0200
commitf7532a02d080c37a27488a4b5ed28d455063701a (patch)
treee2e458c078888dd446aa42f337d4c599a1d8d887
parent1a08caf77f9933daf628e3616f83b09b7f80b096 (diff)
downloadqt-creator-f7532a02d080c37a27488a4b5ed28d455063701a.tar.gz
Do not force a specific editor for a file created from a wizard.
The wizards already provide a default suffix for file creation. But since the user is still free to specify something else it's better to leave it to Creator to decide which one is the proper editor. After all, this reflects how the file will be treated by Creator (including the next time it's opened). Task-number: QTCREATORBUG-2006
-rw-r--r--src/plugins/cppeditor/cppclasswizard.cpp3
-rw-r--r--src/plugins/cppeditor/cppfilewizard.cpp1
-rw-r--r--src/plugins/designer/cpp/formclasswizard.cpp3
-rw-r--r--src/plugins/designer/formwizard.cpp1
-rw-r--r--src/plugins/qmljseditor/qmlfilewizard.cpp1
-rw-r--r--src/plugins/resourceeditor/resourcewizard.cpp1
-rw-r--r--src/plugins/texteditor/texteditorplugin.cpp1
-rw-r--r--src/plugins/texteditor/textfilewizard.cpp3
-rw-r--r--src/plugins/texteditor/textfilewizard.h2
9 files changed, 0 insertions, 16 deletions
diff --git a/src/plugins/cppeditor/cppclasswizard.cpp b/src/plugins/cppeditor/cppclasswizard.cpp
index 6c841fcd68..7843dc97fd 100644
--- a/src/plugins/cppeditor/cppclasswizard.cpp
+++ b/src/plugins/cppeditor/cppclasswizard.cpp
@@ -199,10 +199,7 @@ Core::GeneratedFiles CppClassWizard::generateFiles(const QWizard *w, QString *er
const QString headerFileName = Core::BaseFileWizard::buildFileName(params.path, params.headerFile, headerSuffix());
Core::GeneratedFile sourceFile(sourceFileName);
- sourceFile.setEditorId(QLatin1String(Constants::CPPEDITOR_ID));
-
Core::GeneratedFile headerFile(headerFileName);
- headerFile.setEditorId(QLatin1String(Constants::CPPEDITOR_ID));
QString header, source;
if (!generateHeaderAndSource(params, &header, &source)) {
diff --git a/src/plugins/cppeditor/cppfilewizard.cpp b/src/plugins/cppeditor/cppfilewizard.cpp
index 2a0cf9b2dd..cd4d6f9e86 100644
--- a/src/plugins/cppeditor/cppfilewizard.cpp
+++ b/src/plugins/cppeditor/cppfilewizard.cpp
@@ -60,7 +60,6 @@ Core::GeneratedFiles CppFileWizard::generateFilesFromPath(const QString &path,
const QString fileName = Core::BaseFileWizard::buildFileName(path, name, preferredSuffix(mimeType));
Core::GeneratedFile file(fileName);
- file.setEditorId(QLatin1String(Constants::CPPEDITOR_ID));
file.setContents(fileContents(m_type, fileName));
file.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
return Core::GeneratedFiles() << file;
diff --git a/src/plugins/designer/cpp/formclasswizard.cpp b/src/plugins/designer/cpp/formclasswizard.cpp
index 7a174ce5bb..0b7006173d 100644
--- a/src/plugins/designer/cpp/formclasswizard.cpp
+++ b/src/plugins/designer/cpp/formclasswizard.cpp
@@ -87,18 +87,15 @@ Core::GeneratedFiles FormClassWizard::generateFiles(const QWizard *w, QString *e
const QString sourceFileName = buildFileName(params.path(), params.sourceFile(), sourceSuffix());
Core::GeneratedFile headerFile(headerFileName);
- headerFile.setEditorId(QLatin1String(CppEditor::Constants::CPPEDITOR_ID));
headerFile.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
// Source
Core::GeneratedFile sourceFile(sourceFileName);
- sourceFile.setEditorId(QLatin1String(CppEditor::Constants::CPPEDITOR_ID));
sourceFile.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
// UI
Core::GeneratedFile uiFile(formFileName);
uiFile.setContents(params.uiTemplate());
- uiFile.setEditorId(QLatin1String(Constants::DESIGNER_XML_EDITOR_ID));
uiFile.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
QString source, header;
diff --git a/src/plugins/designer/formwizard.cpp b/src/plugins/designer/formwizard.cpp
index 30702087c7..b2cec30198 100644
--- a/src/plugins/designer/formwizard.cpp
+++ b/src/plugins/designer/formwizard.cpp
@@ -66,7 +66,6 @@ Core::GeneratedFiles FormWizard::generateFiles(const QWizard *w,
Core::GeneratedFile file(fileName);
file.setContents(formTemplate);
- file.setEditorId(QLatin1String(Constants::DESIGNER_XML_EDITOR_ID));
file.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
return Core::GeneratedFiles() << file;
}
diff --git a/src/plugins/qmljseditor/qmlfilewizard.cpp b/src/plugins/qmljseditor/qmlfilewizard.cpp
index 1d09447b35..3687f5ef3b 100644
--- a/src/plugins/qmljseditor/qmlfilewizard.cpp
+++ b/src/plugins/qmljseditor/qmlfilewizard.cpp
@@ -50,7 +50,6 @@ Core::GeneratedFiles QmlFileWizard::generateFilesFromPath(const QString &path,
const QString fileName = Core::BaseFileWizard::buildFileName(path, name, preferredSuffix(mimeType));
Core::GeneratedFile file(fileName);
- file.setEditorId(QLatin1String(Constants::C_QMLJSEDITOR_ID));
file.setContents(fileContents(fileName));
file.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
return Core::GeneratedFiles() << file;
diff --git a/src/plugins/resourceeditor/resourcewizard.cpp b/src/plugins/resourceeditor/resourcewizard.cpp
index ce454a36db..31da9eccc1 100644
--- a/src/plugins/resourceeditor/resourcewizard.cpp
+++ b/src/plugins/resourceeditor/resourcewizard.cpp
@@ -49,7 +49,6 @@ ResourceWizard::generateFilesFromPath(const QString &path,
const QString fileName = Core::BaseFileWizard::buildFileName(path, name, suffix);
Core::GeneratedFile file(fileName);
file.setContents(QLatin1String("<RCC/>"));
- file.setEditorId(QLatin1String(Constants::RESOURCEEDITOR_ID));
file.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
return Core::GeneratedFiles() << file;
}
diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp
index 3c68486cac..eb70d842da 100644
--- a/src/plugins/texteditor/texteditorplugin.cpp
+++ b/src/plugins/texteditor/texteditorplugin.cpp
@@ -98,7 +98,6 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
wizardParameters.setCategory(QLatin1String("U.General"));
wizardParameters.setDisplayCategory(tr("General"));
m_wizard = new TextFileWizard(QLatin1String(TextEditor::Constants::C_TEXTEDITOR_MIMETYPE_TEXT),
- QLatin1String(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID),
QLatin1String("text$"),
wizardParameters);
// Add text file wizard
diff --git a/src/plugins/texteditor/textfilewizard.cpp b/src/plugins/texteditor/textfilewizard.cpp
index f7f8875e8b..e475de4d91 100644
--- a/src/plugins/texteditor/textfilewizard.cpp
+++ b/src/plugins/texteditor/textfilewizard.cpp
@@ -35,13 +35,11 @@
using namespace TextEditor;
TextFileWizard::TextFileWizard(const QString &mimeType,
- const QString &editorId,
const QString &suggestedFileName,
const BaseFileWizardParameters &parameters,
QObject *parent) :
Core::StandardFileWizard(parameters, parent),
m_mimeType(mimeType),
- m_editorId(editorId),
m_suggestedFileName(suggestedFileName)
{
}
@@ -53,7 +51,6 @@ Core::GeneratedFiles
const QString suffix = preferredSuffix(m_mimeType);
const QString fileName = Core::BaseFileWizard::buildFileName(path, name, suffix);
Core::GeneratedFile file(fileName);
- file.setEditorId(m_editorId);
file.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
return Core::GeneratedFiles() << file;
}
diff --git a/src/plugins/texteditor/textfilewizard.h b/src/plugins/texteditor/textfilewizard.h
index a956770871..9b0203e56a 100644
--- a/src/plugins/texteditor/textfilewizard.h
+++ b/src/plugins/texteditor/textfilewizard.h
@@ -43,7 +43,6 @@ class TEXTEDITOR_EXPORT TextFileWizard : public Core::StandardFileWizard
public:
typedef Core::BaseFileWizardParameters BaseFileWizardParameters;
TextFileWizard(const QString &mimeType,
- const QString &editorId,
const QString &suggestedFileName,
const BaseFileWizardParameters &parameters,
QObject *parent = 0);
@@ -54,7 +53,6 @@ protected:
QString *errorMessage) const;
private:
const QString m_mimeType;
- const QString m_editorId;
const QString m_suggestedFileName;
};