* @brief Loads the settings of the widget. */
| 100 | * @brief Loads the settings of the widget. |
| 101 | */ |
| 102 | void DatasetMetadataManagerWidget::loadSettings() { |
| 103 | KConfigGroup conf = Settings::group(QStringLiteral("DatasetMetadataManagerWidget")); |
| 104 | ui.cbCommentCharacter->setCurrentItem(conf.readEntry("commentChar", "#")); |
| 105 | ui.cbSeparatingCharacter->setCurrentItem(conf.readEntry("separator", "auto")); |
| 106 | // TODO: use general setting for decimal separator? |
| 107 | ui.cbNumberFormat->setCurrentIndex(conf.readEntry("numberFormat", static_cast<int>(QLocale::AnyLanguage))); |
| 108 | ui.cbDateTimeFormat->setCurrentItem(conf.readEntry("dateTimeFormat", "yyyy-MM-dd hh:mm:ss.zzz")); |
| 109 | ui.chbCreateIndex->setChecked(conf.readEntry("createIndexColumn", false)); |
| 110 | ui.chbSimplifyWhitespaces->setChecked(conf.readEntry("simplifyWhitespaces", true)); |
| 111 | ui.chbRemoveQuotes->setChecked(conf.readEntry("removeQuotes", false)); |
| 112 | ui.chbSkipEmptyParts->setChecked(conf.readEntry("skipEmptyParts", false)); |
| 113 | ui.chbHeader->setChecked(conf.readEntry("useFirstRowForVectorName", true)); |
| 114 | |
| 115 | QString lastCollection = conf.readEntry("collection", ""); |
| 116 | if (m_datasetModel->collections().contains(lastCollection)) |
| 117 | ui.cbCollection->setCurrentText(lastCollection); |
| 118 | |
| 119 | QString lastCategory = conf.readEntry("category", ""); |
| 120 | if (m_datasetModel->categories(ui.cbCollection->currentText()).contains(lastCategory)) |
| 121 | ui.cbCategory->setCurrentText(lastCategory); |
| 122 | |
| 123 | QString lastSubcategory = conf.readEntry("subcategory", ""); |
| 124 | if (m_datasetModel->subcategories(ui.cbCollection->currentText(), ui.cbCategory->currentText()).contains(lastSubcategory)) |
| 125 | ui.cbSubcategory->setCurrentText(lastSubcategory); |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * @brief Checks whether leFileName contains a valid file name. |
nothing calls this directly
no test coverage detected