set QSettings account array size when saving

This commit is contained in:
shunf4 2021-10-13 11:35:49 +08:00
parent e27ae1a82f
commit dbcc74ce09

View File

@ -71,7 +71,7 @@ void Core::Squawk::stop()
if (isInitialized) { if (isInitialized) {
QSettings settings; QSettings settings;
settings.beginGroup("core"); settings.beginGroup("core");
settings.beginWriteArray("accounts"); settings.beginWriteArray("accounts", accounts.size());
SimpleCrypt crypto(passwordHash); SimpleCrypt crypto(passwordHash);
for (std::deque<Account*>::size_type i = 0; i < accounts.size(); ++i) { for (std::deque<Account*>::size_type i = 0; i < accounts.size(); ++i) {
settings.setArrayIndex(i); settings.setArrayIndex(i);