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/test11a.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/test11a.h.ref')
-rw-r--r-- | autotests/kconfig_compiler/test11a.h.ref | 150 |
1 files changed, 135 insertions, 15 deletions
diff --git a/autotests/kconfig_compiler/test11a.h.ref b/autotests/kconfig_compiler/test11a.h.ref index 62b59381..014501cd 100644 --- a/autotests/kconfig_compiler/test11a.h.ref +++ b/autotests/kconfig_compiler/test11a.h.ref @@ -30,7 +30,7 @@ class Test11a : public MyPrefs */ void setAutoSave( bool v ) { - if (!isImmutable( QStringLiteral( "AutoSave" ) )) + if (!isAutoSaveImmutable()) mAutoSave = v; } @@ -43,6 +43,14 @@ class Test11a : public MyPrefs } /** + Is Enable automatic saving of calendar Immutable + */ + bool isAutoSaveImmutable() const + { + return isImmutable( QStringLiteral( "AutoSave" ) ); + } + + /** Get Item object corresponding to AutoSave() */ ItemBool *autoSaveItem() @@ -55,7 +63,7 @@ class Test11a : public MyPrefs */ void setAutoSaveInterval( int v ) { - if (!isImmutable( QStringLiteral( "AutoSaveInterval" ) )) + if (!isAutoSaveIntervalImmutable()) mAutoSaveInterval = v; } @@ -68,6 +76,14 @@ class Test11a : public MyPrefs } /** + Is Auto Save Interval Immutable + */ + bool isAutoSaveIntervalImmutable() const + { + return isImmutable( QStringLiteral( "AutoSaveInterval" ) ); + } + + /** Get Item object corresponding to AutoSaveInterval() */ ItemInt *autoSaveIntervalItem() @@ -80,7 +96,7 @@ class Test11a : public MyPrefs */ void setConfirm( bool v ) { - if (!isImmutable( QStringLiteral( "Confirm" ) )) + if (!isConfirmImmutable()) mConfirm = v; } @@ -93,6 +109,14 @@ class Test11a : public MyPrefs } /** + Is Confirm deletes Immutable + */ + bool isConfirmImmutable() const + { + return isImmutable( QStringLiteral( "Confirm" ) ); + } + + /** Get Item object corresponding to Confirm() */ ItemBool *confirmItem() @@ -105,7 +129,7 @@ class Test11a : public MyPrefs */ void setArchiveFile( const QString & v ) { - if (!isImmutable( QStringLiteral( "ArchiveFile" ) )) + if (!isArchiveFileImmutable()) mArchiveFile = v; } @@ -118,6 +142,14 @@ class Test11a : public MyPrefs } /** + Is Archive File Immutable + */ + bool isArchiveFileImmutable() const + { + return isImmutable( QStringLiteral( "ArchiveFile" ) ); + } + + /** Get Item object corresponding to ArchiveFile() */ ItemString *archiveFileItem() @@ -130,7 +162,7 @@ class Test11a : public MyPrefs */ void setDestination( EnumDestination::type v ) { - if (!isImmutable( QStringLiteral( "Destination" ) )) + if (!isDestinationImmutable()) mDestination = v; } @@ -143,6 +175,14 @@ class Test11a : public MyPrefs } /** + Is New Events/Todos Should Immutable + */ + bool isDestinationImmutable() const + { + return isImmutable( QStringLiteral( "Destination" ) ); + } + + /** Get New Events/Todos Should default value */ EnumDestination::type defaultDestinationValue() const @@ -163,7 +203,7 @@ class Test11a : public MyPrefs */ void setHourSize( int v ) { - if (!isImmutable( QStringLiteral( "HourSize" ) )) + if (!isHourSizeImmutable()) mHourSize = v; } @@ -176,6 +216,14 @@ class Test11a : public MyPrefs } /** + Is Hour Size Immutable + */ + bool isHourSizeImmutable() const + { + return isImmutable( QStringLiteral( "HourSize" ) ); + } + + /** Get Item object corresponding to HourSize() */ ItemInt *hourSizeItem() @@ -188,7 +236,7 @@ class Test11a : public MyPrefs */ void setSelectionStartsEditor( bool v ) { - if (!isImmutable( QStringLiteral( "SelectionStartsEditor" ) )) + if (!isSelectionStartsEditorImmutable()) mSelectionStartsEditor = v; } @@ -201,6 +249,14 @@ class Test11a : public MyPrefs } /** + Is Time range selection in agenda view starts event editor Immutable + */ + bool isSelectionStartsEditorImmutable() const + { + return isImmutable( QStringLiteral( "SelectionStartsEditor" ) ); + } + + /** Get Time range selection in agenda view starts event editor default value */ bool defaultSelectionStartsEditorValue() const @@ -221,7 +277,7 @@ class Test11a : public MyPrefs */ void setSelectedPlugins( const QStringList & v ) { - if (!isImmutable( QStringLiteral( "SelectedPlugins" ) )) + if (!isSelectedPluginsImmutable()) mSelectedPlugins = v; } @@ -234,6 +290,14 @@ class Test11a : public MyPrefs } /** + Is SelectedPlugins Immutable + */ + bool isSelectedPluginsImmutable() const + { + return isImmutable( QStringLiteral( "SelectedPlugins" ) ); + } + + /** Get Item object corresponding to SelectedPlugins() */ ItemStringList *selectedPluginsItem() @@ -246,7 +310,7 @@ class Test11a : public MyPrefs */ void setHighlightColor( const QColor & v ) { - if (!isImmutable( QStringLiteral( "HighlightColor" ) )) + if (!isHighlightColorImmutable()) mHighlightColor = v; } @@ -259,6 +323,14 @@ class Test11a : public MyPrefs } /** + Is Highlight color Immutable + */ + bool isHighlightColorImmutable() const + { + return isImmutable( QStringLiteral( "HighlightColor" ) ); + } + + /** Get Item object corresponding to HighlightColor() */ ItemColor *highlightColorItem() @@ -271,7 +343,7 @@ class Test11a : public MyPrefs */ void setAgendaBgColor( const QColor & v ) { - if (!isImmutable( QStringLiteral( "AgendaBgColor" ) )) + if (!isAgendaBgColorImmutable()) mAgendaBgColor = v; } @@ -284,6 +356,14 @@ class Test11a : public MyPrefs } /** + Is Agenda view background color Immutable + */ + bool isAgendaBgColorImmutable() const + { + return isImmutable( QStringLiteral( "AgendaBgColor" ) ); + } + + /** Get Item object corresponding to AgendaBgColor() */ ItemColor *agendaBgColorItem() @@ -296,7 +376,7 @@ class Test11a : public MyPrefs */ void setTimeBarFont( const QFont & v ) { - if (!isImmutable( QStringLiteral( "TimeBarFont" ) )) + if (!isTimeBarFontImmutable()) mTimeBarFont = v; } @@ -309,6 +389,14 @@ class Test11a : public MyPrefs } /** + Is Time bar Immutable + */ + bool isTimeBarFontImmutable() const + { + return isImmutable( QStringLiteral( "TimeBarFont" ) ); + } + + /** Get Item object corresponding to TimeBarFont() */ ItemFont *timeBarFontItem() @@ -321,7 +409,7 @@ class Test11a : public MyPrefs */ void setEmailClient( MailClient v ) { - if (!isImmutable( QStringLiteral( "EmailClient" ) )) + if (!isEmailClientImmutable()) mEmailClient = v; } @@ -334,6 +422,14 @@ class Test11a : public MyPrefs } /** + Is Email client Immutable + */ + bool isEmailClientImmutable() const + { + return isImmutable( QStringLiteral( "EmailClient" ) ); + } + + /** Get Item object corresponding to EmailClient() */ ItemEnum *emailClientItem() @@ -346,7 +442,7 @@ class Test11a : public MyPrefs */ void setDefaultReminderUnits( TimePeriod::Units v ) { - if (!isImmutable( QStringLiteral( "DefaultReminderUnits" ) )) + if (!isDefaultReminderUnitsImmutable()) mDefaultReminderUnits = v; } @@ -359,6 +455,14 @@ class Test11a : public MyPrefs } /** + Is Reminder units Immutable + */ + bool isDefaultReminderUnitsImmutable() const + { + return isImmutable( QStringLiteral( "DefaultReminderUnits" ) ); + } + + /** Get Reminder units default value */ TimePeriod::Units defaultDefaultReminderUnitsValue() const @@ -379,7 +483,7 @@ class Test11a : public MyPrefs */ void setQueueRate( int i, const QList<int> & v ) { - if (!isImmutable( QStringLiteral( "queueRate%1" ).arg( i ) )) + if (!isQueueRateImmutable( i )) mQueueRate[i] = v; } @@ -392,6 +496,14 @@ class Test11a : public MyPrefs } /** + Is EmptyingRate $(QueueIndex) Immutable + */ + bool isQueueRateImmutable( int i ) const + { + return isImmutable( QStringLiteral( "queueRate%1" ).arg( i ) ); + } + + /** Get Item object corresponding to queueRate() */ ItemIntList *queueRateItem( int i ) @@ -404,7 +516,7 @@ class Test11a : public MyPrefs */ void setShowQueueTuner( bool v ) { - if (!isImmutable( QStringLiteral( "ShowQueueTuner" ) )) + if (!isShowQueueTunerImmutable()) mShowQueueTuner = v; } @@ -417,6 +529,14 @@ class Test11a : public MyPrefs } /** + Is ShowQueueTuner Immutable + */ + bool isShowQueueTunerImmutable() const + { + return isImmutable( QStringLiteral( "ShowQueueTuner" ) ); + } + + /** Get Item object corresponding to ShowQueueTuner() */ ItemBool *showQueueTunerItem() |