Utils: filepathify pathchooser

Change-Id: Ib8e8493a5f7883bead353f015ef476ba0bfc3e0e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2021-06-08 14:10:12 +02:00
parent 4899e133c9
commit 0e6a4e757c
7 changed files with 25 additions and 32 deletions

View File

@@ -191,7 +191,7 @@ bool UnstartedAppWatcherDialog::event(QEvent *e)
void UnstartedAppWatcherDialog::selectExecutable()
{
QString path;
Utils::FilePath path;
Project *project = ProjectTree::currentProject();
Target *activeTarget = project ? project->activeTarget() : nullptr;
@@ -200,16 +200,15 @@ void UnstartedAppWatcherDialog::selectExecutable()
if (RunConfiguration *runConfig = activeTarget->activeRunConfiguration()) {
const Runnable runnable = runConfig->runnable();
if (isLocal(runConfig))
path = runnable.executable.toFileInfo().path();
path = runnable.executable.parentDir();
}
}
if (path.isEmpty()) {
if (activeTarget && activeTarget->activeBuildConfiguration()) {
path = activeTarget->activeBuildConfiguration()->buildDirectory().toString();
} else if (project) {
path = project->projectDirectory().toString();
}
if (activeTarget && activeTarget->activeBuildConfiguration())
path = activeTarget->activeBuildConfiguration()->buildDirectory();
else if (project)
path = project->projectDirectory();
}
m_pathChooser->setInitialBrowsePathBackup(path);
}