Commit f9ce335a authored by Eike Ziller's avatar Eike Ziller
Browse files

Editors: Remove useless parent widget argument from create/duplicate



It was never called with a sensible value anyhow, and only complicates things.

Change-Id: I005848700b6c00114d91495670d4a0e15a2d2e64
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 236ea9ef
......@@ -49,9 +49,9 @@ AndroidManifestEditorFactory::AndroidManifestEditorFactory(QObject *parent)
new TextEditor::TextEditorActionHandler(this, Constants::ANDROID_MANIFEST_EDITOR_CONTEXT);
}
Core::IEditor *AndroidManifestEditorFactory::createEditor(QWidget *parent)
Core::IEditor *AndroidManifestEditorFactory::createEditor()
{
AndroidManifestEditorWidget *editor = new AndroidManifestEditorWidget(parent);
AndroidManifestEditorWidget *editor = new AndroidManifestEditorWidget();
TextEditor::TextEditorSettings::initializeEditor(editor);
return editor->editor();
}
......@@ -42,7 +42,7 @@ class AndroidManifestEditorFactory : public Core::IEditorFactory
public:
explicit AndroidManifestEditorFactory(QObject *parent = 0);
Core::IEditor *createEditor(QWidget *parent);
Core::IEditor *createEditor();
};
} // namespace Internal
......
......@@ -84,7 +84,7 @@ public:
Source
};
explicit AndroidManifestEditorWidget(QWidget *parent);
explicit AndroidManifestEditorWidget(QWidget *parent = 0);
bool open(QString *errorString, const QString &fileName, const QString &realFileName);
......
......@@ -409,9 +409,9 @@ BinEditorFactory::BinEditorFactory(BinEditorPlugin *owner) :
addMimeType(Constants::C_BINEDITOR_MIMETYPE);
}
Core::IEditor *BinEditorFactory::createEditor(QWidget *parent)
Core::IEditor *BinEditorFactory::createEditor()
{
BinEditorWidget *widget = new BinEditorWidget(parent);
BinEditorWidget *widget = new BinEditorWidget();
BinEditor *editor = new BinEditor(widget);
m_owner->initializeEditor(widget);
......
......@@ -102,7 +102,7 @@ class BinEditorFactory : public Core::IEditorFactory
public:
explicit BinEditorFactory(BinEditorPlugin *owner);
Core::IEditor *createEditor(QWidget *parent);
Core::IEditor *createEditor();
private:
BinEditorPlugin *m_owner;
......
......@@ -65,10 +65,10 @@ CMakeEditor::CMakeEditor(CMakeEditorWidget *editor)
connect(document(), SIGNAL(changed()), this, SLOT(markAsChanged()));
}
Core::IEditor *CMakeEditor::duplicate(QWidget *parent)
Core::IEditor *CMakeEditor::duplicate()
{
CMakeEditorWidget *w = qobject_cast<CMakeEditorWidget*>(widget());
CMakeEditorWidget *ret = new CMakeEditorWidget(parent, w->factory());
CMakeEditorWidget *ret = new CMakeEditorWidget(w->factory());
ret->duplicateFrom(w);
TextEditor::TextEditorSettings::initializeEditor(ret);
return ret->editor();
......@@ -116,7 +116,7 @@ void CMakeEditor::build()
// CMakeEditor
//
CMakeEditorWidget::CMakeEditorWidget(QWidget *parent, CMakeEditorFactory *factory)
CMakeEditorWidget::CMakeEditorWidget(CMakeEditorFactory *factory, QWidget *parent)
: BaseTextEditorWidget(parent), m_factory(factory)
{
QSharedPointer<CMakeDocument> doc(new CMakeDocument);
......
......@@ -57,7 +57,7 @@ public:
CMakeEditor(CMakeEditorWidget *);
bool duplicateSupported() const { return true; }
Core::IEditor *duplicate(QWidget *parent);
Core::IEditor *duplicate();
Core::Id id() const;
TextEditor::CompletionAssistProvider *completionAssistProvider();
......@@ -71,7 +71,7 @@ class CMakeEditorWidget : public TextEditor::BaseTextEditorWidget
Q_OBJECT
public:
CMakeEditorWidget(QWidget *parent, CMakeEditorFactory *factory);
CMakeEditorWidget(CMakeEditorFactory *factory, QWidget *parent = 0);
bool save(const QString &fileName = QString());
......
......@@ -69,9 +69,9 @@ CMakeEditorFactory::CMakeEditorFactory(CMakeManager *manager)
contextMenu->addAction(cmd);
}
Core::IEditor *CMakeEditorFactory::createEditor(QWidget *parent)
Core::IEditor *CMakeEditorFactory::createEditor()
{
CMakeEditorWidget *rc = new CMakeEditorWidget(parent, this);
CMakeEditorWidget *rc = new CMakeEditorWidget(this);
TextEditor::TextEditorSettings::initializeEditor(rc);
return rc->editor();
}
......@@ -43,7 +43,7 @@ class CMakeEditorFactory : public Core::IEditorFactory
public:
CMakeEditorFactory(CMakeManager *parent);
Core::IEditor *createEditor(QWidget *parent);
Core::IEditor *createEditor();
private:
const QStringList m_mimeTypes;
......
......@@ -1416,7 +1416,7 @@ IEditor *EditorManager::createEditor(const Id &editorId, const QString &fileName
return 0;
}
IEditor *editor = factories.front()->createEditor(m_instance);
IEditor *editor = factories.front()->createEditor();
if (editor)
connect(editor->document(), SIGNAL(changed()), m_instance, SLOT(handleDocumentStateChange()));
if (editor)
......@@ -2410,7 +2410,7 @@ Core::IEditor *EditorManager::duplicateEditor(Core::IEditor *editor)
if (!editor->duplicateSupported())
return 0;
IEditor *duplicate = editor->duplicate(0);
IEditor *duplicate = editor->duplicate();
duplicate->restoreState(editor->saveState());
emit m_instance->editorCreated(duplicate, duplicate->document()->filePath());
addEditor(duplicate);
......
......@@ -52,7 +52,7 @@ public:
virtual Core::Id id() const = 0;
virtual bool duplicateSupported() const { return false; }
virtual IEditor *duplicate(QWidget * /*parent*/) { return 0; }
virtual IEditor *duplicate() { return 0; }
virtual QByteArray saveState() const { return QByteArray(); }
virtual bool restoreState(const QByteArray &/*state*/) { return true; }
......
......@@ -43,7 +43,7 @@ class CORE_EXPORT IEditorFactory : public Core::IDocumentFactory
public:
IEditorFactory(QObject *parent = 0) : IDocumentFactory(parent) {}
virtual IEditor *createEditor(QWidget *parent) = 0;
virtual IEditor *createEditor() = 0;
virtual IDocument *open(const QString &);
};
......
......@@ -1499,9 +1499,9 @@ void CPPEditorWidget::keyPressEvent(QKeyEvent *e)
finishRename();
}
Core::IEditor *CPPEditor::duplicate(QWidget *parent)
Core::IEditor *CPPEditor::duplicate()
{
CPPEditorWidget *newEditor = new CPPEditorWidget(parent);
CPPEditorWidget *newEditor = new CPPEditorWidget();
newEditor->duplicateFrom(editorWidget());
// A new QTextDocument was set, so update our signal/slot connection to the new document
newEditor->updateContentsChangedSignal();
......
......@@ -78,7 +78,7 @@ public:
CPPEditor(CPPEditorWidget *);
bool duplicateSupported() const { return true; }
Core::IEditor *duplicate(QWidget *parent);
Core::IEditor *duplicate();
Core::Id id() const;
bool open(QString *errorString, const QString &fileName, const QString &realFileName);
......@@ -97,7 +97,7 @@ class CPPEditorWidget : public TextEditor::BaseTextEditorWidget
public:
typedef TextEditor::TabSettings TabSettings;
CPPEditorWidget(QWidget *parent);
CPPEditorWidget(QWidget *parent = 0);
~CPPEditorWidget();
void unCommentSelection();
......
......@@ -93,9 +93,9 @@ CppEditorFactory::CppEditorFactory(CppEditorPlugin *owner) :
}
}
IEditor *CppEditorFactory::createEditor(QWidget *parent)
IEditor *CppEditorFactory::createEditor()
{
CPPEditorWidget *editor = new CPPEditorWidget(parent);
CPPEditorWidget *editor = new CPPEditorWidget();
editor->setRevisionsVisible(true);
m_owner->initializeEditor(editor);
return editor->editor();
......
......@@ -255,7 +255,7 @@ class CppEditorFactory : public Core::IEditorFactory
public:
CppEditorFactory(CppEditorPlugin *owner);
Core::IEditor *createEditor(QWidget *parent);
Core::IEditor *createEditor();
private:
CppEditorPlugin *m_owner;
......
......@@ -57,9 +57,9 @@ FormEditorFactory::FormEditorFactory()
Core::FileIconProvider::registerIconOverlayForSuffix(":/formeditor/images/qt_ui.png", "ui");
}
Core::IEditor *FormEditorFactory::createEditor(QWidget *parent)
Core::IEditor *FormEditorFactory::createEditor()
{
const EditorData data = FormEditorW::instance()->createEditor(parent);
const EditorData data = FormEditorW::instance()->createEditor();
if (data.formWindowEditor) {
Core::InfoBarEntry info(Core::Id(Constants::INFO_READ_ONLY),
tr("This file can only be edited in <b>Design</b> mode."));
......
......@@ -42,7 +42,7 @@ class FormEditorFactory : public Core::IEditorFactory
public:
FormEditorFactory();
Core::IEditor *createEditor(QWidget *parent);
Core::IEditor *createEditor();
private slots:
void designerModeClicked();
......
......@@ -113,7 +113,7 @@ public:
// Deletes an existing instance if there is one.
static void deleteInstance();
EditorData createEditor(QWidget *parent);
EditorData createEditor(QWidget *parent = 0);
inline QDesignerFormEditorInterface *designerEditor() const { return m_formeditor; }
inline QWidget * const*designerSubWindows() const { return m_designerSubWindows; }
......
......@@ -46,9 +46,9 @@ DiffEditorFactory::DiffEditorFactory(QObject *parent)
addMimeType(QLatin1String(Constants::DIFF_EDITOR_MIMETYPE));
}
Core::IEditor *DiffEditorFactory::createEditor(QWidget *parent)
Core::IEditor *DiffEditorFactory::createEditor()
{
DiffEditorWidget *editorWidget = new DiffEditorWidget(parent);
DiffEditorWidget *editorWidget = new DiffEditorWidget();
DiffEditor *editor = new DiffEditor(editorWidget);
return editor;
}
......
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