Skip to content

Commit

Permalink
document parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Feb 23, 2018
1 parent 1875d4a commit 55a8d41
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/qgsaction.h
Expand Up @@ -57,6 +57,7 @@ class CORE_EXPORT QgsAction
* \param description A human readable description string
* \param command The action text. Its interpretation depends on the type
* \param capture If this is set to true, the output will be captured when an action is run
* \param enabledOnlyWhenEditable if true then action is only enable in editmode
*/
QgsAction( ActionType type, const QString &description, const QString &command, bool capture = false, bool enabledOnlyWhenEditable = false )
: mType( type )
Expand All @@ -78,6 +79,7 @@ class CORE_EXPORT QgsAction
* \param shortTitle A short string used to label user interface elements like buttons
* \param actionScopes A set of scopes in which this action will be available
* \param notificationMessage A particular message which reception will trigger the action
* \param enabledOnlyWhenEditable if true then action is only enable in editmode
*/
QgsAction( ActionType type, const QString &description, const QString &action, const QString &icon, bool capture, const QString &shortTitle = QString(), const QSet<QString> &actionScopes = QSet<QString>(), const QString &notificationMessage = QString(), bool enabledOnlyWhenEditable = false )
: mType( type )
Expand Down

6 comments on commit 55a8d41

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@signedav looking really close - please don't forget to replace the bool enabledOnlyWhenEditable argument with a more flexible flags approach!

@signedav
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll need some more time for the flag approach. Is the total deadline for that reached in 3 minutes or should I do it this afternoon?

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you skip this bool from the python bindings then, so it's not locked into api and we can revise for 3.2?

@signedav
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the binding, sorry.
Is this the right approach?

    QgsAction( ActionType type, const QString &description, const QString &command, bool capture = false, bool enabledOnlyWhenEditable SIP_PYARGREMOVE = false )

And is it sufficient to do it only in the constructors of QgsAction and QgsMapLayerAction or is it needed in every method?

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case you'd do something like

#ifndef SIP_RUN
...original declaration
#else
...declaration missing extra Param
#endif

Then run sipify and the python bindings should be missing the extra argument. I'd just do it for all the constructors with the bool argument.

@signedav
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I'll try that. Thanks.

Please sign in to comment.