From 6f5a47342bdcbdf37b83839e88fa605ad6fb886d Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Fri, 21 Mar 2014 10:43:07 +0100 Subject: [PATCH] AutomatableModel: coding style improvements --- include/AutomatableModel.h | 42 +++++++++++++++++------------------ src/core/AutomatableModel.cpp | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index 40a4484ba..59fee5215 100644 --- a/include/AutomatableModel.h +++ b/include/AutomatableModel.h @@ -22,8 +22,8 @@ * */ -#ifndef _AUTOMATABLE_MODEL_H -#define _AUTOMATABLE_MODEL_H +#ifndef AUTOMATABLE_MODEL_H +#define AUTOMATABLE_MODEL_H #include @@ -34,24 +34,24 @@ // simple way to map a property of a view to a model #define mapPropertyFromModelPtr(type,getfunc,setfunc,modelname) \ public: \ - inline type getfunc() const \ + type getfunc() const \ { \ return (type) modelname->value(); \ } \ public slots: \ - inline void setfunc( const type val ) \ + void setfunc( const type val ) \ { \ modelname->setValue( val ); \ } #define mapPropertyFromModel(type,getfunc,setfunc,modelname) \ public: \ - inline type getfunc() const \ + type getfunc() const \ { \ return (type) modelname.value(); \ } \ public slots: \ - inline void setfunc( const type val ) \ + void setfunc( const type val ) \ { \ modelname.setValue( (float) val ); \ } @@ -80,8 +80,8 @@ public: const float max = 0, const float step = 0, Model* parent = NULL, - const QString& display_name = QString(), - bool default_constructed = false ); + const QString& displayName = QString(), + bool defaultConstructed = false ); virtual ~AutomatableModel(); @@ -93,7 +93,7 @@ public: bool isAutomated() const; - inline ControllerConnection* controllerConnection() const + ControllerConnection* controllerConnection() const { return m_controllerConnection; } @@ -103,13 +103,13 @@ public: template - static inline T castValue( const float v ) + static T castValue( const float v ) { return (T)( v ); } template - static inline bool castValue( const float v ) + static bool castValue( const float v ) { return ( qRound( v ) != 0 ); } @@ -130,7 +130,7 @@ public: template - inline T initValue() const + T initValue() const { return castValue( m_initValue ); } @@ -141,19 +141,19 @@ public: } template - inline T minValue() const + T minValue() const { return castValue( m_minValue ); } template - inline T maxValue() const + T maxValue() const { return castValue( m_maxValue ); } template - inline T step() const + T step() const { return castValue( m_step ); } @@ -164,12 +164,12 @@ public: void setAutomatedValue( const float value ); void setValue( const float value ); - inline void incValue( int steps ) + void incValue( int steps ) { setValue( m_value + steps * m_step ); } - inline float range() const + float range() const { return m_range; } @@ -280,22 +280,22 @@ signals: #define defaultTypedMethods(type) \ - inline type value( int frameOffset = 0 ) const \ + type value( int frameOffset = 0 ) const \ { \ return AutomatableModel::value( frameOffset ); \ } \ \ - inline type initValue() const \ + type initValue() const \ { \ return AutomatableModel::initValue(); \ } \ \ - inline type minValue() const \ + type minValue() const \ { \ return AutomatableModel::minValue(); \ } \ \ - inline type maxValue() const \ + type maxValue() const \ { \ return AutomatableModel::maxValue(); \ } \ diff --git a/src/core/AutomatableModel.cpp b/src/core/AutomatableModel.cpp index 7dbd752d5..671fb5aa7 100644 --- a/src/core/AutomatableModel.cpp +++ b/src/core/AutomatableModel.cpp @@ -495,7 +495,7 @@ void AutomatableModel::copyValue() -void AutomatableModel::pasteValue() +void AutomatableModel::pasteValue() { setValue( copiedValue() ); }