Commit 9e0741c7 authored by Piyush Aggarwal's avatar Piyush Aggarwal 🎮
Browse files

urlhandler: add 'device' optional arg

parent f4cb713c
......@@ -57,9 +57,11 @@ int main(int argc, char** argv)
QUrl urlToShare;
bool open;
QString deviceId;
{
QCommandLineParser parser;
parser.addPositionalArgument(QStringLiteral("url"), i18n("URL to share"));
parser.addOption(QCommandLineOption(QStringLiteral("device"), i18n("Select a device"), i18n("id")));
parser.addOption(QCommandLineOption(QStringLiteral("open"), QStringLiteral("Open the file on the remote device")));
about.setupCommandLine(&parser);
parser.process(app);
......@@ -68,6 +70,7 @@ int main(int argc, char** argv)
urlToShare = QUrl::fromUserInput(parser.positionalArguments().constFirst(), QDir::currentPath(), QUrl::AssumeLocalFile);
}
open = parser.isSet(QStringLiteral("open"));
deviceId = parser.value(QStringLiteral("device"));
}
DevicesModel model;
......@@ -81,6 +84,11 @@ int main(int argc, char** argv)
Ui::Dialog uidialog;
uidialog.setupUi(&dialog);
uidialog.devicePicker->setModel(&proxyModel);
if (!deviceId.isEmpty()) {
uidialog.devicePicker->setCurrentIndex(model.rowForDevice(deviceId));
}
uidialog.openOnPeerCheckBox->setChecked(open);
KUrlRequester* urlRequester = new KUrlRequester(&dialog);
......
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