aboutsummaryrefslogtreecommitdiff
path: root/autotests/kconfig_compiler/test_signal.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/test_signal.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/test_signal.h.ref')
-rw-r--r--autotests/kconfig_compiler/test_signal.h.ref55
1 files changed, 50 insertions, 5 deletions
diff --git a/autotests/kconfig_compiler/test_signal.h.ref b/autotests/kconfig_compiler/test_signal.h.ref
index a005e140..ef106a8d 100644
--- a/autotests/kconfig_compiler/test_signal.h.ref
+++ b/autotests/kconfig_compiler/test_signal.h.ref
@@ -21,7 +21,7 @@ class TestSignal : public KConfigSkeleton
static
void setEmoticonTheme( const QString & v )
{
- if (v != self()->mEmoticonTheme && !self()->isImmutable( QStringLiteral( "emoticonTheme" ) )) {
+ if (v != self()->mEmoticonTheme && !self()->isEmoticonThemeImmutable()) {
self()->mEmoticonTheme = v;
self()->mSettingsChanged |= signalEmoticonSettingsChanged;
}
@@ -37,12 +37,21 @@ class TestSignal : public KConfigSkeleton
}
/**
+ Is Current emoticon theme. Immutable
+ */
+ static
+ bool isEmoticonThemeImmutable()
+ {
+ return self()->isImmutable( QStringLiteral( "emoticonTheme" ) );
+ }
+
+ /**
Set Enable emoticon support in Kopete.
*/
static
void setUseEmoticon( bool v )
{
- if (v != self()->mUseEmoticon && !self()->isImmutable( QStringLiteral( "useEmoticon" ) )) {
+ if (v != self()->mUseEmoticon && !self()->isUseEmoticonImmutable()) {
self()->mUseEmoticon = v;
self()->mSettingsChanged |= signalEmoticonSettingsChanged;
}
@@ -58,12 +67,21 @@ class TestSignal : public KConfigSkeleton
}
/**
+ Is Enable emoticon support in Kopete. Immutable
+ */
+ static
+ bool isUseEmoticonImmutable()
+ {
+ return self()->isImmutable( QStringLiteral( "useEmoticon" ) );
+ }
+
+ /**
Set Use strict mode in emoticon parsing.
*/
static
void setEmoticonRequireSpace( bool v )
{
- if (v != self()->mEmoticonRequireSpace && !self()->isImmutable( QStringLiteral( "emoticonRequireSpace" ) )) {
+ if (v != self()->mEmoticonRequireSpace && !self()->isEmoticonRequireSpaceImmutable()) {
self()->mEmoticonRequireSpace = v;
self()->mSettingsChanged |= signalEmoticonSettingsChanged;
}
@@ -79,12 +97,21 @@ class TestSignal : public KConfigSkeleton
}
/**
+ Is Use strict mode in emoticon parsing. Immutable
+ */
+ static
+ bool isEmoticonRequireSpaceImmutable()
+ {
+ return self()->isImmutable( QStringLiteral( "emoticonRequireSpace" ) );
+ }
+
+ /**
Set Absolute path to a directory containing a Adium/Kopete chat window style.
*/
static
void setStylePath( const QString & v )
{
- if (v != self()->mStylePath && !self()->isImmutable( QStringLiteral( "stylePath" ) )) {
+ if (v != self()->mStylePath && !self()->isStylePathImmutable()) {
self()->mStylePath = v;
self()->mSettingsChanged |= signalStyleChanged;
}
@@ -100,12 +127,21 @@ class TestSignal : public KConfigSkeleton
}
/**
+ Is Absolute path to a directory containing a Adium/Kopete chat window style. Immutable
+ */
+ static
+ bool isStylePathImmutable()
+ {
+ return self()->isImmutable( QStringLiteral( "stylePath" ) );
+ }
+
+ /**
Set Relative path to a CSS variant for the current style.
*/
static
void setStyleCSSVariant( const QString & v )
{
- if (!self()->isImmutable( QStringLiteral( "StyleCSSVariant" ) ))
+ if (!self()->isStyleCSSVariantImmutable())
self()->mStyleCSSVariant = v;
}
@@ -118,6 +154,15 @@ class TestSignal : public KConfigSkeleton
return self()->mStyleCSSVariant;
}
+ /**
+ Is Relative path to a CSS variant for the current style. Immutable
+ */
+ static
+ bool isStyleCSSVariantImmutable()
+ {
+ return self()->isImmutable( QStringLiteral( "StyleCSSVariant" ) );
+ }
+
enum {
signalEmoticonSettingsChanged = 0x1,