Skip to content

Commit

Permalink
minor fix to make it possible
Browse files Browse the repository at this point in the history
  • Loading branch information
research11111 committed Oct 27, 2023
1 parent cad72f3 commit 2bfa560
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions avogadro/qtplugins/plugindownloader/pluginmanagerwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ PluginManagerWidget::PluginManagerWidget(QWidget* parent)
void PluginManagerWidget::addPluginLocationClicked() {
QString pluginLocationUrl = m_ui->pluginLocationUrl->text();
qDebug() << "Should show a popup that create then a json object: " << pluginLocationUrl;

addPluginFromGithubUrl(pluginLocationUrl);
}
void PluginManagerWidget::refreshPluginsListClicked() {
fetchPluginsList();
Expand Down Expand Up @@ -571,8 +571,9 @@ void PluginManagerWidget::addPluginFromGithubUrlResult() {
QMessageBox::warning(nullptr,"Error","Unable to fetch plugin.json");
return;
}
QByteArray data = m_reply->readAll();
QJsonDocument jsonDoc = QJsonDocument::fromJson(data);
qDebug() << "plugin.json found";

QJsonDocument jsonDoc = QJsonDocument::fromJson(m_reply->readAll());
QJsonObject jsonObj = jsonDoc.object();

QJsonObject plugin;
Expand All @@ -596,6 +597,7 @@ void PluginManagerWidget::addPluginFromGithubUrlResult() {
plugin["type"] = jsonObj["type"];

appendToPluginsJsonFile(plugin);
updatePluginsList();
}

} // namespace Avogadro

0 comments on commit 2bfa560

Please sign in to comment.