forked from qt-creator/qt-creator
Android: Don't override IContext::widget() unnecessarily
Gets in the way of simplifying IContext handling. Change-Id: I30961202164062743d9b9ddad34f95b25360f395 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -44,9 +44,9 @@ QWidget *AndroidManifestEditor::toolBar()
|
|||||||
return m_toolBar;
|
return m_toolBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidManifestEditorWidget *AndroidManifestEditor::widget() const
|
AndroidManifestEditorWidget *AndroidManifestEditor::ownWidget() const
|
||||||
{
|
{
|
||||||
return static_cast<AndroidManifestEditorWidget *>(Core::IEditor::widget());
|
return static_cast<AndroidManifestEditorWidget *>(widget());
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::IDocument *AndroidManifestEditor::document() const
|
Core::IDocument *AndroidManifestEditor::document() const
|
||||||
@@ -56,7 +56,7 @@ Core::IDocument *AndroidManifestEditor::document() const
|
|||||||
|
|
||||||
TextEditor::TextEditorWidget *AndroidManifestEditor::textEditor() const
|
TextEditor::TextEditorWidget *AndroidManifestEditor::textEditor() const
|
||||||
{
|
{
|
||||||
return widget()->textEditorWidget();
|
return ownWidget()->textEditorWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
int AndroidManifestEditor::currentLine() const
|
int AndroidManifestEditor::currentLine() const
|
||||||
@@ -77,10 +77,10 @@ void AndroidManifestEditor::gotoLine(int line, int column, bool centerLine)
|
|||||||
|
|
||||||
void AndroidManifestEditor::changeEditorPage(QAction *action)
|
void AndroidManifestEditor::changeEditorPage(QAction *action)
|
||||||
{
|
{
|
||||||
if (!widget()->setActivePage(static_cast<AndroidManifestEditorWidget::EditorPage>(action->data().toInt()))) {
|
if (!ownWidget()->setActivePage(static_cast<AndroidManifestEditorWidget::EditorPage>(action->data().toInt()))) {
|
||||||
const QList<QAction *> actions = m_actionGroup->actions();
|
const QList<QAction *> actions = m_actionGroup->actions();
|
||||||
for (QAction *action : actions) {
|
for (QAction *action : actions) {
|
||||||
if (action->data().toInt() == widget()->activePage()) {
|
if (action->data().toInt() == ownWidget()->activePage()) {
|
||||||
action->setChecked(true);
|
action->setChecked(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ public:
|
|||||||
explicit AndroidManifestEditor(AndroidManifestEditorWidget *editorWidget);
|
explicit AndroidManifestEditor(AndroidManifestEditorWidget *editorWidget);
|
||||||
|
|
||||||
QWidget *toolBar() override;
|
QWidget *toolBar() override;
|
||||||
AndroidManifestEditorWidget *widget() const override;
|
|
||||||
Core::IDocument *document() const override;
|
Core::IDocument *document() const override;
|
||||||
TextEditor::TextEditorWidget *textEditor() const;
|
TextEditor::TextEditorWidget *textEditor() const;
|
||||||
|
|
||||||
@@ -34,6 +33,7 @@ public:
|
|||||||
void gotoLine(int line, int column = 0, bool centerLine = true) override;
|
void gotoLine(int line, int column = 0, bool centerLine = true) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
AndroidManifestEditorWidget *ownWidget() const;
|
||||||
void changeEditorPage(QAction *action);
|
void changeEditorPage(QAction *action);
|
||||||
|
|
||||||
QString m_displayName;
|
QString m_displayName;
|
||||||
|
|||||||
Reference in New Issue
Block a user