Changeset View
Changeset View
Standalone View
Standalone View
src/kdefrontend/datasources/FITSOptionsWidget.cpp
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 54 | QString FITSOptionsWidget::currentExtensionName() { | |||
---|---|---|---|---|---|
55 | QString name; | 55 | QString name; | ||
56 | 56 | | |||
57 | if (ui.twExtensions->currentItem() != nullptr && ui.twExtensions->currentItem()->text(0) != i18n("Primary header")) | 57 | if (ui.twExtensions->currentItem() != nullptr && ui.twExtensions->currentItem()->text(0) != i18n("Primary header")) | ||
58 | name = ui.twExtensions->currentItem()->text(ui.twExtensions->currentColumn()); | 58 | name = ui.twExtensions->currentItem()->text(ui.twExtensions->currentColumn()); | ||
59 | 59 | | |||
60 | return name; | 60 | return name; | ||
61 | } | 61 | } | ||
62 | 62 | | |||
63 | void FITSOptionsWidget::updateContent(FITSFilter *filter, const QString& fileName) { | 63 | void FITSOptionsWidget::updateContent(FITSFilter* filter, const QString& fileName) { | ||
64 | DEBUG("FITSOptionsWidget::updateContent() file name = " << fileName.toStdString()); | 64 | DEBUG("FITSOptionsWidget::updateContent() file name = " << fileName.toStdString()); | ||
65 | ui.twExtensions->clear(); | 65 | ui.twExtensions->clear(); | ||
66 | filter->parseExtensions(fileName, ui.twExtensions, true); | 66 | filter->parseExtensions(fileName, ui.twExtensions, true); | ||
67 | DEBUG("FITSOptionsWidget::updateContent() DONE"); | 67 | DEBUG("FITSOptionsWidget::updateContent() DONE"); | ||
68 | } | 68 | } | ||
69 | 69 | | |||
70 | /*! | 70 | /*! | ||
71 | updates the selected var name of a NetCDF file when the tree widget item is selected | 71 | updates the selected var name of a NetCDF file when the tree widget item is selected | ||
Show All 33 Lines | 100 | if (item->parent() != nullptr) { | |||
105 | } | 105 | } | ||
106 | } | 106 | } | ||
107 | } else { | 107 | } else { | ||
108 | if (item->parent()->parent() != nullptr) | 108 | if (item->parent()->parent() != nullptr) | ||
109 | selectedExtension = item->parent()->parent()->text(column); | 109 | selectedExtension = item->parent()->parent()->text(column); | ||
110 | } | 110 | } | ||
111 | 111 | | |||
112 | if (!selectedExtension.isEmpty()) { | 112 | if (!selectedExtension.isEmpty()) { | ||
113 | auto* filter = dynamic_cast<FITSFilter*>(m_fileWidget->currentFileFilter()); | 113 | auto filter = static_cast<FITSFilter*>(m_fileWidget->currentFileFilter()); | ||
114 | bool readFitsTableToMatrix; | 114 | bool readFitsTableToMatrix; | ||
115 | const QVector<QStringList> importedStrings = filter->readChdu(selectedExtension, &readFitsTableToMatrix, ui.sbPreviewLines->value()); | 115 | const QVector<QStringList> importedStrings = filter->readChdu(selectedExtension, &readFitsTableToMatrix, ui.sbPreviewLines->value()); | ||
116 | emit m_fileWidget->checkedFitsTableToMatrix(readFitsTableToMatrix); | 116 | emit m_fileWidget->checkedFitsTableToMatrix(readFitsTableToMatrix); | ||
117 | 117 | | |||
118 | const int rows = importedStrings.size(); | 118 | const int rows = importedStrings.size(); | ||
119 | ui.twPreview->clear(); | 119 | ui.twPreview->clear(); | ||
120 | 120 | | |||
121 | ui.twPreview->setRowCount(rows); | 121 | ui.twPreview->setRowCount(rows); | ||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |