Generated: 2026-03-10 Commit: 935b558 Branch: main
DDE Shell weather plugin - Deepin Desktop Environment taskbar weather applet using Qt6/C++/QML with MET Norway as the primary backend and Open-Meteo as fallback.
./
├── CMakeLists.txt # Build config
├── debian/ # Debian packaging metadata
├── src/ # C++ source files
│ ├── weatherapplet.h/cpp # Main applet class (DApplet)
│ └── weatherprovider.h/cpp # Weather data provider (QNetworkAccessManager)
└── package/ # QML UI
├── main.qml # Main UI
├── WeatherIcon.qml # Weather icon with animations
└── metadata.json # Plugin metadata
| Task | Location | Notes |
|---|---|---|
| Add new weather field | src/weatherprovider.h + src/weatherprovider.cpp |
Add to WeatherData struct, add Q_PROPERTY |
| UI changes | package/main.qml |
Main UI layout |
| Icon animations | package/WeatherIcon.qml |
Weather condition icons |
| Build system | CMakeLists.txt |
Qt6/DTK6 dependencies |
| Update China region database | scripts/generate_china_cities.py + src/chinacitydb.cpp + tests/chinacitydb_test.cpp |
Edit the generator, never hand-edit the generated database; verify with chinacitydb_tests |
| Version bump / release | CMakeLists.txt + package/metadata.json + debian/changelog |
Keep upstream and Debian package versions in sync |
| Symbol | Type | File |
|---|---|---|
| WeatherApplet | class | src/weatherapplet.h |
| WeatherProvider | class | src/weatherprovider.h |
| WeatherData | struct | src/weatherprovider.h |
| DS_USE_NAMESPACE | macro | src/weatherapplet.h |
- QML: Never use duplicate
id:values - C++: Run
clang-format -style=gnuafter every C++ edit - License: SPDX header required on every new file (
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.) - Namespace: Use
DS_USE_NAMESPACEin headers that expose DDE types - ChinaCityDb: Never edit
src/chinacitydb.cppmanually; updatescripts/generate_china_cities.pyand regenerate - China districts/counties: Keep district/county dedupe keyed by
name + prefecture + provinceso homonymous entries like长安区and市中区are preserved - Version updates: Always update
CMakeLists.txt,package/metadata.json, anddebian/changelogtogether
- QML duplicate IDs -> runtime errors
- Missing SPDX license header -> rejected
- C++ without clang-format -> style violation
- Hardcoded API keys -> use Open-Meteo (no key required)
- Hand-editing
src/chinacitydb.cpp-> next regeneration will overwrite it - Name-only dedupe for China districts/counties -> drops valid homonymous districts from search results
# Build
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make -j$(nproc)
sudo make install
# Format C++
clang-format -style=gnu -i src/weatherprovider.cpp src/weatherapplet.cpp
# Check Debian package version
dpkg-parsechangelog -S Version
# Regenerate the China region database
uv venv .venv
uv pip install --python .venv pypinyin opencc-python-reimplemented
.venv/bin/python3 scripts/generate_china_cities.py
# Verify China city/district search coverage
mkdir -p build && cd build
cmake .. -DBUILD_TESTING=ON
cmake --build . --target chinacitydb_tests -j$(nproc)
ctest -R chinacitydb_tests --output-on-failureWhen bumping the release version:
- Update
project(... VERSION x.y.z ...)inCMakeLists.txt - Update
Plugin.Versioninpackage/metadata.json - Add a new top entry in
debian/changelogusing Debian package versionx.y.z-1 - Verify
dpkg-parsechangelog -S Versionmatches the expected Debian version - Run a build after the version bump to catch packaging or metadata regressions
- Uses MET Norway as primary weather API, Open-Meteo as fallback
- Auto-refresh every 30 minutes via QTimer
- WMO weather codes mapped to icons/animations
- Chinese manual-location queries prefer local
ChinaCityDb; Open-Meteo geocoding is unreliable for Chinese place names - Missing Chinese districts/counties are usually a generator coverage issue, not a QML completer bug
scripts/CN.txtis a downloaded GeoNames cache for regeneration and usually should stay local unless explicitly vendoring it- Supports optional Qt6 Positioning for auto-location