Merge pull request #1661 from teeberg/style

Work on codestyle and readability
This commit is contained in:
Lukas W
2015-01-21 14:19:45 +01:00
8 changed files with 96 additions and 102 deletions

View File

@@ -295,7 +295,7 @@ private:
int m_oldNotesEditHeight;
int m_notesEditHeight;
int m_ppt;
int m_ppt; // pixels per tact
int m_totalKeysToScroll;
// remember these values to use them

View File

@@ -134,7 +134,7 @@ public:
const Plugin::PluginTypes m_type;
} ;
SubPluginFeatures * subPluginFeatures;
SubPluginFeatures *subPluginFeatures;
} ;
@@ -148,7 +148,9 @@ public:
// returns display-name out of descriptor
virtual QString displayName() const
{
return Model::displayName().isEmpty() ? m_descriptor->displayName : Model::displayName();
return Model::displayName().isEmpty()
? m_descriptor->displayName
: Model::displayName();
}
// return plugin-type
@@ -173,13 +175,13 @@ public:
// returns an instance of a plugin whose name matches to given one
// if specified plugin couldn't be loaded, it creates a dummy-plugin
static Plugin * instantiate( const QString& pluginName, Model * parent, void * data );
static Plugin * instantiate( const QString& pluginName, Model *parent, void * data );
// fills given list with descriptors of all available plugins
static void getDescriptorsOfAvailPlugins( DescriptorList& pluginDescriptors );
// create a view for the model
PluginView * createView( QWidget* parent );
PluginView* createView( QWidget* parent );
protected:

View File

@@ -78,9 +78,9 @@ struct typeInfo
return 1;
}
static inline bool isEqual( T _x, T _y )
static inline bool isEqual( T x, T y )
{
return _x == _y;
return x == y;
}
static inline T absVal( T t )
@@ -97,13 +97,13 @@ inline float typeInfo<float>::minEps()
}
template<>
inline bool typeInfo<float>::isEqual( float _x, float _y )
inline bool typeInfo<float>::isEqual( float x, float y )
{
if( likely( _x == _y ) )
if( x == y )
{
return true;
}
return absVal( _x - _y ) < minEps();
return absVal( x - y ) < minEps();
}