-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: reduce duplication #309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
41bc064
64b5466
7ba4455
cc4fb0b
674f29f
046b061
f7a78a9
15d8ec3
8e440d0
4e4f80f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ scan: | |
| - "**/*.fbx" | ||
| - "**/*.glb" | ||
| - "**/*.gltf" | ||
| - "**/*.vrm" | ||
| - "**/*.obj" | ||
| - "**/*.mesh" | ||
| exclude: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| /* | ||
| ----------------------------------------------------------------------------------- | ||
| A QtMeshEditor file | ||
|
|
||
| Copyright (c) Fernando Tonon (https://github.com/fernandotonon) | ||
|
|
||
| The MIT License | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software | ||
| without restriction, including without limitation the rights to use, copy, | ||
| modify, merge, publish, distribute, sublicense, and/or sell copies of the | ||
| Software, and to permit persons to whom the Software is furnished to do so, | ||
| subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING WITHOUT LIMITATION THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
| OTHER DEALINGS IN THE SOFTWARE. | ||
| ----------------------------------------------------------------------------------- | ||
| */ | ||
|
|
||
| #ifndef APP_SETTINGS_KEYS_H | ||
| #define APP_SETTINGS_KEYS_H | ||
|
|
||
| #include <QString> | ||
|
|
||
| namespace AppSettingsKeys | ||
| { | ||
|
|
||
| /** @brief Sentry on/off in Preferences (must match QML and SentryReporter). */ | ||
| inline const QString& sentryEnabled() | ||
| { | ||
| static const QString k(QStringLiteral("Sentry/enabled")); | ||
|
Check warning on line 41 in src/AppSettingsKeys.h
|
||
| return k; | ||
| } | ||
|
|
||
| /** @brief Telemetry on/off. */ | ||
| inline const QString& telemetryEnabled() | ||
| { | ||
| static const QString k(QStringLiteral("Telemetry/enabled")); | ||
|
Check warning on line 48 in src/AppSettingsKeys.h
|
||
| return k; | ||
| } | ||
|
|
||
| /** @brief Light/dark/system from Preferences. */ | ||
| inline const QString& appearanceTheme() | ||
| { | ||
| static const QString k(QStringLiteral("Appearance/theme")); | ||
|
Check warning on line 55 in src/AppSettingsKeys.h
|
||
| return k; | ||
| } | ||
|
|
||
| /** | ||
| * @brief Legacy / alternate key for theme (some paths write "palette"). | ||
| */ | ||
| inline const QString& palette() | ||
| { | ||
| static const QString k(QStringLiteral("palette")); | ||
|
Check warning on line 64 in src/AppSettingsKeys.h
|
||
| return k; | ||
| } | ||
|
|
||
| } // namespace AppSettingsKeys | ||
|
|
||
| #endif // APP_SETTINGS_KEYS_H | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normalize invalid persisted MSAA values, not just UI state.
Right now, unsupported stored values only fall back in the local UI selection. Consider also correcting persisted settings to avoid stale invalid config remaining in QSettings.
Suggested QML diff
Component.onCompleted: { var v = parseInt(readSetting("Viewport/fsaaSamples", 4)) - if (v === 0 || v === 2 || v === 4 || v === 8) - msaaSelection = v + if (v === 0 || v === 2 || v === 4 || v === 8) { + msaaSelection = v + } else { + msaaSelection = 4 + writeSetting("Viewport/fsaaSamples", 4) + } }📝 Committable suggestion
🤖 Prompt for AI Agents