MCPcopy Create free account
hub / github.com/KDE/labplot / datasetClicked

Method datasetClicked

src/frontend/welcomescreen/WelcomeScreenHelper.cpp:110–136  ·  view source on GitHub ↗

* @brief Handles a dataset being clicked in the dataset section of the WelcomeScreen. * Initiates listing information about the dataset in the previously mentioned section. * * @param category the category the dataset belongs to * @param subcategory the subcategory the dataset belongs to * @param datasetName the name of the dataset */

Source from the content-addressed store, hash-verified

108 * @param datasetName the name of the dataset
109 */
110void WelcomeScreenHelper::datasetClicked(const QString& category, const QString& subcategory, const QString& datasetName) {
111 m_datasetWidget->setCollection("All");
112 m_datasetWidget->setCategory(category);
113 m_datasetWidget->setSubcategory(subcategory);
114 m_datasetWidget->setDataset(datasetName);
115 m_spreadsheet.reset(new Spreadsheet(i18n("Dataset%1", 1)));
116
117 if (m_datasetHandler)
118 delete m_datasetHandler;
119 m_datasetHandler = new DatasetHandler(m_spreadsheet.get());
120
121 m_datasetWidget->import(m_datasetHandler);
122
123 QTimer timer;
124 timer.setSingleShot(true);
125 QEventLoop loop;
126 connect(m_datasetHandler, &DatasetHandler::downloadCompleted, &loop, &QEventLoop::quit);
127 connect(&timer, &QTimer::timeout, &loop, &QEventLoop::quit);
128 timer.start(1500);
129 loop.exec();
130
131 if (timer.isActive()) {
132 timer.stop();
133 Q_EMIT datasetFound();
134 } else
135 Q_EMIT datasetNotFound();
136}
137
138/**
139 * @brief Returns the dataset's full name.

Callers

nothing calls this directly

Calls 9

setDatasetMethod · 0.80
importMethod · 0.80
execMethod · 0.80
isActiveMethod · 0.80
setCollectionMethod · 0.45
setCategoryMethod · 0.45
setSubcategoryMethod · 0.45
resetMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected