X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/856716e8b6a1de36e85764f25be09f8d49f52d3e..cebcf8db:/src/panels/terminal/terminalpanel.cpp diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp index 04b5b6849..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,9 +47,11 @@ TerminalPanel::TerminalPanel(QWidget *parent) TerminalPanel::~TerminalPanel() { - // 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); + 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() @@ -68,6 +70,7 @@ bool TerminalPanel::currentWorkingDirectoryIsChildOf(const QString &path) const void TerminalPanel::terminalExited() { m_terminal = nullptr; + m_konsolePart = nullptr; Q_EMIT hideTerminalPanel(); } @@ -182,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)) {