! * \brief Trigggered when an item was updated by the user in the tablewidget * \param item the item which was updated */
| 409 | * \param item the item which was updated |
| 410 | */ |
| 411 | void FITSHeaderEditWidget::updateKeyword(QTableWidgetItem* item) { |
| 412 | if (!m_initializingTable) { |
| 413 | const int row = item->row(); |
| 414 | if (row < 0) |
| 415 | return; |
| 416 | |
| 417 | int idx; |
| 418 | bool fromNewKeyword = false; |
| 419 | if (row > m_extensionData[m_seletedExtension].keywords.size() - 1) { |
| 420 | idx = row - m_extensionData[m_seletedExtension].keywords.size(); |
| 421 | fromNewKeyword = true; |
| 422 | } else |
| 423 | idx = row; |
| 424 | |
| 425 | if (item->column() == 0) { |
| 426 | if (!fromNewKeyword) { |
| 427 | m_extensionData[m_seletedExtension].updates.updatedKeywords.operator[](idx).key = item->text(); |
| 428 | m_extensionData[m_seletedExtension].keywords.operator[](idx).updates.keyUpdated = true; |
| 429 | } else { |
| 430 | m_extensionData[m_seletedExtension].updates.newKeywords.operator[](idx).key = item->text(); |
| 431 | m_extensionData[m_seletedExtension].updates.newKeywords.operator[](idx).updates.keyUpdated = true; |
| 432 | } |
| 433 | |
| 434 | } else if (item->column() == 1) { |
| 435 | if (!fromNewKeyword) { |
| 436 | m_extensionData[m_seletedExtension].updates.updatedKeywords.operator[](idx).value = item->text(); |
| 437 | m_extensionData[m_seletedExtension].keywords.operator[](idx).updates.valueUpdated = true; |
| 438 | } else { |
| 439 | m_extensionData[m_seletedExtension].updates.newKeywords.operator[](idx).value = item->text(); |
| 440 | m_extensionData[m_seletedExtension].updates.newKeywords.operator[](idx).updates.valueUpdated = true; |
| 441 | } |
| 442 | } else { |
| 443 | if (!fromNewKeyword) { |
| 444 | m_extensionData[m_seletedExtension].updates.updatedKeywords.operator[](idx).comment = item->text(); |
| 445 | m_extensionData[m_seletedExtension].keywords.operator[](idx).updates.commentUpdated = true; |
| 446 | } else { |
| 447 | m_extensionData[m_seletedExtension].updates.newKeywords.operator[](idx).comment = item->text(); |
| 448 | m_extensionData[m_seletedExtension].updates.newKeywords.operator[](idx).updates.commentUpdated = true; |
| 449 | } |
| 450 | } |
| 451 | Q_EMIT changed(true); |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | /*! |
| 456 | * \brief Shows a FITSHeaderEditAddUnitDialog on the selected keyword (provides the keyword's unit to the |
nothing calls this directly
no test coverage detected