##// END OF EJS Templates
@@ -64,8 +64,8 MainWindow::MainWindow(QWidget *parent) : QMainWindow{parent}, m_Ui{new Ui::Main
64 mainToolBar->addAction("A1");
64 mainToolBar->addAction("A1");
65
65
66 // Widgets / controllers connections
66 // Widgets / controllers connections
67 connect(&sqpApp->dataSourceController(), SIGNAL(dataSourceItemSet(DataSourceItem &)),
67 connect(&sqpApp->dataSourceController(), SIGNAL(dataSourceItemSet(DataSourceItem *)),
68 m_Ui->dataSourceWidget, SLOT(addDataSource(DataSourceItem &)));
68 m_Ui->dataSourceWidget, SLOT(addDataSource(DataSourceItem *)));
69
69
70 /* QLopGUI::registerMenuBar(menuBar());
70 /* QLopGUI::registerMenuBar(menuBar());
71 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
71 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
@@ -49,7 +49,7 public slots:
49
49
50 signals:
50 signals:
51 /// Signal emitted when a structure has been set for a data source
51 /// Signal emitted when a structure has been set for a data source
52 void dataSourceItemSet(DataSourceItem &dataSourceItem);
52 void dataSourceItemSet(DataSourceItem *dataSourceItem);
53
53
54 private:
54 private:
55 void waitForFinish();
55 void waitForFinish();
@@ -49,7 +49,7 void DataSourceController::setDataSourceItem(
49 // Retrieves the data source item to emit the signal with it
49 // Retrieves the data source item to emit the signal with it
50 auto it = impl->m_DataSourceItems.find(dataSourceUid);
50 auto it = impl->m_DataSourceItems.find(dataSourceUid);
51 if (it != impl->m_DataSourceItems.end()) {
51 if (it != impl->m_DataSourceItems.end()) {
52 emit dataSourceItemSet(*it->second);
52 emit dataSourceItemSet(it->second.get());
53 }
53 }
54 }
54 }
55 else {
55 else {
@@ -26,7 +26,7 void TestDataSourceController::testSetDataSourceItem()
26 DataSourceController dataSourceController{};
26 DataSourceController dataSourceController{};
27
27
28 // Spy to test controllers' signals
28 // Spy to test controllers' signals
29 QSignalSpy signalSpy{&dataSourceController, SIGNAL(dataSourceItemSet(const DataSourceItem &))};
29 QSignalSpy signalSpy{&dataSourceController, SIGNAL(dataSourceItemSet(DataSourceItem *))};
30
30
31 // Create a data source item
31 // Create a data source item
32 auto source1Name = QStringLiteral("Source1");
32 auto source1Name = QStringLiteral("Source1");
@@ -21,9 +21,9 public slots:
21 /**
21 /**
22 * Adds a data source. An item associated to the data source is created and then added to the
22 * Adds a data source. An item associated to the data source is created and then added to the
23 * representation tree
23 * representation tree
24 * @param dataSource the data source to add
24 * @param dataSource the data source to add. The pointer has to be not null
25 */
25 */
26 void addDataSource(DataSourceItem &dataSource) noexcept;
26 void addDataSource(DataSourceItem *dataSource) noexcept;
27
27
28 private:
28 private:
29 class DataSourceWidgetPrivate;
29 class DataSourceWidgetPrivate;
@@ -20,6 +20,13 QIcon itemIcon(const DataSourceItem *dataSource)
20 // No action
20 // No action
21 break;
21 break;
22 }
22 }
23
24 qCWarning(LOG_DataSourceTreeWidgetItem())
25 << QObject::tr("Can't set data source icon : unknown data source type");
26 }
27 else {
28 qCWarning(LOG_DataSourceTreeWidgetItem())
29 << QObject::tr("Can't set data source icon : the data source is null");
23 }
30 }
24
31
25 // Default cases
32 // Default cases
@@ -53,9 +53,11 DataSourceWidget::DataSourceWidget(QWidget *parent)
53 {
53 {
54 }
54 }
55
55
56 void DataSourceWidget::addDataSource(DataSourceItem &dataSource) noexcept
56 void DataSourceWidget::addDataSource(DataSourceItem *dataSource) noexcept
57 {
57 {
58 // Creates the item associated to the source and adds it to the tree widget. The tree widget
58 // Creates the item associated to the source and adds it to the tree widget. The tree widget
59 // takes the ownership of the item
59 // takes the ownership of the item
60 impl->m_Ui->treeWidget->addTopLevelItem(createTreeWidgetItem(&dataSource));
60 if (dataSource) {
61 impl->m_Ui->treeWidget->addTopLevelItem(createTreeWidgetItem(dataSource));
62 }
61 }
63 }
General Comments 3
Under Review
author

