mirror of
https://invent.kde.org/marcoa/a-la-karte.git
synced 2026-02-10 05:13:08 +00:00
58 lines
2.3 KiB
Markdown
58 lines
2.3 KiB
Markdown
# Cleanup Notes
|
|
|
|
## 2026-01-25
|
|
|
|
This file tracks cleanup/refactor steps taken during a “deep cleanup” pass, with the goal of reducing dead/duplicate code **without changing application functionality**.
|
|
|
|
### Applied changes
|
|
|
|
#### 1) Remove duplicate QML type registration in `src/main.cpp`
|
|
|
|
- **What changed**
|
|
- Removed manual `qmlRegisterSingletonType` / `qmlRegisterType` / `qmlRegisterUncreatableType` calls for types already marked with `QML_ELEMENT` / `QML_SINGLETON`.
|
|
- **Why**
|
|
- The project uses `ecm_add_qml_module(...)` and the generated QML type registration (based on `QML_ELEMENT` / `QML_SINGLETON`) already registers these types.
|
|
- Keeping both mechanisms is redundant and risks divergence.
|
|
- **Files**
|
|
- `src/main.cpp`
|
|
|
|
#### 2) Remove dead QML state in `src/qml/SettingsPage.qml`
|
|
|
|
- **What changed**
|
|
- Removed unused `pendingDisableImportDelegate` state.
|
|
- Simplified `requestDisableImport(...)` to no longer accept an unused `delegate` parameter.
|
|
- **Why**
|
|
- The variable was assigned/cleared but never read.
|
|
- **Files**
|
|
- `src/qml/SettingsPage.qml`
|
|
|
|
#### 3) Stop shipping `FocusableCard.qml` in the QML module (but keep the file)
|
|
|
|
- **What changed**
|
|
- Removed `qml/components/FocusableCard.qml` from the `QML_FILES` list in `ecm_add_qml_module(...)`.
|
|
- **Why**
|
|
- The component is not referenced anywhere in QML currently.
|
|
- We want to keep the implementation around because it may be useful later (e.g. Desktop/Couch mode), but avoid shipping unused module contents.
|
|
- **Files**
|
|
- `src/CMakeLists.txt`
|
|
- Note: `src/qml/components/FocusableCard.qml` still exists in the repository.
|
|
|
|
### Verification performed
|
|
|
|
- Built successfully:
|
|
- `cmake --build build-debug`
|
|
- Quick run smoke test:
|
|
- Launches without QML type registration errors.
|
|
- Only the existing Kirigami `StackView has detected conflicting anchors` warning was observed.
|
|
|
|
### Intentional non-changes (paused items)
|
|
|
|
- Do **not** delete `src/qml/components/FocusableCard.qml` yet.
|
|
- Do **not** remove or migrate any persisted `Config` settings or public QML API fields yet.
|
|
|
|
### How to revert / resume later
|
|
|
|
- To re-ship `FocusableCard.qml`:
|
|
- Add it back to `ecm_add_qml_module(... QML_FILES ...)` in `src/CMakeLists.txt`.
|
|
- To fully remove it:
|
|
- `git rm src/qml/components/FocusableCard.qml` (only after confirming it is not needed for future UI modes).
|