1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(logout): Synchronously call showLogin to avoid multiple deletion

Fixes #4201
This commit is contained in:
anthony.bilinski 2017-10-13 15:56:56 -07:00
parent 2f1bf10780
commit 5046fc9010
3 changed files with 2 additions and 12 deletions

View File

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

View File

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

View File

@ -57,7 +57,6 @@ public:
public slots:
void showLogin();
void showLoginLater();
#ifdef Q_OS_MAC
public: