aboutsummaryrefslogtreecommitdiff
path: root/autotests/kconfig_compiler/test2.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/test2.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/test2.h.ref')
-rw-r--r--autotests/kconfig_compiler/test2.h.ref110
1 files changed, 99 insertions, 11 deletions
diff --git a/autotests/kconfig_compiler/test2.h.ref b/autotests/kconfig_compiler/test2.h.ref
index ce7ff259..75d850d7 100644
--- a/autotests/kconfig_compiler/test2.h.ref
+++ b/autotests/kconfig_compiler/test2.h.ref
@@ -23,7 +23,7 @@ class Test2 : public MyPrefs
*/
void setAutoSave( bool v )
{
- if (!isImmutable( QStringLiteral( "AutoSave" ) ))
+ if (!isAutoSaveImmutable())
mAutoSave = v;
}
@@ -36,6 +36,14 @@ class Test2 : public MyPrefs
}
/**
+ Is Enable automatic saving of calendar Immutable
+ */
+ bool isAutoSaveImmutable() const
+ {
+ return isImmutable( QStringLiteral( "AutoSave" ) );
+ }
+
+ /**
Get Item object corresponding to AutoSave()
*/
ItemBool *autoSaveItem()
@@ -48,7 +56,7 @@ class Test2 : public MyPrefs
*/
void setAutoSaveInterval( int v )
{
- if (!isImmutable( QStringLiteral( "AutoSaveInterval" ) ))
+ if (!isAutoSaveIntervalImmutable())
mAutoSaveInterval = v;
}
@@ -61,6 +69,14 @@ class Test2 : public MyPrefs
}
/**
+ Is Auto Save Interval Immutable
+ */
+ bool isAutoSaveIntervalImmutable() const
+ {
+ return isImmutable( QStringLiteral( "AutoSaveInterval" ) );
+ }
+
+ /**
Get Item object corresponding to AutoSaveInterval()
*/
ItemInt *autoSaveIntervalItem()
@@ -73,7 +89,7 @@ class Test2 : public MyPrefs
*/
void setConfirm( bool v )
{
- if (!isImmutable( QStringLiteral( "Confirm" ) ))
+ if (!isConfirmImmutable())
mConfirm = v;
}
@@ -86,6 +102,14 @@ class Test2 : public MyPrefs
}
/**
+ Is Confirm deletes Immutable
+ */
+ bool isConfirmImmutable() const
+ {
+ return isImmutable( QStringLiteral( "Confirm" ) );
+ }
+
+ /**
Get Item object corresponding to Confirm()
*/
ItemBool *confirmItem()
@@ -98,7 +122,7 @@ class Test2 : public MyPrefs
*/
void setArchiveFile( const QString & v )
{
- if (!isImmutable( QStringLiteral( "ArchiveFile" ) ))
+ if (!isArchiveFileImmutable())
mArchiveFile = v;
}
@@ -111,6 +135,14 @@ class Test2 : public MyPrefs
}
/**
+ Is Archive File Immutable
+ */
+ bool isArchiveFileImmutable() const
+ {
+ return isImmutable( QStringLiteral( "ArchiveFile" ) );
+ }
+
+ /**
Get Item object corresponding to ArchiveFile()
*/
ItemString *archiveFileItem()
@@ -123,7 +155,7 @@ class Test2 : public MyPrefs
*/
void setDestination( int v )
{
- if (!isImmutable( QStringLiteral( "Destination" ) ))
+ if (!isDestinationImmutable())
mDestination = v;
}
@@ -136,6 +168,14 @@ class Test2 : public MyPrefs
}
/**
+ Is New Events/Todos Should Immutable
+ */
+ bool isDestinationImmutable() const
+ {
+ return isImmutable( QStringLiteral( "Destination" ) );
+ }
+
+ /**
Get Item object corresponding to Destination()
*/
ItemEnum *destinationItem()
@@ -148,7 +188,7 @@ class Test2 : public MyPrefs
*/
void setHourSize( int v )
{
- if (!isImmutable( QStringLiteral( "HourSize" ) ))
+ if (!isHourSizeImmutable())
mHourSize = v;
}
@@ -161,6 +201,14 @@ class Test2 : public MyPrefs
}
/**
+ Is Hour Size Immutable
+ */
+ bool isHourSizeImmutable() const
+ {
+ return isImmutable( QStringLiteral( "HourSize" ) );
+ }
+
+ /**
Get Item object corresponding to HourSize()
*/
ItemInt *hourSizeItem()
@@ -173,7 +221,7 @@ class Test2 : public MyPrefs
*/
void setSelectionStartsEditor( bool v )
{
- if (!isImmutable( QStringLiteral( "SelectionStartsEditor" ) ))
+ if (!isSelectionStartsEditorImmutable())
mSelectionStartsEditor = v;
}
@@ -186,6 +234,14 @@ class Test2 : public MyPrefs
}
/**
+ Is Time range selection in agenda view starts event editor Immutable
+ */
+ bool isSelectionStartsEditorImmutable() const
+ {
+ return isImmutable( QStringLiteral( "SelectionStartsEditor" ) );
+ }
+
+ /**
Get Item object corresponding to SelectionStartsEditor()
*/
ItemBool *selectionStartsEditorItem()
@@ -198,7 +254,7 @@ class Test2 : public MyPrefs
*/
void setSelectedPlugins( const QStringList & v )
{
- if (!isImmutable( QStringLiteral( "SelectedPlugins" ) ))
+ if (!isSelectedPluginsImmutable())
mSelectedPlugins = v;
}
@@ -211,6 +267,14 @@ class Test2 : public MyPrefs
}
/**
+ Is SelectedPlugins Immutable
+ */
+ bool isSelectedPluginsImmutable() const
+ {
+ return isImmutable( QStringLiteral( "SelectedPlugins" ) );
+ }
+
+ /**
Get Item object corresponding to SelectedPlugins()
*/
ItemStringList *selectedPluginsItem()
@@ -223,7 +287,7 @@ class Test2 : public MyPrefs
*/
void setHighlightColor( const QColor & v )
{
- if (!isImmutable( QStringLiteral( "HighlightColor" ) ))
+ if (!isHighlightColorImmutable())
mHighlightColor = v;
}
@@ -236,6 +300,14 @@ class Test2 : public MyPrefs
}
/**
+ Is Highlight color Immutable
+ */
+ bool isHighlightColorImmutable() const
+ {
+ return isImmutable( QStringLiteral( "HighlightColor" ) );
+ }
+
+ /**
Get Item object corresponding to HighlightColor()
*/
ItemColor *highlightColorItem()
@@ -248,7 +320,7 @@ class Test2 : public MyPrefs
*/
void setAgendaBgColor( const QColor & v )
{
- if (!isImmutable( QStringLiteral( "AgendaBgColor" ) ))
+ if (!isAgendaBgColorImmutable())
mAgendaBgColor = v;
}
@@ -261,6 +333,14 @@ class Test2 : public MyPrefs
}
/**
+ Is Agenda view background color Immutable
+ */
+ bool isAgendaBgColorImmutable() const
+ {
+ return isImmutable( QStringLiteral( "AgendaBgColor" ) );
+ }
+
+ /**
Get Item object corresponding to AgendaBgColor()
*/
ItemColor *agendaBgColorItem()
@@ -273,7 +353,7 @@ class Test2 : public MyPrefs
*/
void setTimeBarFont( const QFont & v )
{
- if (!isImmutable( QStringLiteral( "TimeBarFont" ) ))
+ if (!isTimeBarFontImmutable())
mTimeBarFont = v;
}
@@ -286,6 +366,14 @@ class Test2 : public MyPrefs
}
/**
+ Is Time bar Immutable
+ */
+ bool isTimeBarFontImmutable() const
+ {
+ return isImmutable( QStringLiteral( "TimeBarFont" ) );
+ }
+
+ /**
Get Item object corresponding to TimeBarFont()
*/
ItemFont *timeBarFontItem()