forked from quickshell/quickshell
all: fix new lints
This commit is contained in:
parent
26d443aa50
commit
2c411fce5a
43 changed files with 351 additions and 316 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue