close on reject, fold onClose into its only remaining usage in closeEvent

wilder-5.14
Aaron Seigo 12 years ago
parent 9938831f18
commit 1c7e0dbcde
  1. 16
      components/interactiveconsole/interactiveconsole.cpp
  2. 1
      components/interactiveconsole/interactiveconsole.h

@ -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)

@ -105,7 +105,6 @@ private Q_SLOTS:
void modeSelectionChanged();
private:
void onClose();
void saveScript(const QUrl &url);
ShellCorona *m_corona;

Loading…
Cancel
Save