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

#include "sourceconfig.h"

SourceConfig::SourceConfig( const QString & uuid, QObject *parent )
  : KConfigSkeleton( KSharedConfig::openStateConfig(QStringLiteral( "plasmatubestaterc") ) )
  , mParamuuid(uuid)
{
  setParent(parent);
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&SourceConfig::itemChanged);

  setCurrentGroup( QStringLiteral( "source-%1" ).arg( mParamuuid ) );

  KConfigCompilerSignallingItem  *itemUrl;
  KConfigSkeleton::ItemString  *innerItemUrl;
  innerItemUrl = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "url" ), mUrl );
  itemUrl = new KConfigCompilerSignallingItem(innerItemUrl, this, notifyFunction, signalUrlChanged);
  addItem( itemUrl, QStringLiteral( "url" ) );
  KConfigCompilerSignallingItem  *itemProtocol;
  KConfigSkeleton::ItemString  *innerItemProtocol;
  innerItemProtocol = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "protocol" ), mProtocol, QStringLiteral( "QStringLiteral(\"https\")" ) );
  itemProtocol = new KConfigCompilerSignallingItem(innerItemProtocol, this, notifyFunction, signalProtocolChanged);
  addItem( itemProtocol, QStringLiteral( "protocol" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuestype;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Invidious");
    valuestype.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("PeerTube");
    valuestype.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Piped");
    valuestype.append( choice );
  }
  KConfigCompilerSignallingItem  *itemType;
  KConfigSkeleton::ItemEnum  *innerItemType;
  innerItemType = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "type" ), mType, valuestype );
  itemType = new KConfigCompilerSignallingItem(innerItemType, this, notifyFunction, signalTypeChanged);
  addItem( itemType, QStringLiteral( "type" ) );
  KConfigCompilerSignallingItem  *itemUsername;
  KConfigSkeleton::ItemString  *innerItemUsername;
  innerItemUsername = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "username" ), mUsername );
  itemUsername = new KConfigCompilerSignallingItem(innerItemUsername, this, notifyFunction, signalUsernameChanged);
  addItem( itemUsername, QStringLiteral( "username" ) );
}

QString SourceConfig::defaultProtocolValue_helper() const
{

  return QStringLiteral( "QStringLiteral(\"https\")" );
}

SourceConfig::~SourceConfig()
{
}


void SourceConfig::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalUrlChanged:
    Q_EMIT urlChanged();
    break;
  case signalProtocolChanged:
    Q_EMIT protocolChanged();
    break;
  case signalTypeChanged:
    Q_EMIT typeChanged();
    break;
  case signalUsernameChanged:
    Q_EMIT usernameChanged();
    break;
  }
}
