Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(logout): Synchronously call showLogin to avoid multiple deletion
Browse files Browse the repository at this point in the history
Fixes #4201
  • Loading branch information
anthonybilinski committed Oct 20, 2017
1 parent 2f1bf10 commit 5046fc9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/model/profile/profileinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ IProfileInfo::SaveResult ProfileInfo::exportProfile(const QString &path) const
QVector<QString> ProfileInfo::removeProfile()
{
QVector<QString> manualDeleteFiles = profile->remove();
Nexus::getInstance().showLoginLater();
QMetaObject::invokeMethod(&Nexus::getInstance(), "showLogin", Qt::BlockingQueuedConnection);
return manualDeleteFiles;
}

Expand All @@ -227,7 +227,7 @@ QVector<QString> ProfileInfo::removeProfile()
void ProfileInfo::logout()
{
Settings::getInstance().saveGlobal();
Nexus::getInstance().showLoginLater();
QMetaObject::invokeMethod(&Nexus::getInstance(), "showLogin", Qt::BlockingQueuedConnection);
}

/**
Expand Down
9 changes: 0 additions & 9 deletions src/nexus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,6 @@ bool Nexus::tryRemoveFile(const QString& filepath)
return writable;
}

/**
* @brief Calls showLogin asynchronously, so we can safely logout from within the main GUI
*/
void Nexus::showLoginLater()
{
GUI::setEnabled(false);
QMetaObject::invokeMethod(&getInstance(), "showLogin", Qt::QueuedConnection);
}

void Nexus::onLastWindowClosed()
{
if (quitOnLastWindowClosed)
Expand Down
1 change: 0 additions & 1 deletion src/nexus.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class Nexus : public QObject

public slots:
void showLogin();
void showLoginLater();

#ifdef Q_OS_MAC
public:
Expand Down

0 comments on commit 5046fc9

Please sign in to comment.