mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge pull request #4677
anthony.bilinski (1): fix(logout): Synchronously call showLogin to avoid multiple deletion
This commit is contained in:
commit
4af90a7f97
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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)
|
||||
|
@ -57,7 +57,6 @@ public:
|
||||
|
||||
public slots:
|
||||
void showLogin();
|
||||
void showLoginLater();
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user