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

#include "config.h"

Settings::Settings( KSharedConfig::Ptr config, QObject *parent )
  : KConfigSkeleton( std::move( config ) )
{
  setParent(parent);
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&Settings::itemChanged);

  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigCompilerSignallingItem  *itemHideShorts;
  KConfigSkeleton::ItemBool  *innerItemHideShorts;
  innerItemHideShorts = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "HideShorts" ), mHideShorts, true );
  itemHideShorts = new KConfigCompilerSignallingItem(innerItemHideShorts, this, notifyFunction, signalHideShortsChanged);
  addItem( itemHideShorts, QStringLiteral( "HideShorts" ) );
  KConfigCompilerSignallingItem  *itemUseSponsorBlock;
  KConfigSkeleton::ItemBool  *innerItemUseSponsorBlock;
  innerItemUseSponsorBlock = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "UseSponsorBlock" ), mUseSponsorBlock, false );
  itemUseSponsorBlock = new KConfigCompilerSignallingItem(innerItemUseSponsorBlock, this, notifyFunction, signalUseSponsorBlockChanged);
  addItem( itemUseSponsorBlock, QStringLiteral( "UseSponsorBlock" ) );
  KConfigCompilerSignallingItem  *itemSkipSponsorBlock;
  KConfigSkeleton::ItemBool  *innerItemSkipSponsorBlock;
  innerItemSkipSponsorBlock = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "SkipSponsorBlock" ), mSkipSponsorBlock, false );
  itemSkipSponsorBlock = new KConfigCompilerSignallingItem(innerItemSkipSponsorBlock, this, notifyFunction, signalSkipSponsorBlockChanged);
  addItem( itemSkipSponsorBlock, QStringLiteral( "SkipSponsorBlock" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesPreferredVideoQuality;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Q2160");
    valuesPreferredVideoQuality.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Q1440");
    valuesPreferredVideoQuality.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Q1080");
    valuesPreferredVideoQuality.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Q720");
    valuesPreferredVideoQuality.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Q480");
    valuesPreferredVideoQuality.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Q360");
    valuesPreferredVideoQuality.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Q240");
    valuesPreferredVideoQuality.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Q144");
    valuesPreferredVideoQuality.append( choice );
  }
  KConfigCompilerSignallingItem  *itemPreferredVideoQuality;
  KConfigSkeleton::ItemEnum  *innerItemPreferredVideoQuality;
  innerItemPreferredVideoQuality = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "PreferredVideoQuality" ), mPreferredVideoQuality, valuesPreferredVideoQuality, Q720 );
  itemPreferredVideoQuality = new KConfigCompilerSignallingItem(innerItemPreferredVideoQuality, this, notifyFunction, signalPreferredVideoQualityChanged);
  addItem( itemPreferredVideoQuality, QStringLiteral( "PreferredVideoQuality" ) );

  setCurrentGroup( QStringLiteral( "Developer" ) );

  KConfigCompilerSignallingItem  *itemSponsorBlockServer;
  KConfigSkeleton::ItemString  *innerItemSponsorBlockServer;
  innerItemSponsorBlockServer = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "SponsorBlockServer" ), mSponsorBlockServer, QStringLiteral( "sponsor.ajay.app" ) );
  itemSponsorBlockServer = new KConfigCompilerSignallingItem(innerItemSponsorBlockServer, this, notifyFunction, signalSponsorBlockServerChanged);
  addItem( itemSponsorBlockServer, QStringLiteral( "SponsorBlockServer" ) );

  setCurrentGroup( QStringLiteral( "NetworkProxy" ) );

  QList<KConfigSkeleton::ItemEnum::Choice> valuesProxyType;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("System");
    valuesProxyType.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("HTTP");
    valuesProxyType.append( choice );
  }
  KConfigCompilerSignallingItem  *itemProxyType;
  KConfigSkeleton::ItemEnum  *innerItemProxyType;
  innerItemProxyType = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "ProxyType" ), mProxyType, valuesProxyType, System );
  itemProxyType = new KConfigCompilerSignallingItem(innerItemProxyType, this, notifyFunction, signalProxyTypeChanged);
  addItem( itemProxyType, QStringLiteral( "ProxyType" ) );
  KConfigCompilerSignallingItem  *itemProxyHost;
  KConfigSkeleton::ItemString  *innerItemProxyHost;
  innerItemProxyHost = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "ProxyHost" ), mProxyHost, QStringLiteral( "127.0.0.1" ) );
  itemProxyHost = new KConfigCompilerSignallingItem(innerItemProxyHost, this, notifyFunction, signalProxyHostChanged);
  addItem( itemProxyHost, QStringLiteral( "ProxyHost" ) );
  KConfigCompilerSignallingItem  *itemProxyPort;
  KConfigSkeleton::ItemInt  *innerItemProxyPort;
  innerItemProxyPort = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "ProxyPort" ), mProxyPort, 1080 );
  itemProxyPort = new KConfigCompilerSignallingItem(innerItemProxyPort, this, notifyFunction, signalProxyPortChanged);
  addItem( itemProxyPort, QStringLiteral( "ProxyPort" ) );
  KConfigCompilerSignallingItem  *itemProxyUser;
  KConfigSkeleton::ItemString  *innerItemProxyUser;
  innerItemProxyUser = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "ProxyUser" ), mProxyUser );
  itemProxyUser = new KConfigCompilerSignallingItem(innerItemProxyUser, this, notifyFunction, signalProxyUserChanged);
  addItem( itemProxyUser, QStringLiteral( "ProxyUser" ) );
  KConfigCompilerSignallingItem  *itemProxyPassword;
  KConfigSkeleton::ItemPassword  *innerItemProxyPassword;
  innerItemProxyPassword = new KConfigSkeleton::ItemPassword( currentGroup(), QStringLiteral( "ProxyPassword" ), mProxyPassword );
  itemProxyPassword = new KConfigCompilerSignallingItem(innerItemProxyPassword, this, notifyFunction, signalProxyPasswordChanged);
  addItem( itemProxyPassword, QStringLiteral( "ProxyPassword" ) );
}

bool Settings::defaultHideShortsValue_helper() const
{

  return true;
}

bool Settings::defaultUseSponsorBlockValue_helper() const
{

  return false;
}

bool Settings::defaultSkipSponsorBlockValue_helper() const
{

  return false;
}

int Settings::defaultPreferredVideoQualityValue_helper() const
{

  return Q720;
}

QString Settings::defaultSponsorBlockServerValue_helper() const
{

  return QStringLiteral( "sponsor.ajay.app" );
}

int Settings::defaultProxyTypeValue_helper() const
{

  return System;
}

QString Settings::defaultProxyHostValue_helper() const
{

  return QStringLiteral( "127.0.0.1" );
}

int Settings::defaultProxyPortValue_helper() const
{

  return 1080;
}

Settings::~Settings()
{
}


void Settings::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalHideShortsChanged:
    Q_EMIT HideShortsChanged();
    break;
  case signalUseSponsorBlockChanged:
    Q_EMIT UseSponsorBlockChanged();
    break;
  case signalSkipSponsorBlockChanged:
    Q_EMIT SkipSponsorBlockChanged();
    break;
  case signalPreferredVideoQualityChanged:
    Q_EMIT PreferredVideoQualityChanged();
    break;
  case signalSponsorBlockServerChanged:
    Q_EMIT SponsorBlockServerChanged();
    break;
  case signalProxyTypeChanged:
    Q_EMIT ProxyTypeChanged();
    break;
  case signalProxyHostChanged:
    Q_EMIT ProxyHostChanged();
    break;
  case signalProxyPortChanged:
    Q_EMIT ProxyPortChanged();
    break;
  case signalProxyUserChanged:
    Q_EMIT ProxyUserChanged();
    break;
  case signalProxyPasswordChanged:
    Q_EMIT ProxyPasswordChanged();
    break;
  }
}
