Skip to content

Commit c892982

Browse files
committed
Allow to overwrite the remote scheme
sftp is still the default scheme in case none is given.
1 parent 73b3a44 commit c892982

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/remote.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bool Remote::rewire_url(QUrl &url) {
1515
return false;
1616
}
1717

18-
url.setScheme("sftp");
18+
url.setScheme(scheme);
1919
url.setUserName(username);
2020
url.setHost(host);
2121
url.setPort(port);
@@ -26,6 +26,9 @@ bool Remote::rewire_url(QUrl &url) {
2626
void Remote::hardcode_prefix(const QString &prefix) {
2727
init_done = true;
2828
QUrl url {prefix};
29+
if (!url.scheme().isEmpty()) {
30+
scheme = url.scheme();
31+
}
2932
username = url.userName();
3033
host = url.host();
3134
port = url.port();

src/remote.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Remote {
1818
bool init_done = false;
1919
bool ok = false;
2020

21+
QString scheme = "sftp";
2122
QString username;
2223
QString host;
2324
int port = -1;

0 commit comments

Comments
 (0)