Skip to content

Commit

Permalink
Allow to overwrite the remote scheme
Browse files Browse the repository at this point in the history
sftp is still the default scheme in case none is given.
  • Loading branch information
vimpostor committed Jul 26, 2024
1 parent 73b3a44 commit c892982
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/remote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bool Remote::rewire_url(QUrl &url) {
return false;
}

url.setScheme("sftp");
url.setScheme(scheme);
url.setUserName(username);
url.setHost(host);
url.setPort(port);
Expand All @@ -26,6 +26,9 @@ bool Remote::rewire_url(QUrl &url) {
void Remote::hardcode_prefix(const QString &prefix) {
init_done = true;
QUrl url {prefix};
if (!url.scheme().isEmpty()) {
scheme = url.scheme();
}
username = url.userName();
host = url.host();
port = url.port();
Expand Down
1 change: 1 addition & 0 deletions src/remote.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Remote {
bool init_done = false;
bool ok = false;

QString scheme = "sftp";
QString username;
QString host;
int port = -1;
Expand Down

0 comments on commit c892982

Please sign in to comment.