mirror of
https://github.com/quickshell-mirror/quickshell.git
synced 2026-10-29 03:05:05 +00:00
all: fix new lints
This commit is contained in:
43 files changed
+351
-316
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user