From 201bd35c7dc588a203b8ff1dccdb6994f4a32aa1 Mon Sep 17 00:00:00 2001 From: Lu Zhen Date: Tue, 16 Jan 2024 13:27:26 +0800 Subject: [PATCH] refactor: remove unused files and class Log: Change-Id: I1810b385472c4aafafb871ecfed9900f90ca352f --- src/base/CMakeLists.txt | 14 ------ src/base/abstractaction.cpp | 7 +-- src/base/abstractcentral.cpp | 44 ----------------- src/base/abstractcentral.h | 18 ------- src/base/abstractconsole.cpp | 48 ------------------ src/base/abstractconsole.h | 18 ------- src/base/abstractedit.cpp | 10 ---- src/base/abstractedit.h | 14 ------ src/base/abstractmainwindow.cpp | 49 ------------------- src/base/abstractmainwindow.h | 27 ---------- src/base/abstractmenu.cpp | 5 +- src/base/abstractmenubar.cpp | 45 ----------------- src/base/abstractmenubar.h | 20 -------- src/base/abstractnav.cpp | 45 ----------------- src/base/abstractnav.h | 19 ------- src/base/abstractoutputpane.cpp | 15 ------ src/base/abstractoutputpane.h | 34 ------------- src/base/abstractwidget.cpp | 5 +- src/plugins/codeeditor/codeeditor.cpp | 5 +- .../mainframe/naveditmainwindow.cpp | 4 +- .../codeeditor/mainframe/naveditmainwindow.h | 5 +- src/plugins/codegeex/codegeex.cpp | 1 - src/plugins/collaborators/collaborators.cpp | 7 +-- src/plugins/core/mainframe/windowkeeper.cpp | 6 +-- src/plugins/core/mainframe/windowkeeper.h | 8 +-- src/plugins/debugger/debuggerplugin.cpp | 2 - .../debugger/interface/appoutputpane.h | 1 - src/plugins/filebrowser/filebrowser.cpp | 1 - .../javascript/debugger/jsdebugger.cpp | 6 +-- src/plugins/javascript/debugger/jsdebugger.h | 2 +- src/plugins/javascript/javascriptplugin.cpp | 1 - src/plugins/option/optioncore/optioncore.cpp | 1 - src/plugins/option/optionlsp/optionlsp.cpp | 1 - src/plugins/performance/performance.cpp | 1 - src/plugins/project/projectcore.cpp | 5 -- src/plugins/recent/recent.cpp | 3 +- src/plugins/symbol/symbol.cpp | 1 - src/services/window/windowservice.h | 19 ++----- 38 files changed, 27 insertions(+), 490 deletions(-) delete mode 100644 src/base/abstractcentral.cpp delete mode 100644 src/base/abstractcentral.h delete mode 100644 src/base/abstractconsole.cpp delete mode 100644 src/base/abstractconsole.h delete mode 100644 src/base/abstractedit.cpp delete mode 100644 src/base/abstractedit.h delete mode 100644 src/base/abstractmainwindow.cpp delete mode 100644 src/base/abstractmainwindow.h delete mode 100644 src/base/abstractmenubar.cpp delete mode 100644 src/base/abstractmenubar.h delete mode 100644 src/base/abstractnav.cpp delete mode 100644 src/base/abstractnav.h delete mode 100644 src/base/abstractoutputpane.cpp delete mode 100644 src/base/abstractoutputpane.h diff --git a/src/base/CMakeLists.txt b/src/base/CMakeLists.txt index e491afaaa..782537a8f 100644 --- a/src/base/CMakeLists.txt +++ b/src/base/CMakeLists.txt @@ -1,30 +1,16 @@ project(base) set(CXX_H - abstractcentral.h - abstractedit.h abstractmenu.h - abstractmenubar.h - abstractnav.h abstractaction.h - abstractmainwindow.h abstractwidget.h - abstractoutputpane.h - abstractconsole.h abstractdebugger.h ) set(CXX_CPP - abstractcentral.cpp - abstractedit.cpp abstractmenu.cpp - abstractmenubar.cpp - abstractnav.cpp abstractaction.cpp - abstractmainwindow.cpp abstractwidget.cpp - abstractoutputpane.cpp - abstractconsole.cpp abstractdebugger.cpp ) diff --git a/src/base/abstractaction.cpp b/src/base/abstractaction.cpp index 434a734a4..ffbc5ec25 100644 --- a/src/base/abstractaction.cpp +++ b/src/base/abstractaction.cpp @@ -16,10 +16,7 @@ class AbstractActionPrivate AbstractAction::AbstractAction(void *qAction) : d(new AbstractActionPrivate()) { - if (!qAction) { - qCritical() << "Failed, use QAction(0x0) to AbstractAction"; - abort(); - } + Q_ASSERT(qAction); d->action = static_cast(qAction); d->action->setObjectName("AbstractAction"); @@ -38,6 +35,6 @@ AbstractAction::~AbstractAction() void *AbstractAction::qAction() { - return(void*)(d->action); + return static_cast(d->action); } diff --git a/src/base/abstractcentral.cpp b/src/base/abstractcentral.cpp deleted file mode 100644 index 9173a5cc3..000000000 --- a/src/base/abstractcentral.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "abstractcentral.h" - -#include - -#include - -DWIDGET_USE_NAMESPACE - -class AbstractCentralPrivate -{ - friend class AbstractCentral; - DWidget *widget; -}; - -AbstractCentral::AbstractCentral(void *qwidget) - : d(new AbstractCentralPrivate()) -{ - if (!qwidget) { - qCritical() << "Failed, use QWidget(0x0) to AbstractCentral"; - abort(); - } - - d->widget = static_cast(qwidget); - DWidget::connect(d->widget, &DWidget::destroyed, - d->widget, [this](){ - delete this; - }, Qt::UniqueConnection); -} - -AbstractCentral::~AbstractCentral() -{ - if (d) { - delete d; - } -} - -void *AbstractCentral::qWidget() -{ - return d->widget; -} diff --git a/src/base/abstractcentral.h b/src/base/abstractcentral.h deleted file mode 100644 index c9e5c568a..000000000 --- a/src/base/abstractcentral.h +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#ifndef ABSTRACTCENTRAL_H -#define ABSTRACTCENTRAL_H - -class AbstractCentralPrivate; -class AbstractCentral -{ - AbstractCentralPrivate *const d; -public: - AbstractCentral(void *qwidget); - virtual ~AbstractCentral(); - void *qWidget(); -}; - -#endif // ABSTRACTCENTRAL_H diff --git a/src/base/abstractconsole.cpp b/src/base/abstractconsole.cpp deleted file mode 100644 index 86df4179b..000000000 --- a/src/base/abstractconsole.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "abstractconsole.h" - -#include - -#include - -DWIDGET_USE_NAMESPACE - -class AbstractConsolePrivate -{ - friend class AbstractConsole; - DWidget *qWidget = nullptr; -}; - -AbstractConsole::AbstractConsole(void *qWidget) - : d(new AbstractConsolePrivate) -{ - if (!qWidget) { - qCritical() << "Failed, use QWidget(0x0) to AbstractWidget"; - abort(); - } - - d->qWidget = static_cast(qWidget); - d->qWidget->connect(d->qWidget, &DWidget::destroyed, - d->qWidget, [this](QObject *obj){ - if (obj == d->qWidget) { - qInfo() << "AbstractConsole QWidget::destroyed" << obj; - delete this; - } - }, Qt::DirectConnection); -} - -AbstractConsole::~AbstractConsole() -{ - if (d) { - delete d; - } -} - -void *AbstractConsole::qWidget() -{ - return d->qWidget; -} - diff --git a/src/base/abstractconsole.h b/src/base/abstractconsole.h deleted file mode 100644 index c002a46c3..000000000 --- a/src/base/abstractconsole.h +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#ifndef ABSTRACTCONSOLE_H -#define ABSTRACTCONSOLE_H - -class AbstractConsolePrivate; -class AbstractConsole -{ - AbstractConsolePrivate *const d; -public: - AbstractConsole(void *qWidget); - virtual ~AbstractConsole(); - void* qWidget(); -}; - -#endif // ABSTRACTCONSOLE_H diff --git a/src/base/abstractedit.cpp b/src/base/abstractedit.cpp deleted file mode 100644 index 4e893eee5..000000000 --- a/src/base/abstractedit.cpp +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "abstractedit.h" - -AbstractEdit::AbstractEdit() -{ - -} diff --git a/src/base/abstractedit.h b/src/base/abstractedit.h deleted file mode 100644 index c610420b8..000000000 --- a/src/base/abstractedit.h +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#ifndef ABSTRACTEDIT_H -#define ABSTRACTEDIT_H - -class AbstractEdit -{ -public: - AbstractEdit(); -}; - -#endif // ABSTRACTEDIT_H diff --git a/src/base/abstractmainwindow.cpp b/src/base/abstractmainwindow.cpp deleted file mode 100644 index 91744bb8c..000000000 --- a/src/base/abstractmainwindow.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "abstractnav.h" -#include "abstractmenubar.h" -#include "abstractmainwindow.h" - -#include -#include -#include - -#include -#include - -DWIDGET_USE_NAMESPACE - -class AbstractMainWindowPrivate -{ - friend class AbstractMainWindow; - DMainWindow* mainwindow = nullptr; -}; - -AbstractMainWindow::~AbstractMainWindow() -{ - if (d) { - delete d; - } -} - -void *AbstractMainWindow::qMainWindow() -{ - return static_cast(d->mainwindow); -} - -AbstractMainWindow::AbstractMainWindow(void *qMainWindow) - : d(new AbstractMainWindowPrivate()) -{ - if (!qMainWindow) { - qCritical() << "Failed, use QMainWindow(0x0) to AbstractMainWindow"; - abort(); - } - - d->mainwindow = static_cast(qMainWindow); - DMainWindow::connect(d->mainwindow, &DMainWindow::destroyed, - d->mainwindow ,[this]() { - delete this; - }, Qt::UniqueConnection); -} diff --git a/src/base/abstractmainwindow.h b/src/base/abstractmainwindow.h deleted file mode 100644 index 6eb004278..000000000 --- a/src/base/abstractmainwindow.h +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#ifndef ABSTRACTMAINWINDOW_H -#define ABSTRACTMAINWINDOW_H - -#include -#include -class AbstractNav; -class AbstractNavAction; -class AbstractMenuBar; -class AbstractMainWindowPrivate; -namespace WindowContainer { - -} // namespace Container - -class AbstractMainWindow -{ - AbstractMainWindowPrivate *const d; -public: - explicit AbstractMainWindow(void *qMainWindow); - virtual ~AbstractMainWindow(); - void *qMainWindow(); -}; - -#endif // ABSTRACTMAINWINDOW_H diff --git a/src/base/abstractmenu.cpp b/src/base/abstractmenu.cpp index b3c05c4d7..7d344df45 100644 --- a/src/base/abstractmenu.cpp +++ b/src/base/abstractmenu.cpp @@ -19,10 +19,7 @@ class AbstractMenuPrivate AbstractMenu::AbstractMenu(void *qMenu) : d(new AbstractMenuPrivate()) { - if (!qMenu) { - qCritical() << "Failed, use QAction(0x0) to AbstractAction"; - abort(); - } + Q_ASSERT(qMenu); d->menu = static_cast(qMenu); DMenu::connect(d->menu, &DMenu::destroyed, diff --git a/src/base/abstractmenubar.cpp b/src/base/abstractmenubar.cpp deleted file mode 100644 index 90b368a2e..000000000 --- a/src/base/abstractmenubar.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "abstractmenubar.h" -#include "abstractmenu.h" -#include "abstractaction.h" - -#include -#include - -DWIDGET_USE_NAMESPACE - -class AbstractMenuBarPrivate -{ - friend class AbstractMenuBar; - DMenuBar *menuBar; -}; - -AbstractMenuBar::~AbstractMenuBar() -{ - if (d) { - delete d; - } -} - -void *AbstractMenuBar::qMenuBar() -{ - return d->menuBar; -} - -AbstractMenuBar::AbstractMenuBar(void *qMenuBar) - : d(new AbstractMenuBarPrivate()) -{ - if (!qMenuBar) { - qCritical() << "Failed, use QMenuBar(0x0) to AbstractMenuBar"; - abort(); - } - - d->menuBar = static_cast(qMenuBar); - DMenuBar::connect(d->menuBar, &DMenuBar::destroyed, - d->menuBar, [this]() { - delete this; - }, Qt::UniqueConnection); -} diff --git a/src/base/abstractmenubar.h b/src/base/abstractmenubar.h deleted file mode 100644 index fcd018d15..000000000 --- a/src/base/abstractmenubar.h +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#ifndef ABSTRACTMENUBAR_H -#define ABSTRACTMENUBAR_H - -class AbstractMenu; -class AbstractAction; -class AbstractMenuBarPrivate; -class AbstractMenuBar -{ - AbstractMenuBarPrivate *const d; -public: - explicit AbstractMenuBar(void *qMenuBar); - virtual ~AbstractMenuBar(); - void* qMenuBar(); -}; - -#endif // ABSTRACTMENUBAR_H diff --git a/src/base/abstractnav.cpp b/src/base/abstractnav.cpp deleted file mode 100644 index 9990a0ea5..000000000 --- a/src/base/abstractnav.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "abstractnav.h" -#include "abstractaction.h" - -#include -#include - -DWIDGET_USE_NAMESPACE - -class AbstractNavPrivate -{ - friend class AbstractNav; - DToolBar* qToolBar = nullptr; - std::list actions{}; -}; - -AbstractNav::~AbstractNav() -{ - if (d) { - delete d; - } -} - -void *AbstractNav::qToolbar() -{ - return d->qToolBar; -} - -AbstractNav::AbstractNav(void *qToolBar) - : d(new AbstractNavPrivate()) -{ - if (!qToolBar) { - qCritical() << "Failed, use QToolbar(0x0) to AbstractMenuBar"; - abort(); - } - - d->qToolBar = static_cast(qToolBar); - QObject::connect(d->qToolBar, &DToolBar::destroyed, - d->qToolBar, [this](){ - delete this; - }, Qt::UniqueConnection); -} diff --git a/src/base/abstractnav.h b/src/base/abstractnav.h deleted file mode 100644 index 80724501c..000000000 --- a/src/base/abstractnav.h +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#ifndef ABSTRACTNAV_H -#define ABSTRACTNAV_H - -class AbstractAction; -class AbstractNavPrivate; -class AbstractNav -{ - AbstractNavPrivate *const d; -public: - explicit AbstractNav(void *qToolBar); - virtual ~AbstractNav(); - void *qToolbar(); -}; - -#endif // ABSTRACTNAV_H diff --git a/src/base/abstractoutputpane.cpp b/src/base/abstractoutputpane.cpp deleted file mode 100644 index dbf31687c..000000000 --- a/src/base/abstractoutputpane.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "abstractoutputpane.h" - -AbstractOutputPane::AbstractOutputPane(QObject *parent) : QObject(parent) -{ - -} - -AbstractOutputPane::~AbstractOutputPane() -{ - -} diff --git a/src/base/abstractoutputpane.h b/src/base/abstractoutputpane.h deleted file mode 100644 index 93b6488b2..000000000 --- a/src/base/abstractoutputpane.h +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#ifndef ABSTRUCTOUTPUTPANE_H -#define ABSTRUCTOUTPUTPANE_H - -#include - -#include - -DWIDGET_USE_NAMESPACE - -class AbstractOutputPane : public QObject -{ - Q_OBJECT -public: - explicit AbstractOutputPane(QObject *parent = nullptr); - virtual ~AbstractOutputPane() override; - - virtual DWidget *outputWidget(QWidget *parent) = 0; - virtual void clearContents() = 0; - - virtual void setFocus() = 0; - virtual bool hasFocus() const = 0; - virtual bool canFocus() const = 0; - - virtual bool canNext() const = 0; - virtual bool canPrevious() const = 0; - virtual void goToNext() = 0; - virtual void goToPrev() = 0; -}; - -#endif // ABSTRUCTOUTPUTPANE_H diff --git a/src/base/abstractwidget.cpp b/src/base/abstractwidget.cpp index b89eba8c7..07a83a705 100644 --- a/src/base/abstractwidget.cpp +++ b/src/base/abstractwidget.cpp @@ -20,10 +20,7 @@ class AbstractWidgetPrivate AbstractWidget::AbstractWidget(void *qWidget) : d(new AbstractWidgetPrivate) { - if (!qWidget) { - qCritical() << "Failed, use QWidget(0x0) to AbstractWidget"; - abort(); - } + Q_ASSERT(qWidget); d->qWidget = static_cast(qWidget); QObject::connect(d->qWidget, &DWidget::destroyed, diff --git a/src/plugins/codeeditor/codeeditor.cpp b/src/plugins/codeeditor/codeeditor.cpp index f22b6ad77..81421da75 100644 --- a/src/plugins/codeeditor/codeeditor.cpp +++ b/src/plugins/codeeditor/codeeditor.cpp @@ -17,7 +17,6 @@ #include "base/abstractmenu.h" #include "base/abstractaction.h" -#include "base/abstractcentral.h" #include "base/abstractwidget.h" #include "services/window/windowservice.h" @@ -62,9 +61,9 @@ bool CodeEditor::start() using namespace std::placeholders; if (windowService) { NavEditMainWindow *navEditWindow = NavEditMainWindow::instance(); - navEditWindow->setWidgetEdit(new AbstractCentral(editManager)); + navEditWindow->setWidgetEdit(new AbstractWidget(editManager)); - windowService->addCentralNavigation(MWNA_EDIT, new AbstractCentral(navEditWindow)); + windowService->addCentralNavigation(MWNA_EDIT, new AbstractWidget(navEditWindow)); if (!windowService->addWidgetWorkspace) { windowService->addWidgetWorkspace = std::bind(&NavEditMainWindow::addWidgetWorkspace, navEditWindow, _1, _2, _3); diff --git a/src/plugins/codeeditor/mainframe/naveditmainwindow.cpp b/src/plugins/codeeditor/mainframe/naveditmainwindow.cpp index 11462f868..0d8dea077 100644 --- a/src/plugins/codeeditor/mainframe/naveditmainwindow.cpp +++ b/src/plugins/codeeditor/mainframe/naveditmainwindow.cpp @@ -4,8 +4,6 @@ #include "naveditmainwindow.h" #include "base/abstractwidget.h" -#include "base/abstractcentral.h" -#include "base/abstractconsole.h" #include "services/window/windowservice.h" #include "services/project/projectservice.h" #include "services/symbol/symbolservice.h" @@ -193,7 +191,7 @@ void NavEditMainWindow::switchWorkspaceArea(const QString &title) } } -DWidget *NavEditMainWindow::setWidgetEdit(AbstractCentral *edit) +DWidget *NavEditMainWindow::setWidgetEdit(AbstractWidget *edit) { DWidget *oldWidget = editWidget; editWidget = static_cast(edit->qWidget()); diff --git a/src/plugins/codeeditor/mainframe/naveditmainwindow.h b/src/plugins/codeeditor/mainframe/naveditmainwindow.h index debe9d616..4b04296a7 100644 --- a/src/plugins/codeeditor/mainframe/naveditmainwindow.h +++ b/src/plugins/codeeditor/mainframe/naveditmainwindow.h @@ -20,10 +20,7 @@ DWIDGET_USE_NAMESPACE class QGridLayout; class QTabWidget; -class AbstractCentral; class AbstractWidget; -class AbstractConsole; -class QDockWidget; class AutoHideDockWidget; class ToolBarManager; @@ -41,7 +38,7 @@ class NavEditMainWindow : public DWidget void switchWorkspaceArea(const QString &title); // return old edit widget - DWidget *setWidgetEdit(AbstractCentral *editWidget); + DWidget *setWidgetEdit(AbstractWidget *editWidget); // return old watch widget DWidget *setWidgetWatch(AbstractWidget *watchWidget); void addContextWidget(const QString &title, AbstractWidget *contextWidget, const QString &group, bool isVisibal); diff --git a/src/plugins/codegeex/codegeex.cpp b/src/plugins/codegeex/codegeex.cpp index b60cde27d..82d5a34d4 100644 --- a/src/plugins/codegeex/codegeex.cpp +++ b/src/plugins/codegeex/codegeex.cpp @@ -14,7 +14,6 @@ #include "base/abstractwidget.h" #include "base/abstractaction.h" -#include "base/abstractcentral.h" #include "base/abstractmenu.h" #include diff --git a/src/plugins/collaborators/collaborators.cpp b/src/plugins/collaborators/collaborators.cpp index cf03f96a8..c322ae035 100644 --- a/src/plugins/collaborators/collaborators.cpp +++ b/src/plugins/collaborators/collaborators.cpp @@ -6,7 +6,8 @@ #include "services/window/windowservice.h" #include "mainframe/cvskeeper.h" #include "base/abstractaction.h" -#include "base/abstractcentral.h" +#include "base/abstractwidget.h" + #include using namespace dpfservice; @@ -26,9 +27,9 @@ bool Collaborators::start() } if (windowService->addCentralNavigation) { windowService->addCentralNavigation(MWNA_GIT, - new AbstractCentral(CVSkeeper::instance()->gitMainWidget())); + new AbstractWidget(CVSkeeper::instance()->gitMainWidget())); windowService->addCentralNavigation(MWNA_SVN, - new AbstractCentral(CVSkeeper::instance()->svnMainWidget())); + new AbstractWidget(CVSkeeper::instance()->svnMainWidget())); } } return true; diff --git a/src/plugins/core/mainframe/windowkeeper.cpp b/src/plugins/core/mainframe/windowkeeper.cpp index 44478e1fb..7cd5d6b61 100644 --- a/src/plugins/core/mainframe/windowkeeper.cpp +++ b/src/plugins/core/mainframe/windowkeeper.cpp @@ -368,7 +368,7 @@ void WindowKeeper::addNavigation(const QString &navName, const QString &iconName createNavIconBtn(navName, iconName); } -void WindowKeeper::addCentralNavigation(const QString &navName, AbstractCentral *central) +void WindowKeeper::addCentralNavigation(const QString &navName, AbstractWidget *central) { qInfo() << __FUNCTION__; DWidget *inputWidget = static_cast(central->qWidget()); @@ -393,9 +393,9 @@ void WindowKeeper::addCentralNavigation(const QString &navName, AbstractCentral d->centrals.insert(navName, inputWidget); } -AbstractCentral *WindowKeeper::getCentralNavigation(const QString &navName) +AbstractWidget *WindowKeeper::getCentralNavigation(const QString &navName) { - return new AbstractCentral(d->centrals.value(navName)); + return new AbstractWidget(d->centrals.value(navName)); } void WindowKeeper::addMenu(AbstractMenu *menu) diff --git a/src/plugins/core/mainframe/windowkeeper.h b/src/plugins/core/mainframe/windowkeeper.h index de390ccef..5e597743e 100644 --- a/src/plugins/core/mainframe/windowkeeper.h +++ b/src/plugins/core/mainframe/windowkeeper.h @@ -5,12 +5,8 @@ #ifndef WINDOWKEEPER_H #define WINDOWKEEPER_H -#include "base/abstractnav.h" #include "base/abstractaction.h" #include "base/abstractmenu.h" -#include "base/abstractmenubar.h" -#include "base/abstractmainwindow.h" -#include "base/abstractcentral.h" #include "base/abstractwidget.h" #include @@ -49,8 +45,8 @@ class WindowKeeper final :public QObject public slots: void addNavigation(const QString &navName, const QString &iconName); - void addCentralNavigation(const QString &navName, AbstractCentral *central); - AbstractCentral *getCentralNavigation(const QString &navName); + void addCentralNavigation(const QString &navName, AbstractWidget *central); + AbstractWidget *getCentralNavigation(const QString &navName); void switchWidgetNavigation(const QString &navName); void addMenu(AbstractMenu *menu); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index da4e26da6..f4b2a297d 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -9,10 +9,8 @@ #include "services/window/windowservice.h" #include "services/debugger/debuggerservice.h" -#include "base/abstractnav.h" #include "base/abstractaction.h" #include "base/abstractmenu.h" -#include "base/abstractmainwindow.h" #include "base/abstractwidget.h" #include diff --git a/src/plugins/debugger/interface/appoutputpane.h b/src/plugins/debugger/interface/appoutputpane.h index 74cdf1b6e..79b1db900 100644 --- a/src/plugins/debugger/interface/appoutputpane.h +++ b/src/plugins/debugger/interface/appoutputpane.h @@ -5,7 +5,6 @@ #ifndef APPOUTPUTPANE_H #define APPOUTPUTPANE_H -#include "base/abstractoutputpane.h" #include "debuggerglobals.h" #include diff --git a/src/plugins/filebrowser/filebrowser.cpp b/src/plugins/filebrowser/filebrowser.cpp index d3a3979e8..7d12da94a 100644 --- a/src/plugins/filebrowser/filebrowser.cpp +++ b/src/plugins/filebrowser/filebrowser.cpp @@ -5,7 +5,6 @@ #include "filebrowser.h" #include "mainframe/treeviewkeeper.h" #include "base/abstractaction.h" -#include "base/abstractcentral.h" #include "base/abstractwidget.h" #include "services/window/windowservice.h" diff --git a/src/plugins/javascript/debugger/jsdebugger.cpp b/src/plugins/javascript/debugger/jsdebugger.cpp index a429eab70..1ae5823cb 100644 --- a/src/plugins/javascript/debugger/jsdebugger.cpp +++ b/src/plugins/javascript/debugger/jsdebugger.cpp @@ -6,7 +6,6 @@ #include "services/window/windowservice.h" #include "services/project/projectservice.h" -#include "base/abstractcentral.h" #include "base/abstractwidget.h" #include @@ -138,6 +137,7 @@ void JSDebugger::runCommand(QScriptEngineDebugger::DebuggerAction command) QWidget *JSDebugger::debuggerWidget(QScriptEngineDebugger::DebuggerWidget widget) const { // return debugger.widget(widget); + Q_UNUSED(widget) return {}; } @@ -159,7 +159,7 @@ QScriptValue JSDebugger::evaluateFile(QScriptEngine &engine, const QString &file void JSDebugger::addPagesToContext(const QScriptEngineDebugger &debugger) { - codeEditor = new AbstractCentral(debugger.widget(QScriptEngineDebugger::CodeWidget)); + codeEditor = new AbstractWidget(debugger.widget(QScriptEngineDebugger::CodeWidget)); stackPane = new AbstractWidget(debugger.widget(QScriptEngineDebugger::StackWidget)); breakpointsPane = new AbstractWidget(debugger.widget(QScriptEngineDebugger::BreakpointsWidget)); scriptPane = new AbstractWidget(debugger.widget(QScriptEngineDebugger::ScriptsWidget)); @@ -189,7 +189,7 @@ void JSDebugger::removePagesFromContext() removePage(scriptPane); removePage(errorPane); - windowService->setWidgetEdit(new AbstractCentral(oldWidgetEdit)); + windowService->setWidgetEdit(new AbstractWidget(oldWidgetEdit)); windowService->setWidgetWatch(new AbstractWidget(oldWidgetWatch)); } diff --git a/src/plugins/javascript/debugger/jsdebugger.h b/src/plugins/javascript/debugger/jsdebugger.h index c626034df..317277227 100644 --- a/src/plugins/javascript/debugger/jsdebugger.h +++ b/src/plugins/javascript/debugger/jsdebugger.h @@ -67,7 +67,7 @@ public slots: AbstractWidget *scriptPane = nullptr; AbstractWidget *errorPane = nullptr; AbstractWidget *localsPane = nullptr; - AbstractCentral *codeEditor = nullptr; + AbstractWidget *codeEditor = nullptr; }; #endif // JSDebugger_H diff --git a/src/plugins/javascript/javascriptplugin.cpp b/src/plugins/javascript/javascriptplugin.cpp index b59e51f11..90b5607cc 100644 --- a/src/plugins/javascript/javascriptplugin.cpp +++ b/src/plugins/javascript/javascriptplugin.cpp @@ -11,7 +11,6 @@ #include "services/window/windowservice.h" #include "services/debugger/debuggerservice.h" #include "base/abstractwidget.h" -#include "base/abstractcentral.h" #include "debugger/jsdebugger.h" #include diff --git a/src/plugins/option/optioncore/optioncore.cpp b/src/plugins/option/optioncore/optioncore.cpp index 2a700f0af..312a7ee01 100644 --- a/src/plugins/option/optioncore/optioncore.cpp +++ b/src/plugins/option/optioncore/optioncore.cpp @@ -12,7 +12,6 @@ #include "common/common.h" #include "base/abstractwidget.h" #include "base/abstractaction.h" -#include "base/abstractcentral.h" #include "services/window/windowservice.h" #include "services/project/projectservice.h" #include "services/option/optionservice.h" diff --git a/src/plugins/option/optionlsp/optionlsp.cpp b/src/plugins/option/optionlsp/optionlsp.cpp index 650ee14e5..e80ecdef0 100644 --- a/src/plugins/option/optionlsp/optionlsp.cpp +++ b/src/plugins/option/optionlsp/optionlsp.cpp @@ -6,7 +6,6 @@ #include "mainframe/optionlspgenerator.h" #include "base/abstractmenu.h" -#include "base/abstractmainwindow.h" #include "base/abstractwidget.h" #include "services/option/optionservice.h" diff --git a/src/plugins/performance/performance.cpp b/src/plugins/performance/performance.cpp index d2f181cc8..c716807fc 100644 --- a/src/plugins/performance/performance.cpp +++ b/src/plugins/performance/performance.cpp @@ -6,7 +6,6 @@ #include "performance.h" #include "base/abstractmenu.h" #include "base/abstractaction.h" -#include "base/abstractcentral.h" #include "base/abstractwidget.h" #include "services/window/windowservice.h" diff --git a/src/plugins/project/projectcore.cpp b/src/plugins/project/projectcore.cpp index 2bdc1ed4a..2d868d6fc 100644 --- a/src/plugins/project/projectcore.cpp +++ b/src/plugins/project/projectcore.cpp @@ -9,7 +9,6 @@ #include "common/common.h" #include "base/abstractmenu.h" #include "base/abstractaction.h" -#include "base/abstractcentral.h" #include "base/abstractwidget.h" #include "services/window/windowservice.h" #include "services/project/projectservice.h" @@ -44,10 +43,6 @@ bool ProjectCore::start() } } - if (windowService && windowService->addCentralNavigation) { - //windowService->addCentralNavigation(MWNA_RUNTIME, new AbstractCentral(RuntimeManager::instance()->getRuntimeWidget())); - } - QObject::connect(&dpf::Listener::instance(), &dpf::Listener::pluginsStarted, this, &ProjectCore::pluginsStartedMain, Qt::DirectConnection); diff --git a/src/plugins/recent/recent.cpp b/src/plugins/recent/recent.cpp index b0201b8e4..bdbf5ad00 100644 --- a/src/plugins/recent/recent.cpp +++ b/src/plugins/recent/recent.cpp @@ -5,7 +5,6 @@ #include "recent.h" #include "base/abstractmenu.h" #include "base/abstractaction.h" -#include "base/abstractcentral.h" #include "base/abstractwidget.h" #include "services/window/windowservice.h" #include "mainframe/recentdisplay.h" @@ -32,7 +31,7 @@ bool Recent::start() RecentDisplay::instance(), &RecentDisplay::addProject); QObject::connect(RecentProxy::instance(), &RecentProxy::saveOpenedFile, RecentDisplay::instance(), &RecentDisplay::addDocument); - auto recentWidgetImpl = new AbstractCentral(RecentDisplay::instance()); + auto recentWidgetImpl = new AbstractWidget(RecentDisplay::instance()); if (windowService->addCentralNavigation) { windowService->addCentralNavigation(MWNA_RECENT, recentWidgetImpl); } diff --git a/src/plugins/symbol/symbol.cpp b/src/plugins/symbol/symbol.cpp index 4b4660b82..aeeec7af8 100644 --- a/src/plugins/symbol/symbol.cpp +++ b/src/plugins/symbol/symbol.cpp @@ -8,7 +8,6 @@ #include "common/common.h" #include "base/abstractmenu.h" #include "base/abstractaction.h" -#include "base/abstractcentral.h" #include "base/abstractwidget.h" #include "services/window/windowservice.h" #include "services/symbol/symbolservice.h" diff --git a/src/services/window/windowservice.h b/src/services/window/windowservice.h index 34040d283..62d53b5c5 100644 --- a/src/services/window/windowservice.h +++ b/src/services/window/windowservice.h @@ -14,9 +14,7 @@ class Core; class AbstractAction; class AbstractMenu; -class AbstractCentral; class AbstractWidget; -class AbstractConsole; namespace dpfservice { // service interface @@ -75,30 +73,23 @@ class WindowService final : public dpf::PluginService, dpf::AutoServiceRegister< * \param name 导航栏名称,从AbstractAction获取 * \param central 添加的居中组件实例对象 */ - DPF_INTERFACE(void, addCentralNavigation, const QString &name, AbstractCentral *central); + DPF_INTERFACE(void, addCentralNavigation, const QString &name, AbstractWidget *central); /*! * \brief addWidgetWorkspace 左侧工作空间组件,可以是文件树,工程管理等 - * \param title 设置 + * \param AbstractWidget 控件 * \param widget 设置的编辑器文件树实例对象 */ DPF_INTERFACE(void, addWidgetWorkspace, const QString &title, AbstractWidget *widget, const QString &iconName); - /*! - * \brief setWidgetConsole 设置默认终端 - * \param console 实例对象 - */ - DPF_INTERFACE(void, setWidgetConsole, AbstractConsole *console); - /** * @brief DPF_INTERFACE * @param widget */ - DPF_INTERFACE(QWidget*, setWidgetEdit, AbstractCentral *widget); + DPF_INTERFACE(QWidget*, setWidgetEdit, AbstractWidget *widget); /*! - * \brief addContextWidget 添加交互组件 - * \param contextTab Tab名称 + * \brief addContextWidget 添加交AbstractWidgetam contextTab Tab名称 * \param contextWidget 实例对象 */ DPF_INTERFACE(void, addContextWidget, const QString &contextTab, AbstractWidget *contextWidget, const QString &group, bool isVisible); @@ -163,7 +154,7 @@ class WindowService final : public dpf::PluginService, dpf::AutoServiceRegister< DPF_INTERFACE(void, addTopToolBar, const QString &name, QAction *action, const QString &group, bool isSeparat); - DPF_INTERFACE(AbstractCentral *, getCentralNavigation, const QString &navName); + DPF_INTERFACE(AbstractWidget *, getCentralNavigation, const QString &navName); DPF_INTERFACE(void, addWorkspaceArea, const QString &title, AbstractWidget *widget);