Commit 89cd4132 authored by Arno Möller's avatar Arno Möller Committed by Urs Wolfer

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
parent d795833e
......@@ -120,6 +120,24 @@
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayoutP">
<item>
<widget class="QLabel" name="defaultProtocolLabel">
<property name="text">
<string>Default protocol:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="kcfg_DefaultProtocol">
<property name="text">
<string>vnc</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
......
......@@ -60,6 +60,9 @@
<entry name="ConnectionListSortOrder" type="Int">
<default>1</default>
</entry>
<entry name="DefaultProtocol" type="String">
<default>vnc</default>
</entry>
</group>
<group name="VNC">
<entry name="Quality" type="Int">
......
......@@ -25,6 +25,7 @@
#include "mainwindow.h"
#include "krdc_debug.h"
#include "krdc_version.h"
#include "settings.h"
#include <KCoreAddons/KAboutData>
#include <Kdelibs4ConfigMigrator>
......@@ -120,9 +121,9 @@ int main(int argc, char **argv)
for (int i = 0; i < args.length(); ++i) {
QUrl url = 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 = Settings::defaultProtocol();
url.setScheme(defaultProto);
url.setHost(args.at(i));
url.setPath(QString());
}
......
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