X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/64e40c1d934247fc9e1c2fa00761b2cb8d70a146..cebcf8db:/src/panels/terminal/terminalpanel.cpp diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp index 30c9e8409..e9184e738 100644 --- a/src/panels/terminal/terminalpanel.cpp +++ b/src/panels/terminal/terminalpanel.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include #include @@ -47,6 +47,11 @@ TerminalPanel::TerminalPanel(QWidget *parent) TerminalPanel::~TerminalPanel() { + if (m_konsolePart) { + // Avoid when QObject cleanup, which comes after our destructor, deletes the konsolePart + // and subsequently calls back into our slot when the destructor has already run. + disconnect(m_konsolePart, &KParts::ReadOnlyPart::destroyed, this, &TerminalPanel::terminalExited); + } } void TerminalPanel::goHome() @@ -65,6 +70,7 @@ bool TerminalPanel::currentWorkingDirectoryIsChildOf(const QString &path) const void TerminalPanel::terminalExited() { m_terminal = nullptr; + m_konsolePart = nullptr; Q_EMIT hideTerminalPanel(); } @@ -179,6 +185,7 @@ void TerminalPanel::showEvent(QShowEvent *event) "Terminal cannot be shown because Konsole is not installed. " "Please install it and then reopen the panel."); m_konsolePartMissingMessage = new KMessageWidget(konsoleNotInstalledText, this); + m_konsolePartMissingMessage->setPosition(KMessageWidget::Footer); m_konsolePartMissingMessage->setCloseButtonVisible(false); m_konsolePartMissingMessage->hide(); if (KIO::DesktopExecParser::hasSchemeHandler(konsoleInstallUrl)) {