Skip to content

Commit

Permalink
FIX,MAINT: Change Apply to View and Channel Selection deletion causin…
Browse files Browse the repository at this point in the history
…g crashing on exit. Removed debug statemnt.
  • Loading branch information
gabrielbmotta authored and LorenzE committed Aug 21, 2020
1 parent fadb815 commit 5f9ea80
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,27 +196,27 @@ void ChannelSelection::setFiffSettings(QSharedPointer<FIFFLIB::FiffInfo> pFiffIn
//First time set up only
m_pChannelInfoModel = QSharedPointer<DISPLIB::ChannelInfoModel>(new DISPLIB::ChannelInfoModel(m_pFiffInfo));

m_pChannelSelectionView = QSharedPointer<DISPLIB::ChannelSelectionView>(new DISPLIB::ChannelSelectionView(QString("MNEANALYZE/CHANSELECT"),
Q_NULLPTR,
m_pChannelInfoModel,
Qt::Window));
m_pChannelSelectionView = new DISPLIB::ChannelSelectionView(QString("MNEANALYZE/CHANSELECT"),
Q_NULLPTR,
m_pChannelInfoModel,
Qt::Window);

m_pViewLayout->addWidget(m_pChannelSelectionView->getViewWidget());
m_pControlLayout->addWidget(m_pChannelSelectionView->getControlWidget());

m_pApplyToView = QSharedPointer<DISPLIB::ApplyToView>(new DISPLIB::ApplyToView);
m_pApplyToView = new DISPLIB::ApplyToView("",m_pControlLayout->widget());

m_pControlLayout->addWidget(m_pApplyToView.data());
m_pControlLayout->addWidget(m_pApplyToView);

connect(m_pChannelSelectionView.data(), &DISPLIB::ChannelSelectionView::loadedLayoutMap,
connect(m_pChannelSelectionView, &DISPLIB::ChannelSelectionView::loadedLayoutMap,
m_pChannelInfoModel.data(), &DISPLIB::ChannelInfoModel::layoutChanged, Qt::UniqueConnection);

connect(m_pChannelInfoModel.data(), &DISPLIB::ChannelInfoModel::channelsMappedToLayout,
m_pChannelSelectionView.data(), &DISPLIB::ChannelSelectionView::setCurrentlyMappedFiffChannels, Qt::UniqueConnection);
m_pChannelSelectionView, &DISPLIB::ChannelSelectionView::setCurrentlyMappedFiffChannels, Qt::UniqueConnection);

//Slots for event loop

connect(m_pChannelSelectionView.data(), &DISPLIB::ChannelSelectionView::selectionChanged,
connect(m_pChannelSelectionView, &DISPLIB::ChannelSelectionView::selectionChanged,
this, &ChannelSelection::onSelectionChanged, Qt::UniqueConnection);

m_pChannelInfoModel->layoutChanged(m_pChannelSelectionView->getLayoutMap());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,12 @@ private slots:

DISPLIB::SelectionItem* m_pSelectionItem; /**< Stores parameters from list of QGraphicsItems received by channelselectionview */

QSharedPointer<DISPLIB::ChannelSelectionView> m_pChannelSelectionView; /**< View for selecting channels to be displayed */
QSharedPointer<DISPLIB::ApplyToView> m_pApplyToView;
DISPLIB::ChannelSelectionView* m_pChannelSelectionView; /**< View for selecting channels to be displayed */
QSharedPointer<DISPLIB::ChannelInfoModel> m_pChannelInfoModel; /**< Hold channel info - needed to initialize channelselectionview */
QSharedPointer<FIFFLIB::FiffInfo> m_pFiffInfo; /**< Hold Information baout currently loaded file */

DISPLIB::ApplyToView* m_pApplyToView;

QHBoxLayout* m_pViewLayout; /**< Holds the view portion of the channel selection to be displayed */
QVBoxLayout* m_pControlLayout; /**< Holds the control portion of the channel selection to be displayed */

Expand Down
2 changes: 1 addition & 1 deletion applications/mne_analyze/plugins/plugins.pro
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ SUBDIRS += \
averaging \
channelselection \
scalingmanager \
sampleplugin \
# sampleplugin \
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ QVector<EVENT_TYPE> ScalingManager::getEventSubscriptions(void) const

void ScalingManager::onScalingChanged(const QMap<qint32, float> &scalingMap)
{
qDebug() << "[ScalingManager::onScalingChanged]";

m_pSelectionParameters->m_sViewsToApply = m_pApplyToView->getSelectedViews();

m_pSelectionParameters->m_mScalingMap = scalingMap;
Expand Down
1 change: 1 addition & 0 deletions libraries/disp/viewers/applytoview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ ApplyToView::ApplyToView(const QString& sSettingsPath,

ApplyToView::~ApplyToView()
{
delete m_pUi;
}

//=============================================================================================================
Expand Down

0 comments on commit 5f9ea80

Please sign in to comment.