Pull request updated. Auto status change to "Under Review"

Changed commits:
  * 6 added
  * 3 removed

Changed files:
  * A gui/src/Visualization/VisualizationWidget.cpp
  * A gui/include/SidePane/SqpSidePane.h
  * A gui/include/Visualization/VisualizationGraphWidget.h
  * A gui/include/Visualization/VisualizationTabWidget.h
  * A gui/include/Visualization/VisualizationWidget.h
  * A gui/include/Visualization/VisualizationZoneWidget.h
  * A gui/include/Visualization/qcustomplot.h
  * A gui/src/SidePane/SqpSidePane.cpp
  * A gui/src/Visualization/VisualizationGraphWidget.cpp
  * A gui/src/Visualization/VisualizationTabWidget.cpp
  * A gui/src/Visualization/VisualizationZoneWidget.cpp
  * A gui/src/Visualization/qcustomplot.cpp
  * M gui/include/DataSource/DataSourceWidget.h
  * M gui/src/DataSource/DataSourceTreeWidgetItem.cpp
  * M gui/src/DataSource/DataSourceWidget.cpp
  * M app/src/Main.cpp
  * M app/src/MainWindow.cpp
  * M app/ui/MainWindow.ui
  * M core/include/DataSource/DataSourceController.h
  * M core/src/DataSource/DataSourceController.cpp
  * M core/tests/DataSource/TestDataSourceController.cpp
  * M gui/ui/visualization/VisualizationWidget.ui
  * M gui/vera-exclusions/exclusions.txt
  * M gui/src/visualization/VisualizationWidget.cpp
  * R cmake/sciqlop_package_qt.cmake
  * R core/include/Plugin/PluginManager.h
  * R core/include/Visualization/VisualizationController.h
  * R core/src/Plugin/PluginManager.cpp
  * R core/src/Visualization/VisualizationController.cpp
  * R gui/include/sidepane/SqpSidePane.h
  * R gui/include/visualization/VisualizationGraphWidget.h
  * R gui/include/visualization/VisualizationTabWidget.h
  * R gui/include/visualization/VisualizationWidget.h
  * R gui/include/visualization/VisualizationZoneWidget.h
  * R gui/include/visualization/qcustomplot.h
  * R gui/src/sidepane/SqpSidePane.cpp
  * R gui/src/visualization/VisualizationGraphWidget.cpp
  * R gui/src/visualization/VisualizationTabWidget.cpp
  * R gui/src/visualization/VisualizationZoneWidget.cpp
  * R gui/src/visualization/qcustomplot.cpp
  * R gui/ui/sidepane/SqpSidePane.ui
  * R gui/ui/visualization/VisualizationGraphWidget.ui
  * R gui/ui/visualization/VisualizationTabWidget.ui
  * R gui/ui/visualization/VisualizationZoneWidget.ui
  * R plugin/CMakeLists.txt
  * R plugin/cmake/Findsciqlop-plugin.cmake
  * R plugin/include/Plugin/IPlugin.h
  * R app/CMakeLists.txt
  * R app/include/MainWindow.h
  * R app/vera-exclusions/exclusions.txt
  * R cmake/sciqlop_applications.cmake
  * R core/CMakeLists.txt
  * R core/include/Common/spimpl.h
  * R gui/CMakeLists.txt
  * R gui/include/SqpApplication.h
  * R gui/src/SqpApplication.cpp
  * R app/src/mainwindow.ui
Approved
author

Status change > Approved

You need to be logged in to leave comments. Login now