! Reads the given \a spec and displays its values in this PluginDetailsView. */
| 70 | in this PluginDetailsView. |
| 71 | */ |
| 72 | void PluginDetailsView::update(PluginSpec *spec) |
| 73 | { |
| 74 | m_ui->name->setText(spec->name()); |
| 75 | m_ui->version->setText(spec->version()); |
| 76 | m_ui->compatVersion->setText(spec->compatVersion()); |
| 77 | m_ui->vendor->setText(spec->vendor()); |
| 78 | const QString link = QString::fromLatin1("<a href=\"%1\">%1</a>").arg(spec->url()); |
| 79 | m_ui->url->setText(link); |
| 80 | QString component = tr("None"); |
| 81 | if (!spec->category().isEmpty()) |
| 82 | component = spec->category(); |
| 83 | m_ui->component->setText(component); |
| 84 | m_ui->location->setText(QDir::toNativeSeparators(spec->filePath())); |
| 85 | m_ui->description->setText(spec->description()); |
| 86 | m_ui->copyright->setText(spec->copyright()); |
| 87 | m_ui->license->setText(spec->license()); |
| 88 | const QRegExp platforms = spec->platformSpecification(); |
| 89 | m_ui->platforms->setText(platforms.isEmpty() ? tr("All") : platforms.pattern()); |
| 90 | QStringList depStrings; |
| 91 | foreach (const PluginDependency &dep, spec->dependencies()) { |
| 92 | QString depString = dep.name; |
| 93 | depString += QLatin1String(" ("); |
| 94 | depString += dep.version; |
| 95 | if (dep.type == PluginDependency::Optional) |
| 96 | depString += QLatin1String(", optional"); |
| 97 | depString += QLatin1Char(')'); |
| 98 | depStrings.append(depString); |
| 99 | } |
| 100 | m_ui->dependencies->addItems(depStrings); |
| 101 | } |
nothing calls this directly
no test coverage detected