Skip to content
Snippets Groups Projects
Commit a403f7df authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

rm SamplesQListView::restoreSelection

parent 760d62bd
No related branches found
No related tags found
1 merge request!2387unify code for list views
...@@ -147,19 +147,6 @@ void SamplesQListView::onCurrentChanged(const QModelIndex& index) ...@@ -147,19 +147,6 @@ void SamplesQListView::onCurrentChanged(const QModelIndex& index)
emit currentSampleChanged(m_model->itemForIndex(index)); emit currentSampleChanged(m_model->itemForIndex(index));
} }
void SamplesQListView::restoreSelection()
{
int selected = gDoc->samples()->currentIndex();
if (selected < 0 || selected >= m_model->rowCount())
selected = m_model->rowCount() - 1;
QModelIndex currentIndex = m_model->index(selected, 0, QModelIndex());
if (currentIndex.isValid()) {
selectionModel()->select(currentIndex, QItemSelectionModel::ClearAndSelect);
gDoc->samplesModifier()->setCurrentIndex(selected);
}
}
void SamplesQListView::removeSample(SampleItem* item) void SamplesQListView::removeSample(SampleItem* item)
{ {
m_model->removeSample(item); m_model->removeSample(item);
......
...@@ -28,8 +28,6 @@ public: ...@@ -28,8 +28,6 @@ public:
SampleItem* currentSampleItem(); SampleItem* currentSampleItem();
void restoreSelection();
QAction* newSampleAction() { return m_new_sample_action; } QAction* newSampleAction() { return m_new_sample_action; }
QAction* importSampleAction() { return m_import_sample_action; } QAction* importSampleAction() { return m_import_sample_action; }
QAction* chooseFromLibraryAction() { return m_choose_from_library_action; } QAction* chooseFromLibraryAction() { return m_choose_from_library_action; }
......
...@@ -191,9 +191,3 @@ void SampleView::onAboutToRemoveItem(Item3D* item) ...@@ -191,9 +191,3 @@ void SampleView::onAboutToRemoveItem(Item3D* item)
widget->resetScene(); widget->resetScene();
} }
} }
void SampleView::showEvent(QShowEvent*)
{
if (!m_listing->currentSampleItem())
m_listing->restoreSelection();
}
...@@ -29,8 +29,6 @@ public: ...@@ -29,8 +29,6 @@ public:
~SampleView(); ~SampleView();
private: private:
void showEvent(QShowEvent*) override;
//! Show the item in the real space view //! Show the item in the real space view
//! //!
//! If the real space view is not visible at the moment, it will be shown. //! If the real space view is not visible at the moment, it will be shown.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment