Changeset View
Changeset View
Standalone View
Standalone View
src/SpectacleCore.cpp
Show First 20 Lines • Show All 284 Lines • ▼ Show 20 Line(s) | 284 | } else { | |||
---|---|---|---|---|---|
285 | notify->setText(i18n("A screenshot was saved as '%1' to '%2'.", savedAt.fileName(), path)); | 285 | notify->setText(i18n("A screenshot was saved as '%1' to '%2'.", savedAt.fileName(), path)); | ||
286 | } | 286 | } | ||
287 | 287 | | |||
288 | notify->setActions({i18nc("Open the screenshot we just saved", "Open")}); | 288 | notify->setActions({i18nc("Open the screenshot we just saved", "Open")}); | ||
289 | notify->setUrls({savedAt}); | 289 | notify->setUrls({savedAt}); | ||
290 | 290 | | |||
291 | connect(notify, &KNotification::action1Activated, this, [this, savedAt] { | 291 | connect(notify, &KNotification::action1Activated, this, [this, savedAt] { | ||
292 | new KRun(savedAt, nullptr); | 292 | new KRun(savedAt, nullptr); | ||
293 | QTimer::singleShot(250, this, &SpectacleCore::allDone); | 293 | QTimer::singleShot(250, this, [this] { | ||
294 | if (mStartMode != GuiMode) { | ||||
295 | emit allDone(); | ||||
296 | } | ||||
297 | }); | ||||
298 | }); | ||||
299 | connect(notify, &QObject::destroyed, this, [this] { | ||||
300 | if (mStartMode != GuiMode) { | ||||
301 | emit allDone(); | ||||
302 | } | ||||
294 | }); | 303 | }); | ||
295 | connect(notify, &QObject::destroyed, this, &SpectacleCore::allDone); | | |||
296 | 304 | | |||
297 | notify->sendEvent(); | 305 | notify->sendEvent(); | ||
298 | } | 306 | } | ||
299 | 307 | | |||
300 | void SpectacleCore::doCopyPath(const QUrl &savedAt) | 308 | void SpectacleCore::doCopyPath(const QUrl &savedAt) | ||
301 | { | 309 | { | ||
302 | if (SpectacleConfig::instance()->copySaveLocationToClipboard()) { | 310 | if (SpectacleConfig::instance()->copySaveLocationToClipboard()) { | ||
303 | qApp->clipboard()->setText(savedAt.toLocalFile()); | 311 | qApp->clipboard()->setText(savedAt.toLocalFile()); | ||
Show All 34 Lines |