git-svn-id: svn://db.shs.com.ru/libs@625 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-11-05 13:00:29 +00:00
parent 15f1045580
commit 5e2b563d57
18 changed files with 94 additions and 62 deletions

View File

@@ -410,7 +410,12 @@ QPIConfig::Entry & QPIConfig::addEntry(const QString & name, const QString & val
tn += delim + i;
}
QPIConfig::Branch ch = entry->_children;
qSort(ch.begin(), ch.end(), QPIConfig::Entry::compare);
#if QT_VERSION < QT_VERSION_CHECK(5,13,0)
qSort
#else
std::sort
#endif
(ch.begin(), ch.end(), QPIConfig::Entry::compare);
te = (entry->isLeaf() ? 0 : ch.back());
ce = new Entry();
ce->delim = delim;
@@ -423,7 +428,12 @@ QPIConfig::Entry & QPIConfig::addEntry(const QString & name, const QString & val
if (toRoot) ce->_line = other.size();
else {
ch = entry->_parent->_children;
qSort(ch.begin(), ch.end(), QPIConfig::Entry::compare);
#if QT_VERSION < QT_VERSION_CHECK(5,13,0)
qSort
#else
std::sort
#endif
(ch.begin(), ch.end(), QPIConfig::Entry::compare);
ce->_line = ch.back()->_line + 1;
}
} else {
@@ -473,6 +483,19 @@ void QPIConfig::setValue(const QString & name, const QString & value, const QStr
}
QPIConfig::Branch QPIConfig::allLeaves() {
Branch b;
allLeaves(b, &root);
#if QT_VERSION < QT_VERSION_CHECK(5,13,0)
qSort
#else
std::sort
#endif
(b.begin(), b.end(), Entry::compare);
return b;
}
int QPIConfig::entryIndex(const QString & name) {
QStringList tree = name.split(delim);
Entry * ce = &root;