Commit 020d2ecc authored by David Faure's avatar David Faure Committed by Kurt Hindenburg

Fix QUrl porting error (missing fromLocalFile) and construct URL properly.

(to escape things like usernames correctly)

(cherry picked from commit f7322f8e)
parent e7fff97d
...@@ -991,12 +991,16 @@ QUrl Session::getUrl() ...@@ -991,12 +991,16 @@ QUrl Session::getUrl()
if (_foregroundProcessInfo->name(&ok) == "ssh" && ok) { if (_foregroundProcessInfo->name(&ok) == "ssh" && ok) {
SSHProcessInfo sshInfo(*_foregroundProcessInfo); SSHProcessInfo sshInfo(*_foregroundProcessInfo);
path = "ssh://" + sshInfo.userName() + '@' + sshInfo.host(); QUrl url;
url.setScheme("ssh");
url.setUserName(sshInfo.userName());
url.setHost(sshInfo.host());
QString port = sshInfo.port(); const QString port = sshInfo.port();
if (!port.isEmpty() && port != "22") { if (!port.isEmpty() && port != "22") {
path.append(':' + port); url.setPort(port.toInt());
} }
return url;
} else { } else {
path = _foregroundProcessInfo->currentDir(&ok); path = _foregroundProcessInfo->currentDir(&ok);
if (!ok) if (!ok)
...@@ -1009,7 +1013,7 @@ QUrl Session::getUrl() ...@@ -1009,7 +1013,7 @@ QUrl Session::getUrl()
} }
} }
return QUrl(path); return QUrl::fromLocalFile(path);
} }
void Session::setIconName(const QString& iconName) void Session::setIconName(const QString& iconName)
......
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