new pip
This commit is contained in:
@@ -356,9 +356,9 @@ int CDSection::sectionsCount() const {
|
||||
|
||||
PIStringList CDSection::index_names() const {
|
||||
PIStringList ret;
|
||||
PIMap<int, CDType>::const_iterator i;
|
||||
for (i = cd.begin(); i != cd.end(); ++i)
|
||||
ret << i->second.name();
|
||||
auto i = cd.makeIterator();
|
||||
while (i.next())
|
||||
ret << i.value().name();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -387,15 +387,14 @@ CDType & CDSection::getByName(const PIString & name_) {
|
||||
int dv = 0;
|
||||
if (isd) dv = np[i].toInt();
|
||||
ns = 0;
|
||||
PIMap<int, CDSection>::iterator it;
|
||||
//piCout << np[i] << isd << dv;
|
||||
for (it = cs->s.begin(); it != cs->s.end(); ++it) {
|
||||
auto it = cs->s.makeIterator();
|
||||
while (it.next()) {
|
||||
bool f = false;
|
||||
if (isd) f = (dv == it.key());
|
||||
else f = (np[i] == it.value().alias);
|
||||
//piCout << "s..." << it.key() << it.value().alias << f;
|
||||
if (f) {
|
||||
ns = &(it.value());
|
||||
ns = &(it.valueRef());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -403,13 +402,13 @@ CDType & CDSection::getByName(const PIString & name_) {
|
||||
if (!ns) return null;
|
||||
cs = ns;
|
||||
}
|
||||
PIMap<int, CDType>::iterator it;
|
||||
if (np.back().isEmpty()) return null;
|
||||
bool isd = np.back()[0].isDigit() || (np.back()[0] == '-');
|
||||
int dv = 0;
|
||||
if (isd) dv = np.back().toInt();
|
||||
//piCout << np.back() << isd << dv;
|
||||
for (it = cs->cd.begin(); it != cs->cd.end(); ++it) {
|
||||
auto it = cs->cd.makeIterator();
|
||||
while (it.next()) {
|
||||
bool f = false;
|
||||
if (isd) f = (dv == it.key());
|
||||
else f = (np.back() == it.value().name());
|
||||
@@ -446,9 +445,9 @@ void CDSection::write(PIIODevice * d, const PIString & prefix) {
|
||||
d->write(l.toUTF8());
|
||||
l = "alias = " + alias + " \n";
|
||||
d->write(l.toUTF8());
|
||||
PIMap<int, CDType>::iterator i;
|
||||
for (i = cd.begin(); i != cd.end(); ++i) {
|
||||
CDType & ck(i.value());
|
||||
auto i = cd.makeIterator();
|
||||
while (i.next()) {
|
||||
const CDType & ck(i.value());
|
||||
if (ck.cd_type() != cd_type_) continue;
|
||||
switch (cd_type_) {
|
||||
case CDType::cdNull: break;
|
||||
@@ -487,9 +486,9 @@ void CDSection::write(PIIODevice * d, const PIString & prefix) {
|
||||
if (!s.isEmpty()) {
|
||||
if (prefix.isEmpty()) l = "s";
|
||||
else l = prefix + ".s";
|
||||
PIMap<int, CDSection>::iterator j;
|
||||
for (j = s.begin(); j != s.end(); ++j) {
|
||||
j.value().write(d, l + "." + PIString::fromNumber(j.key()));
|
||||
auto j = s.makeIterator();
|
||||
while (j.next()) {
|
||||
j.valueRef().write(d, l + "." + PIString::fromNumber(j.key()));
|
||||
}
|
||||
}
|
||||
if (prefix.isEmpty()) {
|
||||
|
||||
2
pip
2
pip
Submodule pip updated: 1fb5356825...427e7411c1
@@ -394,15 +394,15 @@ void CDItemModel::rebuildModel() {
|
||||
|
||||
void CDItemModel::buildItem(CDItem * it, CDSection & r) {
|
||||
//piCout << "build item" << r.name << r.alias;
|
||||
PIMap<int, CDType>::iterator i;
|
||||
for (i = r.cd.begin(); i != r.cd.end(); ++i) {
|
||||
auto i = r.cd.makeIterator();
|
||||
while (i.next()) {
|
||||
it->childs << new CDItem(interface, i.key(), CDItem::ItemCDType, it);
|
||||
}
|
||||
it->item_count = it->childs.size();
|
||||
PIMap<int, CDSection>::iterator j;
|
||||
for (j = r.s.begin(); j != r.s.end(); ++j) {
|
||||
auto j = r.s.makeIterator();
|
||||
while (j.next()) {
|
||||
it->childs << new CDItem(interface, j.key(), CDItem::ItemCDSection, it);
|
||||
buildItem(it->childs.back(), j.value());
|
||||
buildItem(it->childs.back(), j.valueRef());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user