aboutsummaryrefslogtreecommitdiff
path: root/autotests/kconfig_compiler/test8b.h.ref
diff options
context:
space:
mode:
authorMéven Car <meven.car@enioka.com>2020-02-04 16:03:52 +0100
committerMéven Car <meven29@gmail.com>2020-02-04 16:09:29 +0100
commitd46739294d04c72af1e434e414e1c012d7e78a42 (patch)
tree5a227069a6a1a110cc26b788ff8a3bd99005735e /autotests/kconfig_compiler/test8b.h.ref
parentfd0e26ddb49122fa55bdc8f35e189c832cc138ad (diff)
downloadkconfig-d46739294d04c72af1e434e414e1c012d7e78a42.tar.gz
kconfig-d46739294d04c72af1e434e414e1c012d7e78a42.tar.bz2
Add an is<PropertyName>Immutable to know if a property is immutable
Summary: Add a utility function is<Parameter>Immutable to access immutability quickly. Generated classes uses them internally to avoid code redundance. Sample: ``` /** Set blocked-by-default */ void setBlockedByDefault( bool v ) { if (v != mBlockedByDefault && !isBlockedByDefaultImmutable() ) { mBlockedByDefault = v; Q_EMIT blockedByDefaultChanged(); } } /** Is blocked-by-default Immutable */ bool isBlockedByDefaultImmutable() { return isImmutable( QStringLiteral( "blockedByDefault" ) ); } ``` ``` /** Set org.kde.ActivityManager.ResourceScoringEnabled */ void setResourceScoringEnabled( bool v ) { if (!isResourceScoringEnabledImmutable() ) mResourceScoringEnabled = v; } /** Is org.kde.ActivityManager.ResourceScoringEnabled Immutable */ bool isResourceScoringEnabledImmutable() { return isImmutable( QStringLiteral( "resourceScoringEnabled" ) ); } ``` Reviewers: ervin, #frameworks, dfaure Reviewed By: ervin Subscribers: dfaure, tcanabrava, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D26368
Diffstat (limited to 'autotests/kconfig_compiler/test8b.h.ref')
-rw-r--r--autotests/kconfig_compiler/test8b.h.ref33
1 files changed, 30 insertions, 3 deletions
diff --git a/autotests/kconfig_compiler/test8b.h.ref b/autotests/kconfig_compiler/test8b.h.ref
index 0f71ba7c..793c6851 100644
--- a/autotests/kconfig_compiler/test8b.h.ref
+++ b/autotests/kconfig_compiler/test8b.h.ref
@@ -22,7 +22,7 @@ class Test8b : public Test8a
static
void setSomething( uint v )
{
- if (!self()->isImmutable( QStringLiteral( "Something" ) ))
+ if (!self()->isSomethingImmutable())
self()->mSomething = v;
}
@@ -36,12 +36,21 @@ class Test8b : public Test8a
}
/**
+ Is Something Immutable
+ */
+ static
+ bool isSomethingImmutable()
+ {
+ return self()->isImmutable( QStringLiteral( "Something" ) );
+ }
+
+ /**
Set FooBoo
*/
static
void setFooBoo( bool v )
{
- if (!self()->isImmutable( QStringLiteral( "FooBoo" ) ))
+ if (!self()->isFooBooImmutable())
self()->mFooBoo = v;
}
@@ -55,12 +64,21 @@ class Test8b : public Test8a
}
/**
+ Is FooBoo Immutable
+ */
+ static
+ bool isFooBooImmutable()
+ {
+ return self()->isImmutable( QStringLiteral( "FooBoo" ) );
+ }
+
+ /**
Set Port
*/
static
void setPort( uint v )
{
- if (!self()->isImmutable( QStringLiteral( "Port" ) ))
+ if (!self()->isPortImmutable())
self()->mPort = v;
}
@@ -73,6 +91,15 @@ class Test8b : public Test8a
return self()->mPort;
}
+ /**
+ Is Port Immutable
+ */
+ static
+ bool isPortImmutable()
+ {
+ return self()->isImmutable( QStringLiteral( "Port" ) );
+ }
+
protected:
Test8b();
friend class Test8bHelper;