Centralize a PluginManager::isShuttingDown() status

Instead of keeping track of this in plugins individually.

Change-Id: Ia2650f0f647d4a63d2010cef688aa56f6020c338
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Eike Ziller
2023-05-22 13:21:57 +02:00
parent 323c58fd20
commit ee6789c523
14 changed files with 29 additions and 43 deletions

View File

@@ -686,7 +686,6 @@ public:
EngineManager m_engineManager;
QTimer m_shutdownTimer;
bool m_shuttingDown = false;
Console m_console; // ensure Debugger Console is created before settings are taken into account
DebuggerSettings m_debuggerSettings;
@@ -1392,7 +1391,7 @@ static QVariant configValue(const QString &name)
void DebuggerPluginPrivate::updatePresetState()
{
if (m_shuttingDown)
if (PluginManager::isShuttingDown())
return;
Project *startupProject = ProjectManager::startupProject();
@@ -1996,8 +1995,6 @@ void DebuggerPluginPrivate::dumpLog()
void DebuggerPluginPrivate::aboutToShutdown()
{
m_shuttingDown = true;
disconnect(ProjectManager::instance(), &ProjectManager::startupProjectChanged, this, nullptr);
m_shutdownTimer.setInterval(0);
@@ -2081,7 +2078,7 @@ QWidget *addSearch(BaseTreeView *treeView)
void openTextEditor(const QString &titlePattern0, const QString &contents)
{
if (dd->m_shuttingDown)
if (PluginManager::isShuttingDown())
return;
QString titlePattern = titlePattern0;
IEditor *editor = EditorManager::openEditorWithContents(