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

#include "overviewconfig.h"

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

#include <QDebug>

using namespace KWin;

namespace KWin {

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

}
Q_GLOBAL_STATIC(OverviewConfigHelper, s_globalOverviewConfig)
OverviewConfig *OverviewConfig::self()
{
  if (!s_globalOverviewConfig()->q)
     qFatal("you need to call OverviewConfig::instance before using");
  return s_globalOverviewConfig()->q;
}

void OverviewConfig::instance(const QString& cfgfilename)
{
  if (s_globalOverviewConfig()->q) {
     qDebug() << "OverviewConfig::instance called after the first use - ignoring";
     return;
  }
  new OverviewConfig(KSharedConfig::openConfig(cfgfilename));
  s_globalOverviewConfig()->q->read();
}

void OverviewConfig::instance(KSharedConfig::Ptr config)
{
  if (s_globalOverviewConfig()->q) {
     qDebug() << "OverviewConfig::instance called after the first use - ignoring";
     return;
  }
  new OverviewConfig(std::move(config));
  s_globalOverviewConfig()->q->read();
}

OverviewConfig::OverviewConfig( KSharedConfig::Ptr config )
  : KConfigSkeleton( std::move( config ) )
{
  Q_ASSERT(!s_globalOverviewConfig()->q);
  s_globalOverviewConfig()->q = this;
  setCurrentGroup( QStringLiteral( "Effect-Overview" ) );

  KConfigSkeleton::ItemInt  *itemLayoutMode;
  itemLayoutMode = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "LayoutMode" ), mLayoutMode, 1 );
  addItem( itemLayoutMode, QStringLiteral( "LayoutMode" ) );
  KConfigSkeleton::ItemBool  *itemBlurBackground;
  itemBlurBackground = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "BlurBackground" ), mBlurBackground, true );
  addItem( itemBlurBackground, QStringLiteral( "BlurBackground" ) );
  QList<int> defaultBorderActivate;

  KConfigSkeleton::ItemIntList  *itemBorderActivate;
  itemBorderActivate = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "BorderActivate" ), mBorderActivate, defaultBorderActivate );
  addItem( itemBorderActivate, QStringLiteral( "BorderActivate" ) );
  QList<int> defaultTouchBorderActivate;

  KConfigSkeleton::ItemIntList  *itemTouchBorderActivate;
  itemTouchBorderActivate = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "TouchBorderActivate" ), mTouchBorderActivate, defaultTouchBorderActivate );
  addItem( itemTouchBorderActivate, QStringLiteral( "TouchBorderActivate" ) );
}

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

