* @brief Configures the spreadsheet based on the metadata file. */
| 139 | * @brief Configures the spreadsheet based on the metadata file. |
| 140 | */ |
| 141 | void DatasetHandler::configureSpreadsheet(const QString& description) { |
| 142 | DEBUG("Start preparing spreadsheet"); |
| 143 | if (!m_object->isEmpty()) { |
| 144 | if (m_object->contains(QLatin1String("name"))) |
| 145 | m_spreadsheet->setName(m_object->value(QStringLiteral("name")).toString()); |
| 146 | else |
| 147 | markMetadataAsInvalid(); |
| 148 | |
| 149 | if (description.startsWith(QLatin1String("<!DOCTYPE html"))) { |
| 150 | // remove html-formatting |
| 151 | QTextEdit te; |
| 152 | te.setHtml(description); |
| 153 | m_spreadsheet->setComment(te.toPlainText()); |
| 154 | } else |
| 155 | m_spreadsheet->setComment(description); |
| 156 | } else |
| 157 | markMetadataAsInvalid(); |
| 158 | } |
| 159 | |
| 160 | /** |
| 161 | * @brief Extracts the download URL of the dataset and initiates the process of download. |