Commit 675ab36a authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark
Browse files

minor cleanup

parent 8c091585
......@@ -37,9 +37,9 @@ SimpleActionData::SimpleActionData(
parent_P,
name_P,
comment_P,
0,
nullptr,
new Condition_list( "", this ),
0)
nullptr)
{}
......@@ -93,23 +93,23 @@ void SimpleActionData::set_trigger( Trigger* trigger_P )
const Action* SimpleActionData::action() const
{
if( actions() == 0 || actions()->isEmpty() )
return 0;
if( actions() == nullptr || actions()->isEmpty() )
return nullptr;
return actions()->first();
}
Action* SimpleActionData::action()
{
if( actions() == 0 || actions()->isEmpty() )
return 0;
if( actions() == nullptr || actions()->isEmpty() )
return nullptr;
return actions()->first();
}
const Trigger* SimpleActionData::trigger() const
{
if( triggers() == 0 || triggers()->isEmpty() )
if( triggers() == nullptr || triggers()->isEmpty() )
return nullptr;
return triggers()->first();
......@@ -118,7 +118,7 @@ const Trigger* SimpleActionData::trigger() const
Trigger* SimpleActionData::trigger()
{
if( triggers() == 0 || triggers()->isEmpty() )
if( triggers() == nullptr || triggers()->isEmpty() )
return nullptr;
return triggers()->first();
......
......@@ -34,8 +34,8 @@ public:
* Visitor pattern
* @reimp
*/
virtual void accept(ActionDataVisitor *visitor);
virtual void accept(ActionDataConstVisitor *visitor) const;
void accept(ActionDataVisitor *visitor) override;
void accept(ActionDataConstVisitor *visitor) const override;
//! The action associated with this hotkey
virtual const Action* action() const;
......@@ -76,12 +76,12 @@ class Q_DECL_EXPORT SimpleActionDataHelper
{}
//! The action associated with this hotkey
const A* action() const;
A* action();
const A* action() const override;
A* action() override;
//! The trigger for this hotkey
const T* trigger() const;
T* trigger();
const T* trigger() const override;
T* trigger() override;
void set_action( Action *action_P );
void set_trigger( Trigger *trigger_P );
......@@ -109,32 +109,32 @@ void SimpleActionDataHelper< T, A >::set_trigger( Trigger* trigger_P )
template< typename T, typename A >
const A* SimpleActionDataHelper< T, A >::action() const
{
if( actions() == 0 || actions()->isEmpty() )
return 0;
if( actions() == nullptr || actions()->isEmpty() )
return nullptr;
return dynamic_cast< const A* >( actions()->first());
}
template< typename T, typename A >
A* SimpleActionDataHelper< T, A >::action()
{
if( actions() == 0 || actions()->isEmpty() )
return 0;
if( actions() == nullptr || actions()->isEmpty() )
return nullptr;
return dynamic_cast< A* >(actions()->first());
}
template< typename T, typename A >
const T* SimpleActionDataHelper< T, A >::trigger() const
{
if( triggers() == 0 || triggers()->isEmpty() )
return 0;
if( triggers() == nullptr || triggers()->isEmpty() )
return nullptr;
return dynamic_cast< const T* >( triggers()->first());
}
template< typename T, typename A >
T* SimpleActionDataHelper< T, A >::trigger()
{
if( triggers() == 0 || triggers()->isEmpty() )
return 0;
if( triggers() == nullptr || triggers()->isEmpty() )
return nullptr;
return dynamic_cast< T* >( triggers()->first());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment