Commit 862b448c authored by Nerdopolis Turfwalker's avatar Nerdopolis Turfwalker

kioclient: add "appmenu" command to use a kopenwith dialog as a basic launcher

It's best suited for a functional launcher in desktop environments such as weston
parent fd245e42
......@@ -26,6 +26,7 @@
#include <kio/transferjob.h>
#ifndef KIOCORE_ONLY
#include <KIO/JobUiDelegate>
#include <KIO/ApplicationLauncherJob>
#include <KPropertiesDialog>
#include <KService>
#include <KRun>
......@@ -96,6 +97,8 @@ static void usage()
" # 'url' may be a list of URLs.\n").toLocal8Bit().constData());
puts(i18n(" # the short version kioclient5 rm\n"
" # is also available.\n\n").toLocal8Bit().constData());
puts(i18n(" kioclient5 appmenu\n"
" # Opens a basic application launcher.\n\n").toLocal8Bit().constData());
puts(i18n("*** Examples:\n").toLocal8Bit().constData());
puts(i18n(" kioclient5 exec file:/home/weis/data/test.html\n"
......@@ -353,6 +356,15 @@ bool ClientApp::doIt(const QCommandLineParser& parser)
argc == 3 ? parser.positionalArguments().last() : QString(),
true );
}
else if ( command == QLatin1String("appmenu") )
{
auto *job = new KIO::ApplicationLauncherJob();
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, nullptr));
connect(job, &KJob::result, this, &ClientApp::slotResult);
job->start();
qApp->exec();
return m_ok;
}
#endif
else if ( command == QLatin1String("download") )
{
......
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