~kalikiana/unity-action-api/cutedocs

« back to all changes in this revision

Viewing changes to src/unity-action.cpp

  • Committer: Antti Kaijanmäki
  • Date: 2013-07-12 12:56:59 UTC
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: antti.kaijanmaki@canonical.com-20130712125659-2x7vyhs6d5gbwiwm
Action::trigger() must check the enabled property.

Show diffs side-by-side

added added

removed removed

Lines of Context:
391
391
    emit parameterTypeChanged(value);
392
392
}
393
393
 
 
394
/*!
 
395
 * Checks the value agains parameterType and triggers the action.
 
396
 *
 
397
 * if paramType is Action::None the action can be triggered by simly calling:
 
398
 * \code
 
399
 *     action->trigger();
 
400
 * \endcode
 
401
 *
 
402
 * \note beware of the automatic conversion QVariant does. See the
 
403
 *       QVariant documentation for details.
 
404
 */
394
405
void
395
406
Action::trigger(QVariant value)
396
407
{
397
408
    QMetaType::Type targetType = QMetaType::UnknownType;
398
409
 
 
410
    if (!d->enabled) {
 
411
        return;
 
412
    }
 
413
 
399
414
    switch (d->parameterType) {
400
415
    case None: {
401
416
        break;