@@ -67,10 +67,13 DataSourceWidget::~DataSourceWidget() noexcept | |||||
67 |
|
67 | |||
68 | void DataSourceWidget::addDataSource(DataSourceItem *dataSource) noexcept |
|
68 | void DataSourceWidget::addDataSource(DataSourceItem *dataSource) noexcept | |
69 | { |
|
69 | { | |
70 | // Creates the item associated to the source and adds it to the tree widget. The tree widget |
|
70 | // Merges the data source (without taking its root) | |
71 | // takes the ownership of the item |
|
|||
72 | if (dataSource) { |
|
71 | if (dataSource) { | |
73 | ui->treeWidget->addTopLevelItem(createTreeWidgetItem(dataSource)); |
|
72 | for (auto i = 0, count = dataSource->childCount(); i < count; ++i) { | |
|
73 | m_Root->merge(*dataSource->child(i)); | |||
|
74 | } | |||
|
75 | ||||
|
76 | updateTreeWidget(); | |||
74 | } |
|
77 | } | |
75 | } |
|
78 | } | |
76 |
|
79 |
General Comments 0
You need to be logged in to leave comments.
Login now