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

Method fillTable

src/frontend/widgets/FITSHeaderEditWidget.cpp:99–123  ·  view source on GitHub ↗

! * \brief Fills the keywords tablewidget. * If the selected extension was not yet selected before, then the keywords are read from the file * and then the table is filled, otherwise the table is filled using the already existing keywords. */

Source from the content-addressed store, hash-verified

97 * and then the table is filled, otherwise the table is filled using the already existing keywords.
98 */
99void FITSHeaderEditWidget::fillTable() {
100 m_initializingTable = true;
101 if (!m_extensionData.contains(m_seletedExtension)) {
102 m_extensionData[m_seletedExtension].keywords = m_fitsFilter->chduKeywords(m_seletedExtension);
103 m_extensionData[m_seletedExtension].updates.updatedKeywords.reserve(m_extensionData[m_seletedExtension].keywords.size());
104 m_extensionData[m_seletedExtension].updates.updatedKeywords.resize(m_extensionData[m_seletedExtension].keywords.size());
105
106 m_fitsFilter->parseHeader(m_seletedExtension, ui->twKeywordsTable);
107 } else {
108 QList<FITSFilter::Keyword> keywords = m_extensionData[m_seletedExtension].keywords;
109 for (int i = 0; i < m_extensionData[m_seletedExtension].updates.updatedKeywords.size(); ++i) {
110 FITSFilter::Keyword keyword = m_extensionData[m_seletedExtension].updates.updatedKeywords.at(i);
111 if (!keyword.key.isEmpty())
112 keywords.operator[](i).key = keyword.key;
113 if (!keyword.value.isEmpty())
114 keywords.operator[](i).value = keyword.value;
115 if (!keyword.comment.isEmpty())
116 keywords.operator[](i).comment = keyword.comment;
117 }
118 for (const FITSFilter::Keyword& key : m_extensionData[m_seletedExtension].updates.newKeywords)
119 keywords.append(key);
120 m_fitsFilter->parseHeader(QString(), ui->twKeywordsTable, false, keywords);
121 }
122 m_initializingTable = false;
123}
124
125/*!
126 * \brief Fills the tablewidget with the keywords of extension \a item

Callers

nothing calls this directly

Calls 10

chduKeywordsMethod · 0.80
parseHeaderMethod · 0.80
operator[]Method · 0.80
appendMethod · 0.80
QStringClass · 0.50
containsMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected