# Keep provider identity in one place instead of two copies · lucenx/codexbar-plasma

[View on GitCafe](https://git.cafe/lucenx/codexbar-plasma/commit/1d2820ae415d081bf70b2e55c93f76c62abe3feb)

Repository: [lucenx/codexbar-plasma](https://git.cafe/lucenx/codexbar-plasma)

Visibility: public

Requested revision: 1d2820ae415d081bf70b2e55c93f76c62abe3feb

Requested commit: 1d2820ae415d081bf70b2e55c93f76c62abe3feb

Commit: 1d2820ae415d081bf70b2e55c93f76c62abe3feb

Tree: 5d0eb8ee2867b580c98394d6fcbbf6c600c53fed

Author: Simone

Committer: Simone

## Message

```
Keep provider identity in one place instead of two copies

main.qml and configProviders.qml both render provider metadata, so both
carried the same alias, CLI argument, brand colour, dashboard, login, status,
documentation and icon tables. Adding a provider meant editing two files, and
the only thing that noticed a miss was a drift check in test_ui_regressions.sh
that compared the two copies entry by entry. A test whose job is to watch a
duplication is a good argument for removing the duplication.

The tables move into ProviderIdentity.js, which already owned key resolution.
Everything there stays free of QML context, so brand colours are channel
triples the caller feeds to Qt.rgba, and the icon and documentation lookups
return a bare name or path that the caller resolves. The display names are the
one table that cannot move: i18n needs literal strings in a file gettext scans,
so providerTitle stays duplicated and keeps its drift check.

The static checks follow the data rather than asserting against whichever file
used to hold it. The parity, icon, theme and security checks now read the
shared module, and what they assert about the surfaces is that neither has
grown a private table again. tst_provider_identity.qml covers alias
resolution, graceful degradation for unknown providers, and the icon-name
refusal that keeps a provider-controlled key from naming a path.

Verified equivalent before and after with a throwaway qmltestrunner harness
comparing all seven lookups across 149 provider keys and all 71 brand colours
against the previous implementation; every result matched.

main.qml 5046 -> 4522 lines, configProviders.qml 2528 -> 2061.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

```

## Parents

- [e72360b3b3563c3c4b27688633e10c65b2b9faf0](https://git.cafe/lucenx/codexbar-plasma/commit/e72360b3b3563c3c4b27688633e10c65b2b9faf0?format=markdown)

[Source at this commit](https://git.cafe/lucenx/codexbar-plasma/tree/1d2820ae415d081bf70b2e55c93f76c62abe3feb?format=markdown)
