fixed clearing of PGP passphrase after creation of default identity

This commit is contained in:
csoler 2017-07-29 22:37:14 +02:00
parent 6f7e656d6c
commit 345f24eb5f
5 changed files with 13 additions and 5 deletions

View File

@ -587,8 +587,6 @@ void GenCertDialog::genPerson()
std::cout << "RsAccounts::GenerateSSLCertificate" << std::endl;
bool okGen = RsAccounts::GenerateSSLCertificate(PGPId, "", genLoc, "", isHiddenLoc, sslPasswd, sslId, err);
rsNotify->clearPgpPassphrase() ;
if (okGen)
{
/* complete the process */

View File

@ -117,8 +117,6 @@ void StartDialog::loadPerson()
bool res = Rshare::loadCertificate(accountId, ui.autologin_checkbox->isChecked()) ;
rsNotify->clearPgpPassphrase();
if(res)
accept();
}

View File

@ -785,6 +785,13 @@ void NotifyQt::notifyListPreChange(int list, int /*type*/)
* uses Flags, to detect changes
*/
void NotifyQt::resetCachedPassphrases()
{
std::cerr << "Clearing PGP passphrase." << std::endl;
rsNotify->clearPgpPassphrase() ;
}
void NotifyQt::enable()
{
QMutexLocker m(&_mutex) ;

View File

@ -155,6 +155,7 @@ class NotifyQt: public QObject, public NotifyClient
public slots:
void UpdateGUI(); /* called by timer */
void SetDisableAll(bool bValue);
void resetCachedPassphrases() ;
private slots:
void runningTick();

View File

@ -397,7 +397,6 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
uint32_t token = 0;
rsIdentity->createIdentity(token, params);
}
// I'm using a signal to transfer the hashing info to the mainwindow, because Qt schedules signals properly to
// avoid clashes between infos from threads.
//
@ -443,6 +442,11 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
WebuiPage::checkStartWebui();
#endif // ENABLE_WEBUI
// This is done using a timer, because the passphrase request from notify is asynchrouneous and therefore clearing the
// passphrase here makes it request for a passphrase when creating the default chat identity.
QTimer::singleShot(10000, Qt::CoarseTimer, notify, SLOT(resetCachedPassphrases())) ;
/* dive into the endless loop */
int ti = rshare.exec();
delete w ;