Commit ae29f020 authored by Antoine Regimbeau's avatar Antoine Regimbeau

Merge branch 'mvd_delete_layer' into 'release-6.6'

Monteverdi Delete Layer

See merge request !116
parents 89807055 1dee6eb8
......@@ -212,6 +212,7 @@ public:
// Public SLOTS.
public slots:
void Clear();
void Deleting( unsigned int index );
inline void Delete( const KeyType & );
inline void DeleteCurrent();
inline void LowerCurrent();
......
......@@ -220,9 +220,9 @@ StackedLayerModel
/*****************************************************************************/
void
StackedLayerModel
::Delete( SizeType index )
::Deleting( unsigned int index )
{
// qDebug() << this << "::Delete(" << index << ")";
// qDebug() << this << "::Delete(" << index << ")";
//
......@@ -297,7 +297,7 @@ StackedLayerModel
index>m_Reference
? m_Reference
: ( m_Reference > 0
? m_Reference - 1
? m_Reference - 1
: GetCount() > 0 ? 0 : StackedLayerModel::NIL_INDEX ),
true
);
......@@ -309,8 +309,14 @@ StackedLayerModel
delete layer;
layer = NULL;
}
}
//
void
StackedLayerModel
::Delete( SizeType index )
{
// the work of deleting model is now done in the above function
// Deleting(unsigned int index)
// Emit signals.
emit LayerDeleted( index );
emit ContentChanged();
......
......@@ -255,6 +255,9 @@ public slots:
//
// Signals.
signals:
//Bugfix for layer deletion
void LayerDeletingModel( unsigned int index);
/*-[ PROTECTED SECTION ]---------------------------------------------------*/
......
......@@ -159,6 +159,10 @@ public slots:
//
// Signals.
signals:
/**
*/
//bugFix for layer deletion
void LayerDeletingWidget( unsigned int index );
/**
*/
void CurrentChanged( int );
......
......@@ -150,6 +150,14 @@ LayerStackController
SLOT( OnProjectionButtonClicked() )
);
//bugfix for layer deletion
QObject::connect(
widget,
SIGNAL( LayerDeletingWidget( unsigned int ) ),
// to:
model,
SLOT( Deleting( unsigned int ) )
);
QObject::connect(
widget,
......@@ -243,7 +251,7 @@ LayerStackController
QObject::disconnect(
model,
SIGNAL( CurrentChanged( size_t ) ),
// from:
// from:deletin
this,
SLOT( OnStackedLayerCurrentChanged( size_t ) )
);
......@@ -289,6 +297,14 @@ LayerStackController
SLOT( OnProjectionButtonClicked() )
);
//Bugfix for layer deletion
QObject::disconnect(
widget,
SIGNAL( LayerDeletingWidget( unsigned int ) ),
// to:
model,
SLOT( Deleting( unsigned int ) )
);
QObject::disconnect(
widget,
......
......@@ -791,10 +791,11 @@ LayerStackItemModel
beginRemoveRows( p, row, row + count - 1 );
{
// StackedLayerModel has already been shortened.
// StackedLayerModel need to be shortened now
emit LayerDeletingModel(row);
// TODO: Release additional row data here.
}
endRemoveRows();
return true;
......
......@@ -192,6 +192,16 @@ LayerStackWidget
this,
SIGNAL( ResetEffectsButtonClicked() )
);
/////// Bugfix for layer deletion
QObject::connect(
this->GetItemModel(),
SIGNAL( LayerDeletingModel( unsigned int ) ),
// to:
this,
SIGNAL( LayerDeletingWidget( unsigned int) )
);
///////////////
}
/*******************************************************************************/
......
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