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

Method loadConfigFromTemplate

src/frontend/datasources/ImportFileWidget.cpp:1220–1237  ·  view source on GitHub ↗

! loads the settings for the current filter from a template */

Source from the content-addressed store, hash-verified

1218 loads the settings for the current filter from a template
1219*/
1220void ImportFileWidget::loadConfigFromTemplate(KConfig& config) {
1221 auto fileType = currentFileType();
1222 KConfigGroup group;
1223 if (fileType == AbstractFileFilter::FileType::Ascii) {
1224 m_asciiOptionsWidget->loadConfigFromTemplate(config);
1225 group = config.group(QLatin1String("ImportAscii"));
1226 } else if (fileType == AbstractFileFilter::FileType::Binary) {
1227 m_binaryOptionsWidget->loadConfigFromTemplate(config);
1228 group = config.group(QLatin1String("ImportBinary"));
1229 }
1230
1231 // load additionally the "data portion to read"-settings which are not
1232 // part of the options widgets and were not loaded above
1233 ui.sbStartRow->setValue(group.readEntry(QLatin1String("StartRow"), -1));
1234 ui.sbEndRow->setValue(group.readEntry(QLatin1String("EndRow"), -1));
1235 ui.sbStartColumn->setValue(group.readEntry(QLatin1String("StartColumn"), -1));
1236 ui.sbEndColumn->setValue(group.readEntry(QLatin1String("EndColumn"), -1));
1237}
1238
1239/*!
1240 * \brief ImportFileWidget::hidePropertyWidgets

Callers 1

filterChangedMethod · 0.95

Calls 2

groupMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected