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) 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); QDialog::closeEvent(event);
} }
void InteractiveConsole::reject() void InteractiveConsole::reject()
{ {
onClose();
QDialog::reject(); QDialog::reject();
} close();
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();
} }
void InteractiveConsole::print(const QString &string) void InteractiveConsole::print(const QString &string)

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

Loading…
Cancel
Save