Allow to set environment for "Open Terminal"

Change-Id: If6e82ef8a7bbbaa947b41e0f6746d2b2aa770c20
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2018-08-31 10:54:47 +02:00
parent a1ba378d8c
commit 626665b7a4
5 changed files with 30 additions and 7 deletions

View File

@@ -108,12 +108,17 @@ void FileUtils::showInGraphicalShell(QWidget *parent, const QString &pathIn)
}
void FileUtils::openTerminal(const QString &path)
{
openTerminal(path, Environment::systemEnvironment());
}
void FileUtils::openTerminal(const QString &path, const Environment &env)
{
const QFileInfo fileInfo(path);
const QString pwd = QDir::toNativeSeparators(fileInfo.isDir() ?
fileInfo.absoluteFilePath() :
fileInfo.absolutePath());
ConsoleProcess::startTerminalEmulator(ICore::settings(), pwd);
ConsoleProcess::startTerminalEmulator(ICore::settings(), pwd, env);
}
QString FileUtils::msgFindInDirectory()