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

#include "krdpserversettings.h"

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

class ServerConfigHelper
{
  public:
    ServerConfigHelper() noexcept : q(nullptr) {}
    ~ServerConfigHelper() noexcept { delete q; q = nullptr; }
    ServerConfigHelper(const ServerConfigHelper&) = delete;
    ServerConfigHelper& operator=(const ServerConfigHelper&) = delete;
    ServerConfig *q;
};
Q_GLOBAL_STATIC(ServerConfigHelper, s_globalServerConfig)
ServerConfig *ServerConfig::self()
{
  if (!s_globalServerConfig()->q) {
    new ServerConfig;
    s_globalServerConfig()->q->read();
  }

  return s_globalServerConfig()->q;
}

ServerConfig::ServerConfig( )
  : KConfigSkeleton( QStringLiteral( "krdpserverrc" ) )
{
  Q_ASSERT(!s_globalServerConfig()->q);
  s_globalServerConfig()->q = this;
  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigSkeleton::ItemInt  *itemListenPort;
  itemListenPort = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "ListenPort" ), mListenPort, 3389 );
  addItem( itemListenPort, QStringLiteral( "ListenPort" ) );
  KConfigSkeleton::ItemBool  *itemAutogenerateCertificates;
  itemAutogenerateCertificates = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AutogenerateCertificates" ), mAutogenerateCertificates, true );
  addItem( itemAutogenerateCertificates, QStringLiteral( "AutogenerateCertificates" ) );
  KConfigSkeleton::ItemString  *itemCertificate;
  itemCertificate = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Certificate" ), mCertificate );
  addItem( itemCertificate, QStringLiteral( "Certificate" ) );
  KConfigSkeleton::ItemString  *itemCertificateKey;
  itemCertificateKey = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "CertificateKey" ), mCertificateKey );
  addItem( itemCertificateKey, QStringLiteral( "CertificateKey" ) );
  KConfigSkeleton::ItemInt  *itemQuality;
  itemQuality = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Quality" ), mQuality, 75 );
  addItem( itemQuality, QStringLiteral( "Quality" ) );
  KConfigSkeleton::ItemStringList  *itemUsers;
  itemUsers = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "Users" ), mUsers );
  addItem( itemUsers, QStringLiteral( "Users" ) );
  KConfigSkeleton::ItemBool  *itemSystemUserEnabled;
  itemSystemUserEnabled = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "SystemUserEnabled" ), mSystemUserEnabled, false );
  addItem( itemSystemUserEnabled, QStringLiteral( "SystemUserEnabled" ) );
  KConfigSkeleton::ItemBool  *itemAutostart;
  itemAutostart = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Autostart" ), mAutostart, false );
  addItem( itemAutostart, QStringLiteral( "Autostart" ) );
}

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

