Commit 48202ef5 authored by Tomaz  Canabrava's avatar Tomaz Canabrava Committed by Kurt Hindenburg
Browse files

Make sshProcess a unique_ptr so we can use it when we need

And we will need it a bit outside of the inner scope in a bit.
parent f54e56f1
......@@ -1104,15 +1104,16 @@ bool Session::isRemote()
QString Session::getDynamicTitle()
{
ProcessInfo *process = getProcessInfo();
std::unique_ptr<SSHProcessInfo> sshProcess;
// format tab titles using process info
bool ok = false;
if (process->name(&ok) == QLatin1String("ssh") && ok) {
SSHProcessInfo sshInfo(*process);
sshProcess = std::make_unique<SSHProcessInfo>(*process);
QString title = tabTitleFormat(Session::RemoteTabTitle);
title.replace(QLatin1String("%w"), userTitle());
title.replace(QLatin1String("%#"), QString::number(sessionId()));
return sshInfo.format(title);
return sshProcess->format(title);
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment