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

disambiguate, simplify

parent 8c2228e3
No related branches found
No related tags found
1 merge request!2359Use same tree view with delegate for datafiles, samples, and instruments. Also move some code between GUI/View directories. Restore Py wrappers lost in previous MR.
...@@ -50,7 +50,7 @@ void DatafilesQModel::removeDatafileItem(DatafileItem* item) ...@@ -50,7 +50,7 @@ void DatafilesQModel::removeDatafileItem(DatafileItem* item)
const int row = m_items.indexOf(item); const int row = m_items.indexOf(item);
beginRemoveRows(indexOfHeadline(), row, row); beginRemoveRows(indexOfHeadline(), row, row);
m_items.removeAll(item); m_items.removeAll(item);
m_model->removeDatafileItem(item); m_model->deleteDatafileItem(item);
endRemoveRows(); endRemoveRows();
} }
......
...@@ -38,7 +38,7 @@ void DatafilesSet::appendDatafileItem(DatafileItem* dfi) ...@@ -38,7 +38,7 @@ void DatafilesSet::appendDatafileItem(DatafileItem* dfi)
m_dfile_items.emplace_back(dfi); m_dfile_items.emplace_back(dfi);
} }
void DatafilesSet::removeDatafileItem(DatafileItem* dfi) void DatafilesSet::deleteDatafileItem(DatafileItem* dfi)
{ {
ASSERT(dfi); ASSERT(dfi);
m_dfile_items.delete_element(dfi); m_dfile_items.delete_element(dfi);
...@@ -46,8 +46,7 @@ void DatafilesSet::removeDatafileItem(DatafileItem* dfi) ...@@ -46,8 +46,7 @@ void DatafilesSet::removeDatafileItem(DatafileItem* dfi)
void DatafilesSet::clear() void DatafilesSet::clear()
{ {
for (auto* dfi : m_dfile_items) m_dfile_items.clear();
removeDatafileItem(dfi);
} }
QVector<DataItem*> DatafilesSet::dataItems() const QVector<DataItem*> DatafilesSet::dataItems() const
......
...@@ -32,7 +32,7 @@ public: ...@@ -32,7 +32,7 @@ public:
~DatafilesSet(); ~DatafilesSet();
void appendDatafileItem(DatafileItem* dfi); void appendDatafileItem(DatafileItem* dfi);
void removeDatafileItem(DatafileItem* dfi); void deleteDatafileItem(DatafileItem* dfi);
void clear(); void clear();
void readFrom(QXmlStreamReader* r); void readFrom(QXmlStreamReader* r);
void readDatafiles(const QString& projectDir, MessageService* messageService); void readDatafiles(const QString& projectDir, MessageService* messageService);
......
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