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

#include "skgassistant_settings.h"

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

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

  return s_globalskgassistant_settings()->q;
}

skgassistant_settings::skgassistant_settings( )
  : KConfigSkeleton()
{
  Q_ASSERT(!s_globalskgassistant_settings()->q);
  s_globalskgassistant_settings()->q = this;
  setCurrentGroup( QStringLiteral( "skrooge_aiassistant" ) );

  KConfigSkeleton::ItemString  *itemServerUrl;
  itemServerUrl = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "serverUrl" ), mServerUrl, QStringLiteral( "http://127.0.0.1:8080" ) );
  addItem( itemServerUrl, QStringLiteral( "serverUrl" ) );
  KConfigSkeleton::ItemString  *itemApiToken;
  itemApiToken = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "apiToken" ), mApiToken );
  addItem( itemApiToken, QStringLiteral( "apiToken" ) );
  KConfigSkeleton::ItemBool  *itemEnableWebSearch;
  itemEnableWebSearch = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "enableWebSearch" ), mEnableWebSearch, true );
  addItem( itemEnableWebSearch, QStringLiteral( "enableWebSearch" ) );
  KConfigSkeleton::ItemString  *itemFamilySituation;
  itemFamilySituation = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "familySituation" ), mFamilySituation );
  addItem( itemFamilySituation, QStringLiteral( "familySituation" ) );
}

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

