diff options
author | Méven Car <meven.car@enioka.com> | 2020-02-04 16:03:52 +0100 |
---|---|---|
committer | Méven Car <meven29@gmail.com> | 2020-02-04 16:09:29 +0100 |
commit | d46739294d04c72af1e434e414e1c012d7e78a42 (patch) | |
tree | 5a227069a6a1a110cc26b788ff8a3bd99005735e /autotests/kconfig_compiler/test_dpointer.h.ref | |
parent | fd0e26ddb49122fa55bdc8f35e189c832cc138ad (diff) | |
download | kconfig-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_dpointer.h.ref')
-rw-r--r-- | autotests/kconfig_compiler/test_dpointer.h.ref | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/autotests/kconfig_compiler/test_dpointer.h.ref b/autotests/kconfig_compiler/test_dpointer.h.ref index 04938566..a0886a07 100644 --- a/autotests/kconfig_compiler/test_dpointer.h.ref +++ b/autotests/kconfig_compiler/test_dpointer.h.ref @@ -34,6 +34,12 @@ class TestDPointer : public KConfigSkeleton bool autoSave(); /** + Is Enable automatic saving of calendar Immutable + */ + static + bool isAutoSaveImmutable(); + + /** Get Item object corresponding to AutoSave() */ ItemBool *autoSaveItem(); @@ -51,6 +57,12 @@ class TestDPointer : public KConfigSkeleton int autoSaveInterval(); /** + Is Auto Save Interval Immutable + */ + static + bool isAutoSaveIntervalImmutable(); + + /** Get Item object corresponding to AutoSaveInterval() */ ItemInt *autoSaveIntervalItem(); @@ -68,6 +80,12 @@ class TestDPointer : public KConfigSkeleton bool confirm(); /** + Is Confirm deletes Immutable + */ + static + bool isConfirmImmutable(); + + /** Get Item object corresponding to Confirm() */ ItemBool *confirmItem(); @@ -85,6 +103,12 @@ class TestDPointer : public KConfigSkeleton QString archiveFile(); /** + Is Archive File Immutable + */ + static + bool isArchiveFileImmutable(); + + /** Get Item object corresponding to ArchiveFile() */ ItemString *archiveFileItem(); @@ -102,6 +126,12 @@ class TestDPointer : public KConfigSkeleton int destination(); /** + Is New Events/Todos Should Immutable + */ + static + bool isDestinationImmutable(); + + /** Get Item object corresponding to Destination() */ ItemEnum *destinationItem(); @@ -119,6 +149,12 @@ class TestDPointer : public KConfigSkeleton int hourSize(); /** + Is Hour Size Immutable + */ + static + bool isHourSizeImmutable(); + + /** Get Item object corresponding to HourSize() */ ItemInt *hourSizeItem(); @@ -136,6 +172,12 @@ class TestDPointer : public KConfigSkeleton bool selectionStartsEditor(); /** + Is Time range selection in agenda view starts event editor Immutable + */ + static + bool isSelectionStartsEditorImmutable(); + + /** Get Item object corresponding to SelectionStartsEditor() */ ItemBool *selectionStartsEditorItem(); @@ -153,6 +195,12 @@ class TestDPointer : public KConfigSkeleton QStringList selectedPlugins(); /** + Is SelectedPlugins Immutable + */ + static + bool isSelectedPluginsImmutable(); + + /** Get Item object corresponding to SelectedPlugins() */ ItemStringList *selectedPluginsItem(); @@ -170,6 +218,12 @@ class TestDPointer : public KConfigSkeleton QColor highlightColor(); /** + Is Highlight color Immutable + */ + static + bool isHighlightColorImmutable(); + + /** Get Item object corresponding to HighlightColor() */ ItemColor *highlightColorItem(); @@ -187,6 +241,12 @@ class TestDPointer : public KConfigSkeleton QColor agendaBgColor(); /** + Is Agenda view background color Immutable + */ + static + bool isAgendaBgColorImmutable(); + + /** Get Item object corresponding to AgendaBgColor() */ ItemColor *agendaBgColorItem(); @@ -204,6 +264,12 @@ class TestDPointer : public KConfigSkeleton QFont timeBarFont(); /** + Is Time bar Immutable + */ + static + bool isTimeBarFontImmutable(); + + /** Get Item object corresponding to TimeBarFont() */ ItemFont *timeBarFontItem(); |