Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/plugins/python/python/option/interpreterwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void InterpreterWidget::setupUi()
d->interpreterComboBox = new DComboBox();
d->interpreterComboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
QObject::connect(d->interpreterComboBox, &DComboBox::currentTextChanged,
this, &InterpreterWidget::setPackageData);
this, &InterpreterWidget::updatePackageData);

d->selectCustomInterpreter = new DPushButton(tr("Browse"), this);
d->removeCustomInterpreter = new DPushButton(tr("Remove"), this);
Expand Down Expand Up @@ -253,12 +253,11 @@ void InterpreterWidget::updateUi()
}
}

void InterpreterWidget::setPackageData(const QString &text)
void InterpreterWidget::updatePackageData()
{
QString cmd = "pip list";
if (text.indexOf("python3") > -1) {
cmd = "pip3 list";
}
auto param = qvariant_cast<ToolChainData::ToolChainParam>(d->interpreterComboBox->currentData(Qt::UserRole + 1));
QString cmd = param.path + " -m pip list";

QtConcurrent::run(this, &InterpreterWidget::findPackages, cmd);
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/python/python/option/interpreterwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public slots:
bool getControlValue(QMap<QString, QVariant> &map);
void setControlValue(const QMap<QString, QVariant> &map);

void setPackageData(const QString &text);
void updatePackageData();
void findPackages(const QString &cmd);

InterpreterWidgetPrivate *const d;
Expand Down
Loading