diff --git a/qrenderdoc/Code/CaptureContext.cpp b/qrenderdoc/Code/CaptureContext.cpp index 743bf1136..78aa3b1d0 100644 --- a/qrenderdoc/Code/CaptureContext.cpp +++ b/qrenderdoc/Code/CaptureContext.cpp @@ -120,10 +120,10 @@ CaptureContext::CaptureContext(QString paramFilename, QString remoteHost, uint32 for(const ExtensionMetadata &e : exts) { - if(cfg.AlwaysLoad_Extensions.contains(e.Package)) + if(cfg.AlwaysLoad_Extensions.contains(e.package)) { - qInfo() << "Automatically loading extension" << QString(e.Package); - LoadExtension(e.Package); + qInfo() << "Automatically loading extension" << QString(e.package); + LoadExtension(e.package); } } } @@ -203,12 +203,12 @@ rdcarray CaptureContext::GetInstalledExtensions() ExtensionMetadata ext; - ext.Package = package; - ext.FilePath = fileinfo.absolutePath(); + ext.package = package; + ext.filePath = fileinfo.absolutePath(); if(json.contains(lit("name"))) { - ext.Name = json[lit("name")].toString(); + ext.name = json[lit("name")].toString(); } else { @@ -216,54 +216,54 @@ rdcarray CaptureContext::GetInstalledExtensions() continue; } - ext.ExtensionAPI = 1; + ext.extensionAPI = 1; if(json.contains(lit("extension_api"))) { - ext.ExtensionAPI = json[lit("extension_api")].toInt(); + ext.extensionAPI = json[lit("extension_api")].toInt(); } else { - qCritical() << "Extension" << QString(ext.Name) << "is corrupt, no api version entry"; + qCritical() << "Extension" << QString(ext.name) << "is corrupt, no api version entry"; continue; } if(json.contains(lit("version"))) { - ext.Version = json[lit("version")].toString(); + ext.version = json[lit("version")].toString(); } else { - qCritical() << "Extension" << QString(ext.Name) << "is corrupt, no version entry"; + qCritical() << "Extension" << QString(ext.name) << "is corrupt, no version entry"; continue; } if(json.contains(lit("description"))) { - ext.Description = json[lit("description")].toString(); + ext.description = json[lit("description")].toString(); } else { - qCritical() << "Extension" << QString(ext.Name) << "is corrupt, no description entry"; + qCritical() << "Extension" << QString(ext.name) << "is corrupt, no description entry"; continue; } if(json.contains(lit("author"))) { - ext.Author = json[lit("author")].toString(); + ext.author = json[lit("author")].toString(); } else { - qCritical() << "Extension" << QString(ext.Name) << "is corrupt, no author entry"; + qCritical() << "Extension" << QString(ext.name) << "is corrupt, no author entry"; continue; } if(json.contains(lit("url"))) { - ext.URL = json[lit("url")].toString(); + ext.extensionURL = json[lit("url")].toString(); } else { - qCritical() << "Extension" << QString(ext.Name) << "is corrupt, no URL entry"; + qCritical() << "Extension" << QString(ext.name) << "is corrupt, no URL entry"; continue; } @@ -296,14 +296,14 @@ rdcarray CaptureContext::GetInstalledExtensions() if(!ok) { - qCritical() << "Extension" << QString(ext.Name) + qCritical() << "Extension" << QString(ext.name) << "is corrupt, minimum_renderdoc doesn't match a MAJOR.MINOR version"; continue; } if(badversion) { - qInfo() << "Extension" << QString(ext.Name) << "declares minimum_renderdoc" << minVer + qInfo() << "Extension" << QString(ext.name) << "declares minimum_renderdoc" << minVer << "so skipping"; continue; } diff --git a/qrenderdoc/Code/Interface/QRDInterface.h b/qrenderdoc/Code/Interface/QRDInterface.h index d47f6c7c0..9a0de490a 100644 --- a/qrenderdoc/Code/Interface/QRDInterface.h +++ b/qrenderdoc/Code/Interface/QRDInterface.h @@ -1142,54 +1142,54 @@ struct ExtensionMetadata DOCUMENT(""); bool operator==(const ExtensionMetadata &o) const { - return ExtensionAPI == o.ExtensionAPI && FilePath == o.FilePath && Package == o.Package && - Name == o.Name && Version == o.Version && Author == o.Author && URL == o.URL && - Description == o.Description; + return extensionAPI == o.extensionAPI && filePath == o.filePath && package == o.package && + name == o.name && version == o.version && author == o.author && + extensionURL == o.extensionURL && description == o.description; } bool operator<(const ExtensionMetadata &o) const { - if(!(ExtensionAPI == o.ExtensionAPI)) - return ExtensionAPI < o.ExtensionAPI; - if(!(FilePath == o.FilePath)) - return FilePath < o.FilePath; - if(!(Package == o.Package)) - return Package < o.Package; - if(!(Name == o.Name)) - return Name < o.Name; - if(!(Version == o.Version)) - return Version < o.Version; - if(!(Author == o.Author)) - return Author < o.Author; - if(!(URL == o.URL)) - return URL < o.URL; - if(!(Description == o.Description)) - return Description < o.Description; + if(!(extensionAPI == o.extensionAPI)) + return extensionAPI < o.extensionAPI; + if(!(filePath == o.filePath)) + return filePath < o.filePath; + if(!(package == o.package)) + return package < o.package; + if(!(name == o.name)) + return name < o.name; + if(!(version == o.version)) + return version < o.version; + if(!(author == o.author)) + return author < o.author; + if(!(extensionURL == o.extensionURL)) + return extensionURL < o.extensionURL; + if(!(description == o.description)) + return description < o.description; return false; } DOCUMENT("The version of the extension API that this extension is written against"); - int ExtensionAPI; + int extensionAPI; DOCUMENT("The location of this package on disk"); - rdcstr FilePath; + rdcstr filePath; DOCUMENT("The python package for this extension, e.g. foo.bar"); - rdcstr Package; + rdcstr package; DOCUMENT("The short friendly name for the extension"); - rdcstr Name; + rdcstr name; DOCUMENT("The version of the extension"); - rdcstr Version; + rdcstr version; DOCUMENT("The author of the extension, optionally with an email contact"); - rdcstr Author; + rdcstr author; DOCUMENT("The URL for where the extension is fetched from"); - rdcstr URL; + rdcstr extensionURL; DOCUMENT("A longer description of what the extension does"); - rdcstr Description; + rdcstr description; }; DECLARE_REFLECTION_STRUCT(ExtensionMetadata); diff --git a/qrenderdoc/Windows/Dialogs/ExtensionManager.cpp b/qrenderdoc/Windows/Dialogs/ExtensionManager.cpp index b46281927..4dcee2514 100644 --- a/qrenderdoc/Windows/Dialogs/ExtensionManager.cpp +++ b/qrenderdoc/Windows/Dialogs/ExtensionManager.cpp @@ -72,10 +72,10 @@ ExtensionManager::ExtensionManager(ICaptureContext &ctx) { for(const ExtensionMetadata &e : m_Extensions) { - RDTreeWidgetItem *item = new RDTreeWidgetItem({e.Package, e.Name, QString()}); + RDTreeWidgetItem *item = new RDTreeWidgetItem({e.package, e.name, QString()}); item->setCheckState( - 2, m_Ctx.Extensions().IsExtensionLoaded(e.Package) ? Qt::Checked : Qt::Unchecked); + 2, m_Ctx.Extensions().IsExtensionLoaded(e.package) ? Qt::Checked : Qt::Unchecked); ui->extensions->addTopLevelItem(item); } @@ -100,10 +100,10 @@ void ExtensionManager::on_reload_clicked() if(idx >= 0 && idx < m_Extensions.count()) { const ExtensionMetadata &e = m_Extensions[idx]; - if(!e.Name.isEmpty()) + if(!e.name.isEmpty()) { // if the load succeeds, set us as checked. Otherwise, unchecked - if(m_Ctx.Extensions().LoadExtension(e.Package)) + if(m_Ctx.Extensions().LoadExtension(e.package)) { item->setCheckState(2, Qt::Checked); } @@ -113,7 +113,7 @@ void ExtensionManager::on_reload_clicked() RDDialog::critical(this, tr("Failed to load extension"), tr("Failed to load extension '%1'.\n" "Check the diagnostic log for python errors") - .arg(e.Name)); + .arg(e.name)); } update_currentItem(item); @@ -138,9 +138,9 @@ void ExtensionManager::on_openLocation_clicked() if(idx >= 0 && idx < m_Extensions.count()) { const ExtensionMetadata &e = m_Extensions[idx]; - if(!e.Name.isEmpty()) + if(!e.name.isEmpty()) { - QDesktopServices::openUrl(QFileInfo(e.FilePath).absoluteFilePath()); + QDesktopServices::openUrl(QFileInfo(e.filePath).absoluteFilePath()); } } } @@ -156,11 +156,11 @@ void ExtensionManager::on_alwaysLoad_toggled(bool checked) if(idx >= 0 && idx < m_Extensions.count()) { const ExtensionMetadata &e = m_Extensions[idx]; - if(!e.Name.isEmpty()) + if(!e.name.isEmpty()) { - m_Ctx.Config().AlwaysLoad_Extensions.removeOne(e.Package); + m_Ctx.Config().AlwaysLoad_Extensions.removeOne(e.package); if(checked) - m_Ctx.Config().AlwaysLoad_Extensions.push_back(e.Package); + m_Ctx.Config().AlwaysLoad_Extensions.push_back(e.package); m_Ctx.Config().Save(); } @@ -213,29 +213,29 @@ void ExtensionManager::update_currentItem(RDTreeWidgetItem *item) if(idx >= 0 && idx < m_Extensions.count()) { const ExtensionMetadata &e = m_Extensions[idx]; - if(!e.Name.isEmpty()) + if(!e.name.isEmpty()) { QRegularExpression authRE(lit("^(.*) <(.*)>$")); - ui->name->setText(e.Name); - ui->version->setText(e.Version); - ui->URL->setText(QFormatStr("%1").arg(e.URL)); - ui->description->setText(e.Description); + ui->name->setText(e.name); + ui->version->setText(e.version); + ui->URL->setText(QFormatStr("%1").arg(e.extensionURL)); + ui->description->setText(e.description); - QRegularExpressionMatch match = authRE.match(QString(e.Author).trimmed()); + QRegularExpressionMatch match = authRE.match(QString(e.author).trimmed()); if(match.hasMatch() && match.captured(2).contains(QLatin1Char('@'))) ui->author->setText( QFormatStr("%1").arg(match.captured(1)).arg(match.captured(2))); else - ui->author->setText(e.Author); + ui->author->setText(e.author); bool loaded = item->checkState(2) == Qt::Checked; ui->reload->setEnabled(true); ui->reload->setText(loaded ? tr("Reload") : tr("Load")); ui->alwaysLoad->setEnabled(loaded); - ui->alwaysLoad->setChecked(m_Ctx.Config().AlwaysLoad_Extensions.contains(e.Package)); + ui->alwaysLoad->setChecked(m_Ctx.Config().AlwaysLoad_Extensions.contains(e.package)); } } } \ No newline at end of file