From kde-commits Mon Jul 25 17:43:15 2016 From: Urs Wolfer Date: Mon, 25 Jul 2016 17:43:15 +0000 To: kde-commits Subject: [krdc] /: Make default protocol configurable Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=146946860430560 Git commit 89cd4132dcd384824dcec86caf1bdb04ec4a1a74 by Urs Wolfer, on behal= f of Arno M=C3=B6ller. Committed on 25/07/2016 at 17:44. Pushed by uwolfer into branch 'master'. Make default protocol configurable Add a new config option for the default protocol. Default protocol: protocol to use when passing a hostname via command line without a scheme. ~~ $ krdc my.host ~~ expands to vnc://my.host since the dawn of time. With the default protocol set to "rdp" it expands to rdp://my.host The default protocol defaults to vnc to keep the current behavior. REVIEW: 128496 M +18 -0 config/general.ui M +3 -0 core/krdc.kcfg M +3 -2 main.cpp http://commits.kde.org/krdc/89cd4132dcd384824dcec86caf1bdb04ec4a1a74 diff --git a/config/general.ui b/config/general.ui index 4a1f0e0..9380645 100644 --- a/config/general.ui +++ b/config/general.ui @@ -120,6 +120,24 @@ + + + + + + Default protocol: + + + + + + + vnc + + + + + diff --git a/core/krdc.kcfg b/core/krdc.kcfg index 7309350..1cb322c 100644 --- a/core/krdc.kcfg +++ b/core/krdc.kcfg @@ -60,6 +60,9 @@ 1 + + vnc + diff --git a/main.cpp b/main.cpp index d702bf2..99147f4 100644 --- a/main.cpp +++ b/main.cpp @@ -25,6 +25,7 @@ #include "mainwindow.h" #include "krdc_debug.h" #include "krdc_version.h" +#include "settings.h" = #include #include @@ -120,9 +121,9 @@ int main(int argc, char **argv) for (int i =3D 0; i < args.length(); ++i) { QUrl url =3D QUrl(args.at(i)); // no URL scheme, assume argument is only a hostname - // and default to vnc as protocol. if (url.scheme().isEmpty()) { - url.setScheme(QStringLiteral("vnc")); + QString defaultProto =3D Settings::defaultProtocol(); + url.setScheme(defaultProto); url.setHost(args.at(i)); url.setPath(QString()); }