diff --git a/components/interactiveconsole/interactiveconsole.cpp b/components/interactiveconsole/interactiveconsole.cpp index 81a08e848..b63df9c95 100644 --- a/components/interactiveconsole/interactiveconsole.cpp +++ b/components/interactiveconsole/interactiveconsole.cpp @@ -284,23 +284,17 @@ void InteractiveConsole::showEvent(QShowEvent *) void InteractiveConsole::closeEvent(QCloseEvent *event) { - onClose(); + // need to save first! + const QString path = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/" + s_autosaveFileName; + m_closeWhenCompleted = true; + saveScript(QUrl::fromLocalFile(path)); QDialog::closeEvent(event); } void InteractiveConsole::reject() { - onClose(); QDialog::reject(); -} - -void InteractiveConsole::onClose() -{ - // need to save first! - const QString path = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/" + s_autosaveFileName; - m_closeWhenCompleted = true; - saveScript(QUrl::fromLocalFile(path)); - emit visibilityChanged(); + close(); } void InteractiveConsole::print(const QString &string) diff --git a/components/interactiveconsole/interactiveconsole.h b/components/interactiveconsole/interactiveconsole.h index 853da7b99..6b4b0f37f 100644 --- a/components/interactiveconsole/interactiveconsole.h +++ b/components/interactiveconsole/interactiveconsole.h @@ -105,7 +105,6 @@ private Q_SLOTS: void modeSelectionChanged(); private: - void onClose(); void saveScript(const QUrl &url); ShellCorona *m_corona;