Changeset View
Changeset View
Standalone View
Standalone View
src/SpectacleConfig.cpp
Show First 20 Lines • Show All 354 Lines • ▼ Show 20 Line(s) | |||||
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 | 361 | // copy file to clipboard after the screenshot has been made | ||
362 | 362 | | |||
363 | SpectacleConfig::AfterTakingScreenshotAction SpectacleConfig::afterTakingScreenshotAction() const | 363 | bool SpectacleConfig::copyImageToClipboard() const | ||
364 | { | 364 | { | ||
365 | int doNothing = static_cast<int>(SpectacleConfig::AfterTakingScreenshotAction::DoNothing); | 365 | return mGeneralConfig.readEntry(QStringLiteral("copyImageToClipboard"), false); | ||
366 | return static_cast<SpectacleConfig::AfterTakingScreenshotAction>(mGeneralConfig.readEntry(QStringLiteral("afterTakingScreenshot"), doNothing)); | | |||
367 | } | 366 | } | ||
368 | 367 | | |||
369 | void SpectacleConfig::setAfterTakingScreenshotAction (SpectacleConfig::AfterTakingScreenshotAction action) | 368 | void SpectacleConfig::setCopyImageToClipboard (bool enabled) | ||
370 | { | 369 | { | ||
371 | mGeneralConfig.writeEntry(QStringLiteral("afterTakingScreenshot"), static_cast<int>(action)); | 370 | mGeneralConfig.writeEntry(QStringLiteral("copyImageToClipboard"), enabled); | ||
371 | mGeneralConfig.sync(); | ||||
372 | } | ||||
373 | | ||||
374 | bool SpectacleConfig::autoSaveImage() const | ||||
375 | { | ||||
376 | return mGeneralConfig.readEntry(QStringLiteral("autoSaveImage"), false); | ||||
377 | } | ||||
378 | void SpectacleConfig::setAutoSaveImage(bool enabled) | ||||
379 | { | ||||
380 | mGeneralConfig.writeEntry(QStringLiteral("autoSaveImage"), enabled); | ||||
372 | mGeneralConfig.sync(); | 381 | mGeneralConfig.sync(); | ||
373 | } | 382 | } | ||
374 | 383 | | |||
375 | // copy file location to clipboard after saving | 384 | // copy file location to clipboard after saving | ||
376 | 385 | | |||
377 | bool SpectacleConfig::copySaveLocationToClipboard() const | 386 | bool SpectacleConfig::copySaveLocationToClipboard() const | ||
378 | { | 387 | { | ||
379 | return mGeneralConfig.readEntry(QStringLiteral("copySaveLocation"), false); | 388 | return mGeneralConfig.readEntry(QStringLiteral("copySaveLocation"), false); | ||
Show All 39 Lines |