Skip to content

Commit

Permalink
fix: [project] set default working directory of Cmake project`s property
Browse files Browse the repository at this point in the history
Log: as title
  • Loading branch information
LiHua000 authored and deepin-mozart committed Jul 25, 2024
1 parent 06d6774 commit bb026c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/plugins/cxx/cmake/project/cmakeprojectgenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,6 @@ void CmakeProjectGenerator::targetInitialized(const QString& workspace)

void CmakeProjectGenerator::createTargetsRunConfigure(const QString &workDirectory, config::RunConfigure &runConfigure)
{
Q_UNUSED(workDirectory)

if (!runConfigure.targetsRunConfigure.isEmpty())
return;

Expand All @@ -613,6 +611,8 @@ void CmakeProjectGenerator::createTargetsRunConfigure(const QString &workDirecto
TargetRunConfigure targetRunConfigure;
targetRunConfigure.targetName = targetName;
targetRunConfigure.targetPath = target.output;
auto targetFile = QFileInfo(targetRunConfigure.targetPath);
targetRunConfigure.workDirectory = targetFile.exists() ? targetFile.path() : workDirectory;

runConfigure.targetsRunConfigure.push_back(targetRunConfigure);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ void RunConfigPane::setupUi()
btnBrowser->setIconSize(QSize(24, 24));
btnBrowser->setFixedSize(36, 36);
d->workingDirLineEdit = new DLineEdit(mainFrame);
d->workingDirLineEdit->lineEdit()->setReadOnly(true);
connect(d->workingDirLineEdit, &DLineEdit::textChanged, [this](){
if (d->targetRunParam)
d->targetRunParam->workDirectory = d->workingDirLineEdit->text().trimmed();
Expand Down

0 comments on commit bb026c2

Please sign in to comment.