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

#include "gravatarsettings.h"

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

using namespace Gravatar;

namespace Gravatar {

class GravatarSettingsHelper
{
  public:
    GravatarSettingsHelper() : q(nullptr) {}
    ~GravatarSettingsHelper() { delete q; }
    GravatarSettingsHelper(const GravatarSettingsHelper&) = delete;
    GravatarSettingsHelper& operator=(const GravatarSettingsHelper&) = delete;
    GravatarSettings *q;
};
}

Q_GLOBAL_STATIC(GravatarSettingsHelper, s_globalGravatarSettings)
GravatarSettings *GravatarSettings::self()
{
  if (!s_globalGravatarSettings()->q) {
    new GravatarSettings;
    s_globalGravatarSettings()->q->read();
  }

  return s_globalGravatarSettings()->q;
}

GravatarSettings::GravatarSettings( )
  : KConfigSkeleton()
{
  Q_ASSERT(!s_globalGravatarSettings()->q);
  s_globalGravatarSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Gravatar" ) );

  mGravatarSupportEnabledItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "GravatarSupportEnabled" ), mGravatarSupportEnabled, false );
  addItem( mGravatarSupportEnabledItem, QStringLiteral( "GravatarSupportEnabled" ) );
  mGravatarUseDefaultImageItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "GravatarUseDefaultImage" ), mGravatarUseDefaultImage, false );
  addItem( mGravatarUseDefaultImageItem, QStringLiteral( "GravatarUseDefaultImage" ) );
  mGravatarCacheSizeItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "GravatarCacheSize" ), mGravatarCacheSize, 20 );
  addItem( mGravatarCacheSizeItem, QStringLiteral( "GravatarCacheSize" ) );
}

GravatarSettings::~GravatarSettings()
{
  s_globalGravatarSettings()->q = nullptr;
}

