Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/krun_p.h
Show All 35 Lines | |||||
36 | * It sends a notification when the process exits (for the taskbar) | 36 | * It sends a notification when the process exits (for the taskbar) | ||
37 | * and it will show an error message if necessary (e.g. "program not found"). | 37 | * and it will show an error message if necessary (e.g. "program not found"). | ||
38 | */ | 38 | */ | ||
39 | class KProcessRunner : public QObject | 39 | class KProcessRunner : public QObject | ||
40 | { | 40 | { | ||
41 | Q_OBJECT | 41 | Q_OBJECT | ||
42 | 42 | | |||
43 | public: | 43 | public: | ||
44 | 44 | KProcessRunner(KProcess *p, const QString &binName, const KStartupInfoId &id); | |||
45 | static qint64 run(KProcess *p, const QString &executable, const KStartupInfoId &id); | | |||
46 | 45 | | |||
47 | virtual ~KProcessRunner(); | 46 | virtual ~KProcessRunner(); | ||
48 | 47 | | |||
49 | qint64 pid() const; | 48 | qint64 pid() const; | ||
50 | 49 | | |||
51 | protected Q_SLOTS: | 50 | Q_SIGNALS: | ||
51 | void error(const QString &errorString); | ||||
52 | 52 | | |||
53 | protected Q_SLOTS: | ||||
53 | void slotProcessExited(int, QProcess::ExitStatus); | 54 | void slotProcessExited(int, QProcess::ExitStatus); | ||
54 | 55 | | |||
55 | private: | 56 | private: | ||
56 | KProcessRunner(KProcess *p, const QString &binName, const KStartupInfoId &id); | | |||
57 | | ||||
58 | void terminateStartupNotification(); | 57 | void terminateStartupNotification(); | ||
59 | 58 | | |||
60 | KProcess *process; | 59 | KProcess *process; | ||
61 | QString m_executable; // can be a full path | 60 | QString m_executable; // can be a full path | ||
62 | KStartupInfoId id; | 61 | KStartupInfoId id; | ||
63 | qint64 m_pid; | 62 | qint64 m_pid; | ||
64 | 63 | | |||
65 | Q_DISABLE_COPY(KProcessRunner) | 64 | Q_DISABLE_COPY(KProcessRunner) | ||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |