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

#include "urlpicpreviewconfig.h"

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

class URLPicPreviewConfigHelper
{
  public:
    URLPicPreviewConfigHelper() : q(nullptr) {}
    ~URLPicPreviewConfigHelper() { delete q; q = nullptr; }
    URLPicPreviewConfigHelper(const URLPicPreviewConfigHelper&) = delete;
    URLPicPreviewConfigHelper& operator=(const URLPicPreviewConfigHelper&) = delete;
    URLPicPreviewConfig *q;
};
Q_GLOBAL_STATIC(URLPicPreviewConfigHelper, s_globalURLPicPreviewConfig)
URLPicPreviewConfig *URLPicPreviewConfig::self()
{
  if (!s_globalURLPicPreviewConfig()->q) {
    new URLPicPreviewConfig;
    s_globalURLPicPreviewConfig()->q->read();
  }

  return s_globalURLPicPreviewConfig()->q;
}

URLPicPreviewConfig::URLPicPreviewConfig( )
  : KConfigSkeleton( QStringLiteral( "kopeterc" ) )
{
  Q_ASSERT(!s_globalURLPicPreviewConfig()->q);
  s_globalURLPicPreviewConfig()->q = this;
  setCurrentGroup( QStringLiteral( "URLPicPreview Plugin" ) );

  KConfigSkeleton::ItemUInt  *itemPreviewAmount;
  itemPreviewAmount = new KConfigSkeleton::ItemUInt( currentGroup(), QStringLiteral( "PreviewAmount" ), mPreviewAmount, 2 );
  addItem( itemPreviewAmount, QStringLiteral( "PreviewAmount" ) );
  KConfigSkeleton::ItemBool  *itemScaling;
  itemScaling = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Scaling" ), mScaling, true );
  addItem( itemScaling, QStringLiteral( "Scaling" ) );
  KConfigSkeleton::ItemBool  *itemPreviewRestriction;
  itemPreviewRestriction = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "PreviewRestriction" ), mPreviewRestriction, true );
  addItem( itemPreviewRestriction, QStringLiteral( "PreviewRestriction" ) );
  KConfigSkeleton::ItemInt  *itemPreviewScaleWidth;
  itemPreviewScaleWidth = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "PreviewScaleWidth" ), mPreviewScaleWidth, 256 );
  addItem( itemPreviewScaleWidth, QStringLiteral( "PreviewScaleWidth" ) );
}

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

