moved displayName-property from automatableModel to model base-class

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1322 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-07-18 10:05:56 +00:00
parent 3b3a8afe6b
commit 0de1e6ffd3
3 changed files with 11 additions and 21 deletions

View File

@@ -210,18 +210,6 @@ public:
}
virtual QString displayName( void ) const
{
return m_displayName;
}
virtual void setDisplayName( const QString & _display_name )
{
m_displayName = _display_name;
}
public slots:
virtual void reset( void );
virtual void copyValue( void );
@@ -248,9 +236,9 @@ private:
float m_step;
float m_range;
// most objects will need this temporarily (until sampleExact is standard)
// most objects will need this temporarily (until sampleExact is
// standard)
float m_oldValue;
QString m_displayName;
bool m_journalEntryReady;
autoModelVector m_linkedModels;
@@ -324,8 +312,7 @@ public:
class boolModel : public automatableModel
{
public:
boolModel( const bool _val = FALSE,
::model * _parent = NULL,
boolModel( const bool _val = FALSE, ::model * _parent = NULL,
const QString & _display_name = QString::null,
bool _default_constructed = FALSE ) :
automatableModel( Bool, _val, FALSE, TRUE, 1,

View File

@@ -39,8 +39,10 @@ class EXPORT model : public QObject
{
Q_OBJECT
public:
model( model * _parent, bool _default_constructed = FALSE ) :
model( model * _parent, QString _display_name = QString::null,
bool _default_constructed = FALSE ) :
QObject( _parent ),
m_displayName( _display_name ),
m_defaultConstructed( _default_constructed )
{
}
@@ -61,16 +63,18 @@ public:
virtual QString displayName( void ) const
{
return QString();
return m_displayName;
}
void setDisplayName( const QString & _displayName )
virtual void setDisplayName( const QString & _display_name )
{
m_displayName = _display_name;
}
virtual QString fullDisplayName( void ) const;
private:
QString m_displayName;
bool m_defaultConstructed;
signals:

View File

@@ -52,7 +52,7 @@ automatableModel::automatableModel( DataType _type,
::model * _parent,
const QString & _display_name,
bool _default_constructed ) :
model( _parent, _default_constructed ),
model( _parent, _display_name, _default_constructed ),
m_dataType( _type ),
m_value( _val ),
m_initValue( _val ),
@@ -60,7 +60,6 @@ automatableModel::automatableModel( DataType _type,
m_maxValue( _max ),
m_step( _step ),
m_range( _max - _min ),
m_displayName( _display_name ),
m_journalEntryReady( FALSE ),
m_controllerConnection( NULL )
{