MCPcopy Create free account
hub / github.com/KDE/labplot / scanDims

Method scanDims

src/backend/datasources/filters/NetCDFFilter.cpp:473–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

471}
472
473void NetCDFFilterPrivate::scanDims(int ncid, int ndims, QTreeWidgetItem* parentItem) {
474 int ulid;
475 m_status = nc_inq_unlimdim(ncid, &ulid);
476 handleError(m_status, QStringLiteral("nc_inq_att"));
477
478 char name[NC_MAX_NAME + 1];
479 size_t len;
480 for (int i = 0; i < ndims; i++) {
481 m_status = nc_inq_dim(ncid, i, name, &len);
482 handleError(m_status, QStringLiteral("nc_inq_att"));
483 DEBUG(" dim" << i + 1 << ": name/len =" << name << len);
484
485 QStringList props;
486 props << i18n("length") << QLatin1String(" = ") << QString::number(len);
487 QString value;
488 if (i == ulid)
489 value = i18n("unlimited");
490 auto* attrItem = new QTreeWidgetItem(QStringList() << QLatin1String(name) << i18n("dimension") << props.join(QString()) << value);
491 attrItem->setIcon(0, QIcon::fromTheme(QStringLiteral("accessories-calculator")));
492 attrItem->setFlags(Qt::ItemIsEnabled);
493 parentItem->addChild(attrItem);
494 }
495}
496
497void NetCDFFilterPrivate::scanVars(int ncid, int nvars, QTreeWidgetItem* parentItem) {
498 char name[NC_MAX_NAME + 1];

Callers

nothing calls this directly

Calls 3

QStringClass · 0.70
setIconMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected