Changeset View
Changeset View
Standalone View
Standalone View
klipper/urlgrabber.cpp
Show All 25 Lines | |||||
26 | #include <QIcon> | 26 | #include <QIcon> | ||
27 | #include <QTimer> | 27 | #include <QTimer> | ||
28 | #include <QUuid> | 28 | #include <QUuid> | ||
29 | #include <QFile> | 29 | #include <QFile> | ||
30 | #include <QMenu> | 30 | #include <QMenu> | ||
31 | #include <QRegularExpression> | 31 | #include <QRegularExpression> | ||
32 | 32 | | |||
33 | #include <KLocalizedString> | 33 | #include <KLocalizedString> | ||
34 | #include <KIO/ApplicationLauncherJob> | ||||
35 | #include <KNotificationJobUiDelegate> | ||||
34 | #include <KService> | 36 | #include <KService> | ||
35 | #include <KStringHandler> | 37 | #include <KStringHandler> | ||
36 | #include <KMimeTypeTrader> | 38 | #include <KMimeTypeTrader> | ||
37 | #include <KRun> | | |||
38 | #include <KWindowSystem> | 39 | #include <KWindowSystem> | ||
39 | 40 | | |||
40 | #include "klippersettings.h" | 41 | #include "klippersettings.h" | ||
41 | #include "clipcommandprocess.h" | 42 | #include "clipcommandprocess.h" | ||
42 | 43 | | |||
43 | // TODO: script-interface? | 44 | // TODO: script-interface? | ||
44 | #include "history.h" | 45 | #include "history.h" | ||
45 | #include "historystringitem.h" | 46 | #include "historystringitem.h" | ||
▲ Show 20 Lines • Show All 247 Lines • ▼ Show 20 Line(s) | 287 | { | |||
293 | 294 | | |||
294 | if ( command.isEnabled ) { | 295 | if ( command.isEnabled ) { | ||
295 | QString text(m_myClipItem->text()); | 296 | QString text(m_myClipItem->text()); | ||
296 | if (m_stripWhiteSpace) { | 297 | if (m_stripWhiteSpace) { | ||
297 | text = text.trimmed(); | 298 | text = text.trimmed(); | ||
298 | } | 299 | } | ||
299 | if( !command.serviceStorageId.isEmpty()) { | 300 | if( !command.serviceStorageId.isEmpty()) { | ||
300 | KService::Ptr service = KService::serviceByStorageId( command.serviceStorageId ); | 301 | KService::Ptr service = KService::serviceByStorageId( command.serviceStorageId ); | ||
301 | KRun::runApplication( *service, QList< QUrl >() << QUrl( text ), nullptr ); | 302 | auto *job = new KIO::ApplicationLauncherJob(service); | ||
303 | job->setUrls({QUrl(text)}); | ||||
304 | job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled)); | ||||
305 | job->start(); | ||||
302 | } else { | 306 | } else { | ||
303 | ClipCommandProcess* proc = new ClipCommandProcess(*action, command, text, m_history, m_myClipItem); | 307 | ClipCommandProcess* proc = new ClipCommandProcess(*action, command, text, m_history, m_myClipItem); | ||
304 | if (proc->program().isEmpty()) { | 308 | if (proc->program().isEmpty()) { | ||
305 | delete proc; | 309 | delete proc; | ||
306 | proc = nullptr; | 310 | proc = nullptr; | ||
307 | } else { | 311 | } else { | ||
308 | proc->start(); | 312 | proc->start(); | ||
309 | } | 313 | } | ||
▲ Show 20 Lines • Show All 177 Lines • Show Last 20 Lines |