Changeset View
Changeset View
Standalone View
Standalone View
src/gui/applicationlauncherjob.cpp
Show All 29 Lines | 29 | explicit ApplicationLauncherJobPrivate(const KService::Ptr &service) | |||
---|---|---|---|---|---|
30 | : m_service(service) {} | 30 | : m_service(service) {} | ||
31 | 31 | | |||
32 | void slotStarted(KIO::ApplicationLauncherJob *q, KProcessRunner *processRunner) { | 32 | void slotStarted(KIO::ApplicationLauncherJob *q, KProcessRunner *processRunner) { | ||
33 | m_pids.append(processRunner->pid()); | 33 | m_pids.append(processRunner->pid()); | ||
34 | if (--m_numProcessesPending == 0) { | 34 | if (--m_numProcessesPending == 0) { | ||
35 | q->emitResult(); | 35 | q->emitResult(); | ||
36 | } | 36 | } | ||
37 | } | 37 | } | ||
38 | const KService::Ptr m_service; | 38 | KService::Ptr m_service; | ||
39 | QList<QUrl> m_urls; | 39 | QList<QUrl> m_urls; | ||
40 | KIO::ApplicationLauncherJob::RunFlags m_runFlags; | 40 | KIO::ApplicationLauncherJob::RunFlags m_runFlags; | ||
41 | QString m_suggestedFileName; | 41 | QString m_suggestedFileName; | ||
42 | QByteArray m_startupId; | 42 | QByteArray m_startupId; | ||
43 | QVector<qint64> m_pids; | 43 | QVector<qint64> m_pids; | ||
44 | QVector<KProcessRunner *> m_processRunners; | 44 | QVector<KProcessRunner *> m_processRunners; | ||
45 | int m_numProcessesPending = 0; | 45 | int m_numProcessesPending = 0; | ||
46 | }; | 46 | }; | ||
47 | 47 | | |||
48 | KIO::ApplicationLauncherJob::ApplicationLauncherJob(const KService::Ptr &service, QObject *parent) | 48 | KIO::ApplicationLauncherJob::ApplicationLauncherJob(const KService::Ptr &service, QObject *parent) | ||
49 | : KJob(parent), d(new ApplicationLauncherJobPrivate(service)) | 49 | : KJob(parent), d(new ApplicationLauncherJobPrivate(service)) | ||
50 | { | 50 | { | ||
51 | } | 51 | } | ||
52 | 52 | | |||
53 | KIO::ApplicationLauncherJob::ApplicationLauncherJob(const KService::Ptr &service, const KServiceAction &serviceAction, QObject *parent) | ||||
54 | : ApplicationLauncherJob(service, parent) | ||||
55 | { | ||||
56 | Q_ASSERT(d->m_service); | ||||
57 | d->m_service.detach(); | ||||
dfaure: Maybe this should even be a Q_ASSERT? We can't do much with a null service here. | |||||
58 | d->m_service->setExec(serviceAction.exec()); | ||||
59 | } | ||||
60 | | ||||
53 | KIO::ApplicationLauncherJob::~ApplicationLauncherJob() | 61 | KIO::ApplicationLauncherJob::~ApplicationLauncherJob() | ||
54 | { | 62 | { | ||
55 | // Do *NOT* delete the KProcessRunner instances here. | 63 | // Do *NOT* delete the KProcessRunner instances here. | ||
56 | // We need it to keep running so it can terminate startup notification on process exit. | 64 | // We need it to keep running so it can terminate startup notification on process exit. | ||
57 | } | 65 | } | ||
58 | 66 | | |||
59 | void KIO::ApplicationLauncherJob::setUrls(const QList<QUrl> &urls) | 67 | void KIO::ApplicationLauncherJob::setUrls(const QList<QUrl> &urls) | ||
60 | { | 68 | { | ||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |
Maybe this should even be a Q_ASSERT? We can't do much with a null service here.