forked from qt-creator/qt-creator
Fix installing just a library in plugin install wizard
It is possible to just select a plugin library in the plugin install
wizard, and that worked by just copying the library over.
Amends be2e5262c7
that introduced a crash for that case, by unconditionally using the
PluginSpec instance that was only created for the "archive" case.
Instead of skipping the check archive step, also try to read a
PluginSpec for pure library files. That has the advantage that we do some
basic checks for them too, and that we have the PluginSpec instance
available for the later code.
Change-Id: I23286d81de54c08d4735c9bcdb2368c8b6097408
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -115,7 +115,7 @@ public:
|
|||||||
int nextId() const final
|
int nextId() const final
|
||||||
{
|
{
|
||||||
if (hasLibSuffix(m_data->sourcePath))
|
if (hasLibSuffix(m_data->sourcePath))
|
||||||
return WizardPage::nextId() + 1; // jump over check archive
|
return WizardPage::nextId();
|
||||||
return WizardPage::nextId();
|
return WizardPage::nextId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,6 +185,20 @@ public:
|
|||||||
{
|
{
|
||||||
m_isComplete = false;
|
m_isComplete = false;
|
||||||
emit completeChanged();
|
emit completeChanged();
|
||||||
|
if (hasLibSuffix(m_data->sourcePath)) {
|
||||||
|
m_cancelButton->setVisible(false);
|
||||||
|
expected_str<std::unique_ptr<PluginSpec>> spec = readCppPluginSpec(m_data->sourcePath);
|
||||||
|
if (!spec) {
|
||||||
|
m_label->setType(InfoLabel::Error);
|
||||||
|
m_label->setText(spec.error());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_label->setType(InfoLabel::Ok);
|
||||||
|
m_label->setText(Tr::tr("Archive is OK."));
|
||||||
|
m_data->pluginSpec.swap(*spec);
|
||||||
|
m_isComplete = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_tempDir = std::make_unique<TemporaryDirectory>("plugininstall");
|
m_tempDir = std::make_unique<TemporaryDirectory>("plugininstall");
|
||||||
m_data->extractedPath = m_tempDir->path();
|
m_data->extractedPath = m_tempDir->path();
|
||||||
@@ -345,6 +359,7 @@ public:
|
|||||||
|
|
||||||
void initializePage() final
|
void initializePage() final
|
||||||
{
|
{
|
||||||
|
QTC_ASSERT(m_data && m_data->pluginSpec, return);
|
||||||
const FilePath installLocation = m_data->pluginSpec->installLocation(
|
const FilePath installLocation = m_data->pluginSpec->installLocation(
|
||||||
!m_data->installIntoApplication);
|
!m_data->installIntoApplication);
|
||||||
installLocation.ensureWritableDir();
|
installLocation.ensureWritableDir();
|
||||||
|
Reference in New Issue
Block a user