| 471 | } |
| 472 | |
| 473 | void 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 | |
| 497 | void NetCDFFilterPrivate::scanVars(int ncid, int nvars, QTreeWidgetItem* parentItem) { |
| 498 | char name[NC_MAX_NAME + 1]; |