Skip to content

Commit

Permalink
Revise: remove code that calls TMainConsole::close() redundantly
Browse files Browse the repository at this point in the history
Also prune an unused setter for `(bool) Host::mIsClosingDown`.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
  • Loading branch information
SlySven committed Apr 13, 2024
1 parent a8fb993 commit 793323f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
12 changes: 3 additions & 9 deletions src/Host.cpp
Expand Up @@ -495,14 +495,8 @@ void Host::forceClose()
// Ensure the above is displayed before proceeding...
qApp->processEvents();

// Because we have set the mForcedClose flag above this WILL succeed - but
// whilst debugging lets confirm this - it does the profile and map saving:
bool closeResult = mpConsole->close();

// Get rid of any dialogs we might have open:
closeChildren();

Q_ASSERT_X(closeResult, "Host::forceClose()", "TMainConsole::forceClose() call did not succeed!");
// Because we have set the mForcedClose flag above a requestClose()
// afterwards WILL succeed
}

// Returns true if we are closing down
Expand Down Expand Up @@ -535,7 +529,7 @@ bool Host::requestClose()

void Host::closeChildren()
{
closingDown();
mIsClosingDown = true;
std::list<QPointer<TToolBar>> const hostToolBarMap = getActionUnit()->getToolBarList();
// disconnect before removing objects from memory as sysDisconnectionEvent needs that stuff.
if (mSslTsl) {
Expand Down
6 changes: 2 additions & 4 deletions src/Host.h
Expand Up @@ -212,12 +212,10 @@ class Host : public QObject
bool getLargeAreaExitArrows() const { return mLargeAreaExitArrows; }
void setLargeAreaExitArrows(const bool);

void closingDown() { mIsClosingDown = true; }
bool isClosingDown() const { return mIsClosingDown; }
bool requestClose();
void forceClose();
bool isClosingDown() const { return mIsClosingDown; }
bool isClosingForced() const { return mForcedClose; }

bool requestClose();

unsigned int assemblePath();
bool checkForMappingScript();
Expand Down

0 comments on commit 793323f

Please sign in to comment.