mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-14 09:50:06 +00:00
Improve the workflow for extensions that fail on import
This commit is contained in:
6 files changed
+39
-6
No files matched your search
@@ -422,6 +422,7 @@ rdcarray<ExtensionMetadata> CaptureContext::GetInstalledExtensions()
|
||||
ext.filePath = fileinfo.absolutePath();
|
||||
|
||||
ext.hasChanges = m_DirtyExtensions.contains(rdcstr(package));
|
||||
ext.failedLoad = m_FailedExtensions.contains(rdcstr(package));
|
||||
|
||||
ext.extensionAPI = 1;
|
||||
if(json.contains(lit("extension_api")))
|
||||
@@ -563,6 +564,7 @@ rdcstr CaptureContext::LoadExtension(rdcstr name)
|
||||
m_ExtensionObjects[name].swap(m_PendingExtensionObjects);
|
||||
|
||||
m_DirtyExtensions.removeOne(name);
|
||||
m_FailedExtensions.removeOne(name);
|
||||
|
||||
for(const ExtensionMetadata &e : GetInstalledExtensions())
|
||||
if(e.package == name)
|
||||
@@ -571,6 +573,7 @@ rdcstr CaptureContext::LoadExtension(rdcstr name)
|
||||
else
|
||||
{
|
||||
m_ExtensionObjects.remove(name);
|
||||
m_FailedExtensions.push_back(name);
|
||||
|
||||
for(QObject *o : m_PendingExtensionObjects)
|
||||
delete o;
|
||||
|
||||
@@ -435,6 +435,7 @@ private:
|
||||
QList<QObject *> m_PendingExtensionObjects;
|
||||
QMap<rdcstr, QList<QObject *>> m_ExtensionObjects;
|
||||
rdcarray<rdcstr> m_DirtyExtensions;
|
||||
rdcarray<rdcstr> m_FailedExtensions;
|
||||
|
||||
QList<QPointer<RegisteredMenuItem>> m_RegisteredMenuItems;
|
||||
|
||||
|
||||
@@ -370,6 +370,14 @@ This will always be false if the extension is unloaded.
|
||||
:type: bool
|
||||
)");
|
||||
bool hasChanges = false;
|
||||
|
||||
DOCUMENT(R"(A flag indicating that the extension failed to load properly.
|
||||
|
||||
This will always be false if the extension is unloaded.
|
||||
|
||||
:type: bool
|
||||
)");
|
||||
bool failedLoad = false;
|
||||
};
|
||||
|
||||
DECLARE_REFLECTION_STRUCT(ExtensionMetadata);
|
||||
|
||||
@@ -1423,9 +1423,10 @@ QString PythonContext::LoadExtension(ICaptureContext &ctx, const rdcstr &extensi
|
||||
|
||||
if(!valueStr.isEmpty())
|
||||
{
|
||||
qCritical("Error importing extension module. %s: %s", typeStr.toUtf8().data(),
|
||||
valueStr.toUtf8().data());
|
||||
ret += tr("Error importing extension module. %1: %2\n\n").arg(typeStr).arg(valueStr);
|
||||
qCritical("Error importing extension module '%s'. %s: %s", extension.c_str(),
|
||||
typeStr.toUtf8().data(), valueStr.toUtf8().data());
|
||||
ret +=
|
||||
tr("Error importing extension module '%1'. %2: %3\n\n").arg(extension).arg(typeStr).arg(valueStr);
|
||||
|
||||
if(!frames.isEmpty())
|
||||
{
|
||||
@@ -1443,7 +1444,7 @@ QString PythonContext::LoadExtension(ICaptureContext &ctx, const rdcstr &extensi
|
||||
}
|
||||
}
|
||||
|
||||
if(!ret.isEmpty() && reload)
|
||||
if(!ret.isEmpty())
|
||||
m_ExtensionContext->addText(extension, true, ret);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user