diff options
author | saturneric <[email protected]> | 2025-06-10 22:41:39 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2025-06-10 22:41:39 +0000 |
commit | c2d542123d14d45612aa2ded9d3f0a877ae7bb36 (patch) | |
tree | 9c8e7c9366aea2fc3d326b33a0b3f24253551a56 | |
parent | fix: remove redundant flag setting in version check task (diff) | |
download | Modules-c2d542123d14d45612aa2ded9d3f0a877ae7bb36.tar.gz Modules-c2d542123d14d45612aa2ded9d3f0a877ae7bb36.zip |
refactor(gnupg): move info gathering to show event and remove debug logs
- move gnupg info gathering logic from constructor to showEvent
- remove debug logging statements
- add resizeColumnsToContents for option details table
-rw-r--r-- | src/m_gpg_info/GnupgTab.cpp | 28 | ||||
-rw-r--r-- | src/m_gpg_info/GnupgTab.h | 8 |
2 files changed, 22 insertions, 14 deletions
diff --git a/src/m_gpg_info/GnupgTab.cpp b/src/m_gpg_info/GnupgTab.cpp index 350a1eb..e128b59 100644 --- a/src/m_gpg_info/GnupgTab.cpp +++ b/src/m_gpg_info/GnupgTab.cpp @@ -112,13 +112,6 @@ GnupgTab::GnupgTab(QWidget* parent) connect(this, &GnupgTab::SignalGnuPGInfoGathered, this, &GnupgTab::slot_process_software_info); - - if (GFModuleRetrieveRTValueOrDefaultBool( - DUP("ui"), DUP("env.state.gnupg_info_gathering"), 0) == 1) { - slot_process_software_info(); - } else { - slot_gather_gnupg_info(); - } } void GnupgTab::slot_process_software_info() { @@ -132,8 +125,6 @@ void GnupgTab::slot_process_software_info() { GFGetModuleID(), DUP("gnupg.components"), &pl_components); auto components = CharArrayToQStringList(pl_components, pl_components_size); - MLogDebug( - QString("got gnupg components from rt, size: %1").arg(components.size())); ui_->componentDetailsTable->setRowCount(static_cast<int>(components.size())); @@ -142,7 +133,6 @@ void GnupgTab::slot_process_software_info() { auto component_info_json_bytes = UDUP(GFModuleRetrieveRTValueOrDefault( GFGetModuleID(), QDUP(QString("gnupg.components.%1").arg(component)), DUP(""))); - MLogDebug(QString("got gnupg component %1 info from rt").arg(component)); auto component_info_json = QJsonDocument::fromJson(component_info_json_bytes.toUtf8()); @@ -262,10 +252,6 @@ void GnupgTab::slot_process_software_info() { .arg(component) .arg(option)), DUP(""))); - MLogDebug( - QString("got gnupg component's option %1 info from rt, info: %2") - .arg(component) - .arg(option_info_json_bytes)); auto option_info_json = QJsonDocument::fromJson(option_info_json_bytes.toUtf8()); @@ -319,6 +305,8 @@ void GnupgTab::slot_process_software_info() { } } + ui_->optionDetailsTable->resizeColumnsToContents(); + ui_->loadProgressBar->hide(); ui_->tabWidget->setDisabled(false); } @@ -344,4 +332,16 @@ GnupgTabWatcher::GnupgTabWatcher(GnupgTab* tab) { }); } +void GnupgTab::showEvent(QShowEvent* event) { + QWidget::showEvent(event); + + int gathered = GFModuleRetrieveRTValueOrDefaultBool( + DUP("ui"), DUP("env.state.gnupg_info_gathering"), 0); + if (gathered == 1) { + slot_process_software_info(); + } else { + slot_gather_gnupg_info(); + } +} + auto GnupgTabFactory(void*) -> void* { return new GnupgTab(); }
\ No newline at end of file diff --git a/src/m_gpg_info/GnupgTab.h b/src/m_gpg_info/GnupgTab.h index d25f0f7..3e45a73 100644 --- a/src/m_gpg_info/GnupgTab.h +++ b/src/m_gpg_info/GnupgTab.h @@ -54,6 +54,14 @@ class GnupgTab : public QWidget { */ void SignalGnuPGInfoGathered(); + protected: + /** + * @brief + * + * @param event + */ + void showEvent(QShowEvent* event) override; + private slots: /** * @brief |