Skip to content

Commit

Permalink
fix: Open settings dialog the program crash
Browse files Browse the repository at this point in the history
as title

Log: fix issue
  • Loading branch information
Kakueeen authored and deepin-mozart committed Nov 5, 2024
1 parent 308897a commit f636ee2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/plugins/cxx/cmake/settings/compileroptionwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,15 @@ void CompilerOptionWidgetPrivate::initCompilers()
const auto &data = toolCD.getToolChanins();
ToolChainData::Params cParams = data.value(kCCompilers);
for (const auto &param : cParams) {
if (param.name.isEmpty() || param.path.isEmpty())
continue;
appendCompiler(param.name, param.path, DetectedCCompiler);
}

ToolChainData::Params cxxParams = data.value(kCXXCompilers);
for (const auto &param : cxxParams) {
if (param.name.isEmpty() || param.path.isEmpty())
continue;
appendCompiler(param.name, param.path, DetectedCXXCompiler);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/cxx/cmake/settings/debuggeroptionwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ void DebuggerOptionWidgetPrivate::initDebuggers()
const auto &data = toolCD.getToolChanins();
ToolChainData::Params params = data.value(kCCXXDebuggers);
for (const auto &param : params) {
if (param.name.isEmpty() || param.path.isEmpty())
continue;
appendDebugger(param.name, param.path, Detected);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/cxx/cmake/settings/tooloptionwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ void ToolOptionWidgetPrivate::initTools()
const auto &data = toolCD.getToolChanins();
ToolChainData::Params params = data.value(kCCXXBuildSystems);
for (const auto &param : params) {
if (param.name.isEmpty() || param.path.isEmpty())
continue;
appendTool(param.name, param.path, Detected);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/python/python/option/interpreterwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class InterpreterWidgetPrivate

InterpreterModel *model = nullptr;
QSharedPointer<ToolChainData> toolChainData;
QMutex mutex;
};

InterpreterWidget::InterpreterWidget(QWidget *parent)
Expand Down Expand Up @@ -264,7 +265,7 @@ void InterpreterWidget::findPackages(const QString &cmd)
{
QProcess process;
connect(&process, static_cast<void (QProcess::*)(int,QProcess::ExitStatus)>(&QProcess::finished),
[&](int exitcode, QProcess::ExitStatus exitStatus) {
&process, [&](int exitcode, QProcess::ExitStatus exitStatus) {
if (0 == exitcode && exitStatus == QProcess::ExitStatus::NormalExit) {
QString output = QString(process.readAllStandardOutput());

Expand All @@ -282,6 +283,7 @@ void InterpreterWidget::findPackages(const QString &cmd)
dataVector.append(QPair<QString, QString>(sublist.at(0).trimmed(), sublist.at(1).trimmed()));
}
}
QMutexLocker lk(&d->mutex);
d->model->setCustomData(dataVector);
} else {
qInfo() << "Error" << exitcode << exitStatus;
Expand Down

0 comments on commit f636ee2

Please sign in to comment.