git-svn-id: svn://db.shs.com.ru/libs@625 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user