forked from qt-creator/qt-creator
VCS: Fix possible crash on shutdown
Similar to how it is done for the WindowTitleAdditionHandler and SessionTitleHandler. Fixes: QTCREATORBUG-27048 Change-Id: Ic8c140b99c7c6edbc43bed5f1b9275b4af5ce831 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -197,6 +197,7 @@ class StateListener : public QObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit StateListener(QObject *parent);
|
explicit StateListener(QObject *parent);
|
||||||
|
~StateListener();
|
||||||
|
|
||||||
static QString windowTitleVcsTopic(const QString &filePath);
|
static QString windowTitleVcsTopic(const QString &filePath);
|
||||||
|
|
||||||
@@ -221,10 +222,14 @@ StateListener::StateListener(QObject *parent) : QObject(parent)
|
|||||||
connect(SessionManager::instance(), &SessionManager::startupProjectChanged,
|
connect(SessionManager::instance(), &SessionManager::startupProjectChanged,
|
||||||
this, &StateListener::slotStateChanged);
|
this, &StateListener::slotStateChanged);
|
||||||
|
|
||||||
|
|
||||||
EditorManager::setWindowTitleVcsTopicHandler(&StateListener::windowTitleVcsTopic);
|
EditorManager::setWindowTitleVcsTopicHandler(&StateListener::windowTitleVcsTopic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StateListener::~StateListener()
|
||||||
|
{
|
||||||
|
EditorManager::setWindowTitleVcsTopicHandler({});
|
||||||
|
}
|
||||||
|
|
||||||
QString StateListener::windowTitleVcsTopic(const QString &filePath)
|
QString StateListener::windowTitleVcsTopic(const QString &filePath)
|
||||||
{
|
{
|
||||||
FilePath searchPath;
|
FilePath searchPath;
|
||||||
|
Reference in New Issue
Block a user