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

Method setSearchPath

src/frontend/PlotTemplateDialog.cpp:297–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297void TemplateListModel::setSearchPath(const QString& searchPath) {
298 beginResetModel();
299 mSearchPath = searchPath;
300 mFiles.clear();
301 QStringList filter(QLatin1String("*") % PlotTemplateDialog::format);
302 QDirIterator it(searchPath, filter, QDir::AllEntries | QDir::NoSymLinks | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
303 QDir sPath(searchPath);
304 while (it.hasNext()) {
305 QFileInfo f(it.next());
306 File file{f.absoluteFilePath(), sPath.relativeFilePath(f.absoluteFilePath()).split(PlotTemplateDialog::format).at(0)};
307 mFiles << file;
308 }
309 endResetModel();
310}
311
312int TemplateListModel::rowCount(const QModelIndex& parent) const {
313 Q_UNUSED(parent);

Callers 1

Calls 3

nextMethod · 0.80
splitMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected