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:
parent
2f1bf10780
commit
5046fc9010
|
@ -217,7 +217,7 @@ IProfileInfo::SaveResult ProfileInfo::exportProfile(const QString &path) const
|
||||||
QVector<QString> ProfileInfo::removeProfile()
|
QVector<QString> ProfileInfo::removeProfile()
|
||||||
{
|
{
|
||||||
QVector<QString> manualDeleteFiles = profile->remove();
|
QVector<QString> manualDeleteFiles = profile->remove();
|
||||||
Nexus::getInstance().showLoginLater();
|
QMetaObject::invokeMethod(&Nexus::getInstance(), "showLogin", Qt::BlockingQueuedConnection);
|
||||||
return manualDeleteFiles;
|
return manualDeleteFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ QVector<QString> ProfileInfo::removeProfile()
|
||||||
void ProfileInfo::logout()
|
void ProfileInfo::logout()
|
||||||
{
|
{
|
||||||
Settings::getInstance().saveGlobal();
|
Settings::getInstance().saveGlobal();
|
||||||
Nexus::getInstance().showLoginLater();
|
QMetaObject::invokeMethod(&Nexus::getInstance(), "showLogin", Qt::BlockingQueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -338,15 +338,6 @@ bool Nexus::tryRemoveFile(const QString& filepath)
|
||||||
return writable;
|
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()
|
void Nexus::onLastWindowClosed()
|
||||||
{
|
{
|
||||||
if (quitOnLastWindowClosed)
|
if (quitOnLastWindowClosed)
|
||||||
|
|
|
@ -57,7 +57,6 @@ public:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void showLogin();
|
void showLogin();
|
||||||
void showLoginLater();
|
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user