D26368: Add an is<PropertyName>Immutable to know if a property is immutable

Méven Car noreply at phabricator.kde.org
Thu Jan 2 14:46:50 GMT 2020


meven created this revision.
meven added reviewers: ervin, Frameworks.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
meven requested review of this revision.

REVISION 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;
    }

REPOSITORY
  R237 KConfig

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D26368

AFFECTED FILES
  src/kconfig_compiler/kconfig_compiler.cpp

To: meven, ervin, #frameworks
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200102/5a1d80bc/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list