MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / read

Method read

lib/extensionsystem/pluginspec.cpp:505–548  ·  view source on GitHub ↗

! \internal */

Source from the content-addressed store, hash-verified

503 \internal
504*/
505bool PluginSpecPrivate::read(const QString &fileName)
506{
507 name
508 = version
509 = compatVersion
510 = vendor
511 = copyright
512 = license
513 = description
514 = url
515 = category
516 = location
517 = QString();
518 state = PluginSpec::Invalid;
519 hasError = false;
520 errorString.clear();
521 dependencies.clear();
522 QFile file(fileName);
523 if (!file.open(QIODevice::ReadOnly))
524 return reportError(tr("Cannot open file %1 for reading: %2")
525 .arg(QDir::toNativeSeparators(file.fileName()), file.errorString()));
526 QFileInfo fileInfo(file);
527 location = fileInfo.absolutePath();
528 filePath = fileInfo.absoluteFilePath();
529 QXmlStreamReader reader(&file);
530 while (!reader.atEnd()) {
531 reader.readNext();
532 switch (reader.tokenType()) {
533 case QXmlStreamReader::StartElement:
534 readPluginSpec(reader);
535 break;
536 default:
537 break;
538 }
539 }
540 if (reader.hasError())
541 return reportError(tr("Error parsing file %1: %2, at line %3, column %4")
542 .arg(QDir::toNativeSeparators(file.fileName()))
543 .arg(reader.errorString())
544 .arg(reader.lineNumber())
545 .arg(reader.columnNumber()));
546 state = PluginSpec::Read;
547 return true;
548}
549
550void PluginSpecPrivate::setLibraryPath(const QString& path)
551{

Callers 1

foreachFunction · 0.45

Calls 6

QStringClass · 0.50
clearMethod · 0.45
openMethod · 0.45
fileNameMethod · 0.45
errorStringMethod · 0.45
hasErrorMethod · 0.45

Tested by

no test coverage detected