forked from qt-creator/qt-creator
Terminal: Lazily open remote terminals
Move the burden of finding the shell of a device from the shell menu to the TerminalWidget, so that opening the shell menu does not block the ui. Change-Id: I7f2e5a891f20faa53a1e3eec879866219f9bee0b Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -17,6 +17,9 @@ FilePath defaultShellForDevice(const FilePath &deviceRoot)
|
||||
return deviceRoot.withNewPath("cmd.exe").searchInPath();
|
||||
|
||||
const Environment env = deviceRoot.deviceEnvironment();
|
||||
if (!env.hasChanges())
|
||||
return {};
|
||||
|
||||
FilePath shell = FilePath::fromUserInput(env.value_or("SHELL", "/bin/sh"));
|
||||
|
||||
if (!shell.isAbsolutePath())
|
||||
@@ -32,7 +35,6 @@ class HooksPrivate
|
||||
{
|
||||
public:
|
||||
HooksPrivate()
|
||||
: m_getTerminalCommandsForDevicesHook([] { return QList<NameAndCommandLine>{}; })
|
||||
{
|
||||
auto openTerminal = [](const OpenTerminalParameters ¶meters) {
|
||||
DeviceFileHooks::instance().openTerminal(parameters.workingDirectory.value_or(
|
||||
@@ -79,8 +81,6 @@ public:
|
||||
return m_openTerminal;
|
||||
}
|
||||
|
||||
Hooks::GetTerminalCommandsForDevicesHook m_getTerminalCommandsForDevicesHook;
|
||||
|
||||
private:
|
||||
Hooks::OpenTerminal m_openTerminal;
|
||||
Hooks::CreateTerminalProcessInterface m_createTerminalProcessInterface;
|
||||
@@ -111,11 +111,6 @@ ProcessInterface *Hooks::createTerminalProcessInterface() const
|
||||
return d->createTerminalProcessInterface()();
|
||||
}
|
||||
|
||||
Hooks::GetTerminalCommandsForDevicesHook &Hooks::getTerminalCommandsForDevicesHook()
|
||||
{
|
||||
return d->m_getTerminalCommandsForDevicesHook;
|
||||
}
|
||||
|
||||
void Hooks::addCallbackSet(const QString &name, const CallbackSet &callbackSet)
|
||||
{
|
||||
d->addCallbackSet(name, callbackSet);
|
||||
|
Reference in New Issue
Block a user