diff options
author | Brendan Long <self@brendanlong.com> | 2019-02-09 20:08:07 +0300 |
---|---|---|
committer | Brendan Long <self@brendanlong.com> | 2019-02-09 20:08:07 +0300 |
commit | bfbc49301ffb33848a93c8401f5e9e2d3414d06b (patch) | |
tree | 37f3f2d77ff40caef25c846016a48d80b760398b | |
parent | 0780e6fd3612b8ce178f41423b52762d52c399f8 (diff) |
Auto-fill missing schema in TT-RSS URLttrss-improvements
This should make it less confusing if users pull in a host name with no
scheme.
I made it default to https:// for safety but this should make it
sufficiently obvious if the right scheme is http:// (I intentionally
made it update the input box so people can see what we're doing).
-rw-r--r-- | plugins/backend/ttrss/ttrssInterface.vala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/backend/ttrss/ttrssInterface.vala b/plugins/backend/ttrss/ttrssInterface.vala index e97dfeed..f09a7c9a 100644 --- a/plugins/backend/ttrss/ttrssInterface.vala +++ b/plugins/backend/ttrss/ttrssInterface.vala @@ -172,7 +172,13 @@ public void showHtAccess() public void writeData() { - m_utils.setURL(m_urlEntry.get_text()); + string url = m_urlEntry.get_text(); + if (GLib.Uri.parse_scheme(url) == null) + { + url = "https://" + url; + m_urlEntry.set_text(url); + } + m_utils.setURL(url); m_utils.setUser(m_userEntry.get_text().strip()); m_utils.setPassword(m_passwordEntry.get_text().strip()); } |