Skip to content

Add adapter version to about#30

Merged
jgeudens merged 1 commit intomasterfrom
dev/adapter_version
Apr 15, 2026
Merged

Add adapter version to about#30
jgeudens merged 1 commit intomasterfrom
dev/adapter_version

Conversation

@jgeudens
Copy link
Copy Markdown
Member

@jgeudens jgeudens commented Apr 14, 2026

Summary by CodeRabbit

  • New Features
    • About dialogue now displays adapter version information when available.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

Walkthrough

AboutDialog enhanced to display adapter version information. Constructor signature updated to accept SettingsModel parameter. New method retrieves and displays adapter versions from SettingsModel. UI layout adjusted with new label. MainWindow updated to pass SettingsModel when instantiating AboutDialog.

Changes

Cohort / File(s) Summary
AboutDialog Class
src/dialogs/aboutdialog.h, src/dialogs/aboutdialog.cpp
Constructor signature updated to accept SettingsModel* parameter. New private method setAdapterVersionInfo() added to iterate adapter IDs, retrieve version data, and populate adapter version label. Version info population moved into separate method call during construction.
AboutDialog UI Layout
src/dialogs/aboutdialog.ui
New QLabel widget lblAdapterVersion added at grid row 4, spanning columns 1–2. Existing layout item shifted down to row 5. Label configured with font size 11 and centre alignment.
MainWindow Integration
src/dialogs/mainwindow.cpp
AboutDialog instantiation in showAbout() updated to pass _pSettingsModel as additional constructor argument alongside existing _pUpdateNotify and parent parameters.
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add adapter version to about' clearly and concisely describes the primary change: displaying adapter version information in the about dialog.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev/adapter_version

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jgeudens
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/dialogs/aboutdialog.cpp (1)

17-19: Add a Qt Doxygen block for the updated public constructor.

This public constructor was changed but is still undocumented in the source file.

📝 Proposed comment block
+/*!
+ * \brief Creates the About dialog and initialises displayed version metadata.
+ * \param pUpdateNotify Update notifier used for update status text.
+ * \param pSettingsModel Settings model used to resolve adapter version text.
+ * \param parent Parent widget.
+ */
 AboutDialog::AboutDialog(UpdateNotify* pUpdateNotify, SettingsModel* pSettingsModel, QWidget* parent)
     : QDialog(parent), _pUi(new Ui::AboutDialog)

As per coding guidelines, **/*.{cpp,cxx}: Document all public functions with brief Doxygen comments in the source file.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/dialogs/aboutdialog.cpp` around lines 17 - 19, Add a brief Qt-style
Doxygen comment above the updated public constructor
AboutDialog::AboutDialog(UpdateNotify* pUpdateNotify, SettingsModel*
pSettingsModel, QWidget* parent) in aboutdialog.cpp describing the purpose of
the constructor and its parameters; include `@param` tags for pUpdateNotify,
pSettingsModel and parent and a one-line summary (e.g., "Constructs the About
dialog and initializes UI and update/settings pointers"). Ensure the comment
follows the project's Doxygen formatting used elsewhere in the .cpp files.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/dialogs/aboutdialog.cpp`:
- Around line 97-113: AboutDialog::setAdapterVersionInfo currently dereferences
pSettingsModel without a null check; add a guard at the start of the function
(e.g., if (!pSettingsModel) { _pUi->lblAdapterVersion->setVisible(false);
_pUi->lblAdapterVersion->setText(QString()); return; }) so you don’t call
pSettingsModel->adapterIds() or adapterData() when pSettingsModel is null, and
ensure _pUi->lblAdapterVersion visibility/text are set to safe defaults when
returning early.

---

Nitpick comments:
In `@src/dialogs/aboutdialog.cpp`:
- Around line 17-19: Add a brief Qt-style Doxygen comment above the updated
public constructor AboutDialog::AboutDialog(UpdateNotify* pUpdateNotify,
SettingsModel* pSettingsModel, QWidget* parent) in aboutdialog.cpp describing
the purpose of the constructor and its parameters; include `@param` tags for
pUpdateNotify, pSettingsModel and parent and a one-line summary (e.g.,
"Constructs the About dialog and initializes UI and update/settings pointers").
Ensure the comment follows the project's Doxygen formatting used elsewhere in
the .cpp files.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3498ea78-6107-47cf-9c49-1cf61b8a5fe6

📥 Commits

Reviewing files that changed from the base of the PR and between a809af7 and 9159d8d.

📒 Files selected for processing (4)
  • src/dialogs/aboutdialog.cpp
  • src/dialogs/aboutdialog.h
  • src/dialogs/aboutdialog.ui
  • src/dialogs/mainwindow.cpp

Comment on lines +97 to +113
void AboutDialog::setAdapterVersionInfo(SettingsModel* pSettingsModel)
{
QString versionTxt;

for (const QString& id : pSettingsModel->adapterIds())
{
const QString version = pSettingsModel->adapterData(id)->version();
if (!version.isEmpty())
{
versionTxt = QString(tr("Adapter: v%1")).arg(version);
break;
}
}

_pUi->lblAdapterVersion->setVisible(!versionTxt.isEmpty());
_pUi->lblAdapterVersion->setText(versionTxt);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Guard pSettingsModel before use to prevent a crash.

Line 101 dereferences pSettingsModel unconditionally. If a null pointer reaches this path, About dialog construction will fail.

💡 Proposed fix
 void AboutDialog::setAdapterVersionInfo(SettingsModel* pSettingsModel)
 {
+    if (pSettingsModel == nullptr)
+    {
+        _pUi->lblAdapterVersion->clear();
+        _pUi->lblAdapterVersion->setVisible(false);
+        return;
+    }
+
     QString versionTxt;
 
     for (const QString& id : pSettingsModel->adapterIds())
     {
         const QString version = pSettingsModel->adapterData(id)->version();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/dialogs/aboutdialog.cpp` around lines 97 - 113,
AboutDialog::setAdapterVersionInfo currently dereferences pSettingsModel without
a null check; add a guard at the start of the function (e.g., if
(!pSettingsModel) { _pUi->lblAdapterVersion->setVisible(false);
_pUi->lblAdapterVersion->setText(QString()); return; }) so you don’t call
pSettingsModel->adapterIds() or adapterData() when pSettingsModel is null, and
ensure _pUi->lblAdapterVersion visibility/text are set to safe defaults when
returning early.

@jgeudens jgeudens merged commit 705c8f3 into master Apr 15, 2026
10 checks passed
@jgeudens jgeudens deleted the dev/adapter_version branch April 15, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant