// This file is generated by kconfig_compiler_kf6 from spectacle.kcfg.
// All changes you do to this file will be lost.

#include "settings.h"

#include <qglobal.h>
#include <QFile>
#include <QQmlEngine>

class SettingsHelper
{
  public:
    SettingsHelper() : q(nullptr) {}
    ~SettingsHelper() { delete q; q = nullptr; }
    SettingsHelper(const SettingsHelper&) = delete;
    SettingsHelper& operator=(const SettingsHelper&) = delete;
    Settings *q;
};
Q_GLOBAL_STATIC(SettingsHelper, s_globalSettings)
Settings *Settings::self()
{
  if (!s_globalSettings()->q) {
    new Settings;
    s_globalSettings()->q->read();
  }

  return s_globalSettings()->q;
}

Settings *Settings::create(QQmlEngine *, QJSEngine *)
{
  QQmlEngine::setObjectOwnership(self(), QQmlEngine::CppOwnership);
  return self();
}

Settings::Settings( )
  : KConfigSkeleton()
{
  Q_ASSERT(!s_globalSettings()->q);
  s_globalSettings()->q = this;
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&Settings::itemChanged);

  setCurrentGroup( QStringLiteral( "General" ) );

  QList<KConfigSkeleton::ItemEnum::Choice> valueslaunchAction;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("TakeRectangularScreenshot");
    valueslaunchAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("TakeFullscreenScreenshot");
    valueslaunchAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("UseLastUsedCapturemode");
    valueslaunchAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("DoNotTakeScreenshot");
    valueslaunchAction.append( choice );
  }
  KConfigCompilerSignallingItem  *itemLaunchAction;
  KConfigSkeleton::ItemEnum  *innerItemLaunchAction;
  innerItemLaunchAction = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "launchAction" ), mLaunchAction, valueslaunchAction, TakeRectangularScreenshot );
  itemLaunchAction = new KConfigCompilerSignallingItem(innerItemLaunchAction, this, notifyFunction, signalLaunchActionChanged);
  addItem( itemLaunchAction, QStringLiteral( "launchAction" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesprintKeyRunningAction;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("TakeNewScreenshot");
    valuesprintKeyRunningAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("StartNewInstance");
    valuesprintKeyRunningAction.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("FocusWindow");
    valuesprintKeyRunningAction.append( choice );
  }
  KConfigCompilerSignallingItem  *itemPrintKeyRunningAction;
  KConfigSkeleton::ItemEnum  *innerItemPrintKeyRunningAction;
  innerItemPrintKeyRunningAction = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "printKeyRunningAction" ), mPrintKeyRunningAction, valuesprintKeyRunningAction, TakeNewScreenshot );
  itemPrintKeyRunningAction = new KConfigCompilerSignallingItem(innerItemPrintKeyRunningAction, this, notifyFunction, signalPrintKeyRunningActionChanged);
  addItem( itemPrintKeyRunningAction, QStringLiteral( "printKeyRunningAction" ) );
  KConfigCompilerSignallingItem  *itemAutoSaveImage;
  KConfigSkeleton::ItemBool  *innerItemAutoSaveImage;
  innerItemAutoSaveImage = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "autoSaveImage" ), mAutoSaveImage, false );
  itemAutoSaveImage = new KConfigCompilerSignallingItem(innerItemAutoSaveImage, this, notifyFunction, signalAutoSaveImageChanged);
  addItem( itemAutoSaveImage, QStringLiteral( "autoSaveImage" ) );
  KConfigCompilerSignallingItem  *itemCloseAfterOcr;
  KConfigSkeleton::ItemBool  *innerItemCloseAfterOcr;
  innerItemCloseAfterOcr = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "closeAfterOcr" ), mCloseAfterOcr, false );
  itemCloseAfterOcr = new KConfigCompilerSignallingItem(innerItemCloseAfterOcr, this, notifyFunction, signalCloseAfterOcrChanged);
  addItem( itemCloseAfterOcr, QStringLiteral( "closeAfterOcr" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesclipboardGroup;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("PostScreenshotDoNothing");
    valuesclipboardGroup.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("PostScreenshotCopyImage");
    valuesclipboardGroup.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("PostScreenshotCopyLocation");
    valuesclipboardGroup.append( choice );
  }
  KConfigCompilerSignallingItem  *itemClipboardGroup;
  KConfigSkeleton::ItemEnum  *innerItemClipboardGroup;
  innerItemClipboardGroup = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "clipboardGroup" ), mClipboardGroup, valuesclipboardGroup, PostScreenshotDoNothing );
  itemClipboardGroup = new KConfigCompilerSignallingItem(innerItemClipboardGroup, this, notifyFunction, signalClipboardGroupChanged);
  addItem( itemClipboardGroup, QStringLiteral( "clipboardGroup" ) );
  KConfigCompilerSignallingItem  *itemUseLightMaskColor;
  KConfigSkeleton::ItemBool  *innerItemUseLightMaskColor;
  innerItemUseLightMaskColor = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useLightMaskColor" ), mUseLightMaskColor, false );
  itemUseLightMaskColor = new KConfigCompilerSignallingItem(innerItemUseLightMaskColor, this, notifyFunction, signalUseLightMaskColorChanged);
  addItem( itemUseLightMaskColor, QStringLiteral( "useLightMaskColor" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesshowMagnifier;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("ShowMagnifierNever");
    valuesshowMagnifier.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("ShowMagnifierAlways");
    valuesshowMagnifier.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("ShowMagnifierShiftHeld");
    valuesshowMagnifier.append( choice );
  }
  KConfigCompilerSignallingItem  *itemShowMagnifier;
  KConfigSkeleton::ItemEnum  *innerItemShowMagnifier;
  innerItemShowMagnifier = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "showMagnifier" ), mShowMagnifier, valuesshowMagnifier, ShowMagnifierShiftHeld );
  itemShowMagnifier = new KConfigCompilerSignallingItem(innerItemShowMagnifier, this, notifyFunction, signalShowMagnifierChanged);
  addItem( itemShowMagnifier, QStringLiteral( "showMagnifier" ) );
  KConfigCompilerSignallingItem  *itemUseReleaseToCapture;
  KConfigSkeleton::ItemBool  *innerItemUseReleaseToCapture;
  innerItemUseReleaseToCapture = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useReleaseToCapture" ), mUseReleaseToCapture, false );
  itemUseReleaseToCapture = new KConfigCompilerSignallingItem(innerItemUseReleaseToCapture, this, notifyFunction, signalUseReleaseToCaptureChanged);
  addItem( itemUseReleaseToCapture, QStringLiteral( "useReleaseToCapture" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesrememberSelectionRect;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Never");
    valuesrememberSelectionRect.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Always");
    valuesrememberSelectionRect.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("UntilClosed");
    valuesrememberSelectionRect.append( choice );
  }
  KConfigCompilerSignallingItem  *itemRememberSelectionRect;
  KConfigSkeleton::ItemEnum  *innerItemRememberSelectionRect;
  innerItemRememberSelectionRect = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "rememberSelectionRect" ), mRememberSelectionRect, valuesrememberSelectionRect, UntilClosed );
  itemRememberSelectionRect = new KConfigCompilerSignallingItem(innerItemRememberSelectionRect, this, notifyFunction, signalRememberSelectionRectChanged);
  addItem( itemRememberSelectionRect, QStringLiteral( "rememberSelectionRect" ) );
  QStringList defaultocrLanguages;
  defaultocrLanguages.append( QString::fromUtf8( "eng" ) );

  KConfigCompilerSignallingItem  *itemOcrLanguages;
  KConfigSkeleton::ItemStringList  *innerItemOcrLanguages;
  innerItemOcrLanguages = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "ocrLanguages" ), mOcrLanguages, defaultocrLanguages );
  itemOcrLanguages = new KConfigCompilerSignallingItem(innerItemOcrLanguages, this, notifyFunction, signalOcrLanguagesChanged);
  addItem( itemOcrLanguages, QStringLiteral( "ocrLanguages" ) );

  setCurrentGroup( QStringLiteral( "GuiConfig" ) );

  KConfigCompilerSignallingItem  *itemSelectionRect;
  KConfigSkeleton::ItemRectF  *innerItemSelectionRect;
  innerItemSelectionRect = new KConfigSkeleton::ItemRectF( currentGroup(), QStringLiteral( "selectionRect" ), mSelectionRect, QRectF(0,0,0,0) );
  itemSelectionRect = new KConfigCompilerSignallingItem(innerItemSelectionRect, this, notifyFunction, signalSelectionRectChanged);
  addItem( itemSelectionRect, QStringLiteral( "selectionRect" ) );
  KConfigCompilerSignallingItem  *itemCaptureOnClick;
  KConfigSkeleton::ItemBool  *innerItemCaptureOnClick;
  innerItemCaptureOnClick = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "captureOnClick" ), mCaptureOnClick, false );
  itemCaptureOnClick = new KConfigCompilerSignallingItem(innerItemCaptureOnClick, this, notifyFunction, signalCaptureOnClickChanged);
  addItem( itemCaptureOnClick, QStringLiteral( "captureOnClick" ) );
  KConfigCompilerSignallingItem  *itemIncludePointer;
  KConfigSkeleton::ItemBool  *innerItemIncludePointer;
  innerItemIncludePointer = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "includePointer" ), mIncludePointer, false );
  itemIncludePointer = new KConfigCompilerSignallingItem(innerItemIncludePointer, this, notifyFunction, signalIncludePointerChanged);
  addItem( itemIncludePointer, QStringLiteral( "includePointer" ) );
  KConfigCompilerSignallingItem  *itemVideoIncludePointer;
  KConfigSkeleton::ItemBool  *innerItemVideoIncludePointer;
  innerItemVideoIncludePointer = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "videoIncludePointer" ), mVideoIncludePointer, true );
  itemVideoIncludePointer = new KConfigCompilerSignallingItem(innerItemVideoIncludePointer, this, notifyFunction, signalVideoIncludePointerChanged);
  addItem( itemVideoIncludePointer, QStringLiteral( "videoIncludePointer" ) );
  KConfigCompilerSignallingItem  *itemIncludeDecorations;
  KConfigSkeleton::ItemBool  *innerItemIncludeDecorations;
  innerItemIncludeDecorations = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "includeDecorations" ), mIncludeDecorations, true );
  itemIncludeDecorations = new KConfigCompilerSignallingItem(innerItemIncludeDecorations, this, notifyFunction, signalIncludeDecorationsChanged);
  addItem( itemIncludeDecorations, QStringLiteral( "includeDecorations" ) );
  KConfigCompilerSignallingItem  *itemIncludeShadow;
  KConfigSkeleton::ItemBool  *innerItemIncludeShadow;
  innerItemIncludeShadow = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "includeShadow" ), mIncludeShadow, true );
  itemIncludeShadow = new KConfigCompilerSignallingItem(innerItemIncludeShadow, this, notifyFunction, signalIncludeShadowChanged);
  addItem( itemIncludeShadow, QStringLiteral( "includeShadow" ) );
  KConfigCompilerSignallingItem  *itemTransientOnly;
  KConfigSkeleton::ItemBool  *innerItemTransientOnly;
  innerItemTransientOnly = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "transientOnly" ), mTransientOnly, false );
  itemTransientOnly = new KConfigCompilerSignallingItem(innerItemTransientOnly, this, notifyFunction, signalTransientOnlyChanged);
  addItem( itemTransientOnly, QStringLiteral( "transientOnly" ) );
  KConfigCompilerSignallingItem  *itemQuitAfterSaveCopyExport;
  KConfigSkeleton::ItemBool  *innerItemQuitAfterSaveCopyExport;
  innerItemQuitAfterSaveCopyExport = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "quitAfterSaveCopyExport" ), mQuitAfterSaveCopyExport, false );
  itemQuitAfterSaveCopyExport = new KConfigCompilerSignallingItem(innerItemQuitAfterSaveCopyExport, this, notifyFunction, signalQuitAfterSaveCopyExportChanged);
  addItem( itemQuitAfterSaveCopyExport, QStringLiteral( "quitAfterSaveCopyExport" ) );
  KConfigCompilerSignallingItem  *itemCaptureDelay;
  KConfigSkeleton::ItemDouble  *innerItemCaptureDelay;
  innerItemCaptureDelay = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "captureDelay" ), mCaptureDelay, 0 );
  itemCaptureDelay = new KConfigCompilerSignallingItem(innerItemCaptureDelay, this, notifyFunction, signalCaptureDelayChanged);
  innerItemCaptureDelay->setMinValue(0);
  addItem( itemCaptureDelay, QStringLiteral( "captureDelay" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuescaptureMode;
  KConfigCompilerSignallingItem  *itemCaptureMode;
  KConfigSkeleton::ItemEnum  *innerItemCaptureMode;
  innerItemCaptureMode = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "captureMode" ), mCaptureMode, valuescaptureMode, CaptureModeModel::CaptureMode::AllScreens );
  itemCaptureMode = new KConfigCompilerSignallingItem(innerItemCaptureMode, this, notifyFunction, signalCaptureModeChanged);
  addItem( itemCaptureMode, QStringLiteral( "captureMode" ) );

  setCurrentGroup( QStringLiteral( "ImageSave" ) );


            QUrl defaultImageSaveLocation;
            // This is inserted as is, so we enclose it in a scope to prevent name conflicts.
            {
                // We only want to set the translated folder name once so the user doesn't end up
                // with a bunch of different folders when they temporarily change languages.
                auto pictures = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
                auto subFolder = onceTranslatedString(Settings::self(), Settings::self()->currentGroup(),
                                                      "translatedScreenshotsFolder",
                                                      i18nc("translatable folder name", "Screenshots"));
                defaultImageSaveLocation = QUrl::fromLocalFile(pictures + u'/' + subFolder + u'/');
            }
        
  KConfigCompilerSignallingItem  *itemImageSaveLocation;
  KConfigSkeleton::ItemUrl  *innerItemImageSaveLocation;
  innerItemImageSaveLocation = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "imageSaveLocation" ), mImageSaveLocation, defaultImageSaveLocation );
  itemImageSaveLocation = new KConfigCompilerSignallingItem(innerItemImageSaveLocation, this, notifyFunction, signalImageSaveLocationChanged);
  addItem( itemImageSaveLocation, QStringLiteral( "imageSaveLocation" ) );
  KConfigCompilerSignallingItem  *itemImageCompressionQuality;
  KConfigSkeleton::ItemUInt  *innerItemImageCompressionQuality;
  innerItemImageCompressionQuality = new KConfigSkeleton::ItemUInt( currentGroup(), QStringLiteral( "imageCompressionQuality" ), mImageCompressionQuality, 90 );
  itemImageCompressionQuality = new KConfigCompilerSignallingItem(innerItemImageCompressionQuality, this, notifyFunction, signalImageCompressionQualityChanged);
  innerItemImageCompressionQuality->setMinValue(0);
  innerItemImageCompressionQuality->setMaxValue(100);
  addItem( itemImageCompressionQuality, QStringLiteral( "imageCompressionQuality" ) );
  KConfigCompilerSignallingItem  *itemPreferredImageFormat;
  KConfigSkeleton::ItemString  *innerItemPreferredImageFormat;
  innerItemPreferredImageFormat = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "preferredImageFormat" ), mPreferredImageFormat, QStringLiteral( "PNG" ) );
  itemPreferredImageFormat = new KConfigCompilerSignallingItem(innerItemPreferredImageFormat, this, notifyFunction, signalPreferredImageFormatChanged);
  addItem( itemPreferredImageFormat, QStringLiteral( "preferredImageFormat" ) );
  KConfigCompilerSignallingItem  *itemImageFilenameTemplate;
  KConfigSkeleton::ItemString  *innerItemImageFilenameTemplate;
  innerItemImageFilenameTemplate = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "imageFilenameTemplate" ), mImageFilenameTemplate, 
            i18nc("part of default image filename template", "Screenshot")
            + u"_<yyyy><MM><dd>_<HH><mm><ss>"
         );
  itemImageFilenameTemplate = new KConfigCompilerSignallingItem(innerItemImageFilenameTemplate, this, notifyFunction, signalImageFilenameTemplateChanged);
  addItem( itemImageFilenameTemplate, QStringLiteral( "imageFilenameTemplate" ) );
  KConfigCompilerSignallingItem  *itemLastImageSaveLocation;
  KConfigSkeleton::ItemUrl  *innerItemLastImageSaveLocation;
  innerItemLastImageSaveLocation = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "lastImageSaveLocation" ), mLastImageSaveLocation, imageSaveLocation() );
  itemLastImageSaveLocation = new KConfigCompilerSignallingItem(innerItemLastImageSaveLocation, this, notifyFunction, signalLastImageSaveLocationChanged);
  addItem( itemLastImageSaveLocation, QStringLiteral( "lastImageSaveLocation" ) );
  KConfigCompilerSignallingItem  *itemLastImageSaveAsLocation;
  KConfigSkeleton::ItemUrl  *innerItemLastImageSaveAsLocation;
  innerItemLastImageSaveAsLocation = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "lastImageSaveAsLocation" ), mLastImageSaveAsLocation, imageSaveLocation() );
  itemLastImageSaveAsLocation = new KConfigCompilerSignallingItem(innerItemLastImageSaveAsLocation, this, notifyFunction, signalLastImageSaveAsLocationChanged);
  addItem( itemLastImageSaveAsLocation, QStringLiteral( "lastImageSaveAsLocation" ) );

  setCurrentGroup( QStringLiteral( "VideoSave" ) );


            QUrl defaultVideoSaveLocation;
            // This is inserted as is, so we enclose it in a scope to prevent name conflicts.
            {
                // We only want to set the translated folder name once so the user doesn't end up
                // with a bunch of different folders when they temporarily change languages.
                auto videos = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation);
                auto subFolder = onceTranslatedString(Settings::self(), Settings::self()->currentGroup(),
                                                      "translatedScreencastsFolder",
                                                      i18nc("translatable folder name", "Screencasts"));
                defaultVideoSaveLocation = QUrl::fromLocalFile(videos + u'/' + subFolder + u'/');
            }
        
  KConfigCompilerSignallingItem  *itemVideoSaveLocation;
  KConfigSkeleton::ItemUrl  *innerItemVideoSaveLocation;
  innerItemVideoSaveLocation = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "videoSaveLocation" ), mVideoSaveLocation, defaultVideoSaveLocation );
  itemVideoSaveLocation = new KConfigCompilerSignallingItem(innerItemVideoSaveLocation, this, notifyFunction, signalVideoSaveLocationChanged);
  addItem( itemVideoSaveLocation, QStringLiteral( "videoSaveLocation" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuespreferredVideoFormat;
  KConfigCompilerSignallingItem  *itemPreferredVideoFormat;
  KConfigSkeleton::ItemEnum  *innerItemPreferredVideoFormat;
  innerItemPreferredVideoFormat = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "preferredVideoFormat" ), mPreferredVideoFormat, valuespreferredVideoFormat, VideoPlatform::Format::DefaultFormat );
  itemPreferredVideoFormat = new KConfigCompilerSignallingItem(innerItemPreferredVideoFormat, this, notifyFunction, signalPreferredVideoFormatChanged);
  addItem( itemPreferredVideoFormat, QStringLiteral( "preferredVideoFormat" ) );
  KConfigCompilerSignallingItem  *itemVideoFilenameTemplate;
  KConfigSkeleton::ItemString  *innerItemVideoFilenameTemplate;
  innerItemVideoFilenameTemplate = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "videoFilenameTemplate" ), mVideoFilenameTemplate, 
            i18nc("part of default video filename template", "Screencast")
            + u"_<yyyy><MM><dd>_<HH><mm><ss>"
         );
  itemVideoFilenameTemplate = new KConfigCompilerSignallingItem(innerItemVideoFilenameTemplate, this, notifyFunction, signalVideoFilenameTemplateChanged);
  addItem( itemVideoFilenameTemplate, QStringLiteral( "videoFilenameTemplate" ) );
  KConfigCompilerSignallingItem  *itemLastVideoSaveLocation;
  KConfigSkeleton::ItemUrl  *innerItemLastVideoSaveLocation;
  innerItemLastVideoSaveLocation = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "lastVideoSaveLocation" ), mLastVideoSaveLocation, videoSaveLocation() );
  itemLastVideoSaveLocation = new KConfigCompilerSignallingItem(innerItemLastVideoSaveLocation, this, notifyFunction, signalLastVideoSaveLocationChanged);
  addItem( itemLastVideoSaveLocation, QStringLiteral( "lastVideoSaveLocation" ) );
  KConfigCompilerSignallingItem  *itemLastVideoSaveAsLocation;
  KConfigSkeleton::ItemUrl  *innerItemLastVideoSaveAsLocation;
  innerItemLastVideoSaveAsLocation = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "lastVideoSaveAsLocation" ), mLastVideoSaveAsLocation, videoSaveLocation() );
  itemLastVideoSaveAsLocation = new KConfigCompilerSignallingItem(innerItemLastVideoSaveAsLocation, this, notifyFunction, signalLastVideoSaveAsLocationChanged);
  addItem( itemLastVideoSaveAsLocation, QStringLiteral( "lastVideoSaveAsLocation" ) );
}

int Settings::defaultLaunchActionValue_helper()
{

  return TakeRectangularScreenshot;
}

int Settings::defaultPrintKeyRunningActionValue_helper()
{

  return TakeNewScreenshot;
}

bool Settings::defaultAutoSaveImageValue_helper()
{

  return false;
}

bool Settings::defaultCloseAfterOcrValue_helper()
{

  return false;
}

int Settings::defaultClipboardGroupValue_helper()
{

  return PostScreenshotDoNothing;
}

bool Settings::defaultUseLightMaskColorValue_helper()
{

  return false;
}

int Settings::defaultShowMagnifierValue_helper()
{

  return ShowMagnifierShiftHeld;
}

bool Settings::defaultUseReleaseToCaptureValue_helper()
{

  return false;
}

int Settings::defaultRememberSelectionRectValue_helper()
{

  return UntilClosed;
}

QStringList Settings::defaultOcrLanguagesValue_helper()
{
  QStringList defaultocrLanguages;
  defaultocrLanguages.append( QString::fromUtf8( "eng" ) );

  return defaultocrLanguages;
}

QRectF Settings::defaultSelectionRectValue_helper()
{

  return QRectF(0,0,0,0);
}

bool Settings::defaultCaptureOnClickValue_helper()
{

  return false;
}

bool Settings::defaultIncludePointerValue_helper()
{

  return false;
}

bool Settings::defaultVideoIncludePointerValue_helper()
{

  return true;
}

bool Settings::defaultIncludeDecorationsValue_helper()
{

  return true;
}

bool Settings::defaultIncludeShadowValue_helper()
{

  return true;
}

bool Settings::defaultTransientOnlyValue_helper()
{

  return false;
}

bool Settings::defaultQuitAfterSaveCopyExportValue_helper()
{

  return false;
}

double Settings::defaultCaptureDelayValue_helper()
{

  return 0;
}

int Settings::defaultCaptureModeValue_helper()
{

  return CaptureModeModel::CaptureMode::AllScreens;
}

QUrl Settings::defaultImageSaveLocationValue_helper()
{

            QUrl defaultImageSaveLocation;
            // This is inserted as is, so we enclose it in a scope to prevent name conflicts.
            {
                // We only want to set the translated folder name once so the user doesn't end up
                // with a bunch of different folders when they temporarily change languages.
                auto pictures = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
                auto subFolder = onceTranslatedString(Settings::self(), Settings::self()->currentGroup(),
                                                      "translatedScreenshotsFolder",
                                                      i18nc("translatable folder name", "Screenshots"));
                defaultImageSaveLocation = QUrl::fromLocalFile(pictures + u'/' + subFolder + u'/');
            }
        
  return defaultImageSaveLocation;
}

uint Settings::defaultImageCompressionQualityValue_helper()
{

  return 90;
}

QString Settings::defaultPreferredImageFormatValue_helper()
{

  return QStringLiteral( "PNG" );
}

QString Settings::defaultImageFilenameTemplateValue_helper()
{

  return 
            i18nc("part of default image filename template", "Screenshot")
            + u"_<yyyy><MM><dd>_<HH><mm><ss>"
        ;
}

QUrl Settings::defaultLastImageSaveLocationValue_helper()
{

  return imageSaveLocation();
}

QUrl Settings::defaultLastImageSaveAsLocationValue_helper()
{

  return imageSaveLocation();
}

QUrl Settings::defaultVideoSaveLocationValue_helper()
{

            QUrl defaultVideoSaveLocation;
            // This is inserted as is, so we enclose it in a scope to prevent name conflicts.
            {
                // We only want to set the translated folder name once so the user doesn't end up
                // with a bunch of different folders when they temporarily change languages.
                auto videos = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation);
                auto subFolder = onceTranslatedString(Settings::self(), Settings::self()->currentGroup(),
                                                      "translatedScreencastsFolder",
                                                      i18nc("translatable folder name", "Screencasts"));
                defaultVideoSaveLocation = QUrl::fromLocalFile(videos + u'/' + subFolder + u'/');
            }
        
  return defaultVideoSaveLocation;
}

int Settings::defaultPreferredVideoFormatValue_helper()
{

  return VideoPlatform::Format::DefaultFormat;
}

QString Settings::defaultVideoFilenameTemplateValue_helper()
{

  return 
            i18nc("part of default video filename template", "Screencast")
            + u"_<yyyy><MM><dd>_<HH><mm><ss>"
        ;
}

QUrl Settings::defaultLastVideoSaveLocationValue_helper()
{

  return videoSaveLocation();
}

QUrl Settings::defaultLastVideoSaveAsLocationValue_helper()
{

  return videoSaveLocation();
}

Settings::~Settings()
{
  if (s_globalSettings.exists() && !s_globalSettings.isDestroyed()) {
    s_globalSettings()->q = nullptr;
  }
}


void Settings::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalLaunchActionChanged:
    Q_EMIT launchActionChanged();
    break;
  case signalPrintKeyRunningActionChanged:
    Q_EMIT printKeyRunningActionChanged();
    break;
  case signalAutoSaveImageChanged:
    Q_EMIT autoSaveImageChanged();
    break;
  case signalCloseAfterOcrChanged:
    Q_EMIT closeAfterOcrChanged();
    break;
  case signalClipboardGroupChanged:
    Q_EMIT clipboardGroupChanged();
    break;
  case signalUseLightMaskColorChanged:
    Q_EMIT useLightMaskColorChanged();
    break;
  case signalShowMagnifierChanged:
    Q_EMIT showMagnifierChanged();
    break;
  case signalUseReleaseToCaptureChanged:
    Q_EMIT useReleaseToCaptureChanged();
    break;
  case signalRememberSelectionRectChanged:
    Q_EMIT rememberSelectionRectChanged();
    break;
  case signalOcrLanguagesChanged:
    Q_EMIT ocrLanguagesChanged();
    break;
  case signalSelectionRectChanged:
    Q_EMIT selectionRectChanged();
    break;
  case signalCaptureOnClickChanged:
    Q_EMIT captureOnClickChanged();
    break;
  case signalIncludePointerChanged:
    Q_EMIT includePointerChanged();
    break;
  case signalVideoIncludePointerChanged:
    Q_EMIT videoIncludePointerChanged();
    break;
  case signalIncludeDecorationsChanged:
    Q_EMIT includeDecorationsChanged();
    break;
  case signalIncludeShadowChanged:
    Q_EMIT includeShadowChanged();
    break;
  case signalTransientOnlyChanged:
    Q_EMIT transientOnlyChanged();
    break;
  case signalQuitAfterSaveCopyExportChanged:
    Q_EMIT quitAfterSaveCopyExportChanged();
    break;
  case signalCaptureDelayChanged:
    Q_EMIT captureDelayChanged();
    break;
  case signalCaptureModeChanged:
    Q_EMIT captureModeChanged();
    break;
  case signalImageSaveLocationChanged:
    Q_EMIT imageSaveLocationChanged();
    break;
  case signalImageCompressionQualityChanged:
    Q_EMIT imageCompressionQualityChanged();
    break;
  case signalPreferredImageFormatChanged:
    Q_EMIT preferredImageFormatChanged();
    break;
  case signalImageFilenameTemplateChanged:
    Q_EMIT imageFilenameTemplateChanged();
    break;
  case signalLastImageSaveLocationChanged:
    Q_EMIT lastImageSaveLocationChanged();
    break;
  case signalLastImageSaveAsLocationChanged:
    Q_EMIT lastImageSaveAsLocationChanged();
    break;
  case signalVideoSaveLocationChanged:
    Q_EMIT videoSaveLocationChanged();
    break;
  case signalPreferredVideoFormatChanged:
    Q_EMIT preferredVideoFormatChanged();
    break;
  case signalVideoFilenameTemplateChanged:
    Q_EMIT videoFilenameTemplateChanged();
    break;
  case signalLastVideoSaveLocationChanged:
    Q_EMIT lastVideoSaveLocationChanged();
    break;
  case signalLastVideoSaveAsLocationChanged:
    Q_EMIT lastVideoSaveAsLocationChanged();
    break;
  }
}
