Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/krun.cpp
Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Line(s) | 121 | { | |||
---|---|---|---|---|---|
122 | return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, | 122 | return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, | ||
123 | QLatin1String("flatpak-info")).isEmpty() || | 123 | QLatin1String("flatpak-info")).isEmpty() || | ||
124 | qEnvironmentVariableIsSet("SNAP"); | 124 | qEnvironmentVariableIsSet("SNAP"); | ||
125 | } | 125 | } | ||
126 | 126 | | |||
127 | static qint64 runProcessRunner(KProcess *p, const QString &executable, const KStartupInfoId &id, QWidget *widget) | 127 | static qint64 runProcessRunner(KProcess *p, const QString &executable, const KStartupInfoId &id, QWidget *widget) | ||
128 | { | 128 | { | ||
129 | auto *processRunner = new KProcessRunner(p, executable, id); | 129 | auto *processRunner = new KProcessRunner(p, executable, id); | ||
130 | QObject::connect(processRunner, &KProcessRunner::error, widget, [widget](const QString &errorString) { | 130 | QObject *receiver = widget ? static_cast<QObject *>(widget) : static_cast<QObject *>(qApp); | ||
131 | QObject::connect(processRunner, &KProcessRunner::error, receiver, [widget](const QString &errorString) { | ||||
131 | QEventLoopLocker locker; | 132 | QEventLoopLocker locker; | ||
132 | KMessageBox::sorry(widget, errorString); | 133 | KMessageBox::sorry(widget, errorString); | ||
133 | }); | 134 | }); | ||
134 | return processRunner->pid(); | 135 | return processRunner->pid(); | ||
135 | } | 136 | } | ||
136 | 137 | | |||
137 | // --------------------------------------------------------------------------- | 138 | // --------------------------------------------------------------------------- | ||
138 | 139 | | |||
▲ Show 20 Lines • Show All 1542 Lines • Show Last 20 Lines |