Changeset View
Changeset View
Standalone View
Standalone View
src/SpectacleConfig.cpp
Show First 20 Lines • Show All 352 Lines • ▼ Show 20 Line(s) | |||||
353 | } | 353 | } | ||
354 | 354 | | |||
355 | void SpectacleConfig::setDefaultSaveLocation(const QUrl &location) | 355 | void SpectacleConfig::setDefaultSaveLocation(const QUrl &location) | ||
356 | { | 356 | { | ||
357 | mGeneralConfig.writePathEntry(QStringLiteral("default-save-location"), location.toString()); | 357 | mGeneralConfig.writePathEntry(QStringLiteral("default-save-location"), location.toString()); | ||
358 | mGeneralConfig.sync(); | 358 | mGeneralConfig.sync(); | ||
359 | } | 359 | } | ||
360 | 360 | | |||
361 | // copy file to clipboard after the screenshot has been made | ||||
362 | | ||||
363 | bool SpectacleConfig::copyImageToClipboard() const | ||||
364 | { | ||||
365 | return mGeneralConfig.readEntry(QStringLiteral("copyImageToClipboard"), false); | ||||
366 | } | ||||
davidre: We forgot the actual config key, and I guess `clipboardAction` should be `doNothing`. The key… | |||||
367 | | ||||
368 | void SpectacleConfig::setCopyImageToClipboard(bool enabled) | ||||
369 | { | ||||
370 | mGeneralConfig.writeEntry(QStringLiteral("copyImageToClipboard"), enabled); | ||||
371 | mGeneralConfig.sync(); | ||||
372 | } | ||||
We don't need this whole logic here. The print key stuff needed it because one Focusing the window only works on X11 right now and not on Wayland. Just return static_cast<SpectacleConfig::CopyImageToClipboardSetting>(mGuiConfig.readEntry(QStringLiteral("copyImageToClipboard"), clipboardAction); (Or split in two lines if it is to long). davidre: We don't need this whole logic here. The print key stuff needed it because one Focusing the… | |||||
373 | | ||||
361 | // copy file location to clipboard after saving | 374 | // copy file location to clipboard after saving | ||
362 | 375 | | |||
363 | bool SpectacleConfig::copySaveLocationToClipboard() const | 376 | bool SpectacleConfig::copySaveLocationToClipboard() const | ||
364 | { | 377 | { | ||
365 | return mGeneralConfig.readEntry(QStringLiteral("copySaveLocation"), false); | 378 | return mGeneralConfig.readEntry(QStringLiteral("copySaveLocation"), false); | ||
366 | } | 379 | } | ||
367 | 380 | | |||
368 | void SpectacleConfig::setCopySaveLocationToClipboard(bool enabled) | 381 | void SpectacleConfig::setCopySaveLocationToClipboard(bool enabled) | ||
Show All 36 Lines |
We forgot the actual config key, and I guess clipboardAction should be doNothing. The key could. just be afterTakingScreenshot.