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

Method loadSettings

src/frontend/datasources/DatasetMetadataManagerWidget.cpp:102–126  ·  view source on GitHub ↗

* @brief Loads the settings of the widget. */

Source from the content-addressed store, hash-verified

100 * @brief Loads the settings of the widget.
101 */
102void 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.

Callers

nothing calls this directly

Calls 7

groupFunction · 0.85
collectionsMethod · 0.80
categoriesMethod · 0.80
currentTextMethod · 0.80
subcategoriesMethod · 0.80
setCurrentIndexMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected