2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Save info members list state to memento.

This commit is contained in:
John Preston
2017-10-24 20:11:35 +03:00
parent fb46c33d7f
commit b51f865c54
29 changed files with 875 additions and 220 deletions

View File

@@ -289,17 +289,17 @@ CountrySelectBox::Inner::Inner(QWidget *parent) : TWidget(parent)
countriesAll.push_back(ins);
}
QStringList namesList = QString::fromUtf8(ins->name).toLower().split(QRegularExpression("[\\s\\-]"), QString::SkipEmptyParts);
CountryNames &names(countriesNames[i]);
auto namesList = QString::fromUtf8(ins->name).toLower().split(QRegularExpression("[\\s\\-]"), QString::SkipEmptyParts);
auto &names = countriesNames[i];
int l = namesList.size();
names.resize(0);
names.reserve(l);
for (int j = 0, l = namesList.size(); j < l; ++j) {
QString name = namesList[j].trimmed();
auto name = namesList[j].trimmed();
if (!name.length()) continue;
QChar ch = name[0];
CountriesIds &v(countriesByLetter[ch]);
auto ch = name[0];
auto &v = countriesByLetter[ch];
if (v.isEmpty() || v.back() != i) {
v.push_back(i);
}