all: fix new lints

This commit is contained in:
outfoxxed 2025-01-07 03:11:19 -08:00
parent 26d443aa50
commit 2c411fce5a
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
43 changed files with 351 additions and 316 deletions

View file

@ -13,10 +13,12 @@
namespace qs::debug {
namespace {
Q_LOGGING_CATEGORY(logLint, "quickshell.linter", QtWarningMsg);
void lintZeroSized(QQuickItem* item);
bool isRenderable(QQuickItem* item);
} // namespace
void lintObjectTree(QObject* object) {
if (!logLint().isWarningEnabled()) return;
@ -41,6 +43,8 @@ void lintItemTree(QQuickItem* item) {
}
}
namespace {
void lintZeroSized(QQuickItem* item) {
if (!item->isEnabled() || !item->isVisible()) return;
if (item->childItems().isEmpty()) return;
@ -71,4 +75,6 @@ bool isRenderable(QQuickItem* item) {
return std::ranges::any_of(item->childItems(), [](auto* item) { return isRenderable(item); });
}
} // namespace
} // namespace qs::debug