// This file is generated by kconfig_compiler_kf6 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::ItemBool  *itemIgnoreMinimized;
  itemIgnoreMinimized = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "IgnoreMinimized" ), mIgnoreMinimized, false );
  addItem( itemIgnoreMinimized, QStringLiteral( "IgnoreMinimized" ) );
  KConfigSkeleton::ItemBool  *itemFilterWindows;
  itemFilterWindows = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "FilterWindows" ), mFilterWindows, true );
  addItem( itemFilterWindows, QStringLiteral( "FilterWindows" ) );
  KConfigSkeleton::ItemBool  *itemOrganizedGrid;
  itemOrganizedGrid = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "OrganizedGrid" ), mOrganizedGrid, true );
  addItem( itemOrganizedGrid, QStringLiteral( "OrganizedGrid" ) );
  QList<int> defaultBorderActivate;
  defaultBorderActivate.append( ElectricTopLeft );

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

  KConfigSkeleton::ItemIntList  *itemGridBorderActivate;
  itemGridBorderActivate = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "GridBorderActivate" ), mGridBorderActivate, defaultGridBorderActivate );
  addItem( itemGridBorderActivate, QStringLiteral( "GridBorderActivate" ) );
  QList<int> defaultTouchBorderActivate;

  KConfigSkeleton::ItemIntList  *itemTouchBorderActivate;
  itemTouchBorderActivate = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "TouchBorderActivate" ), mTouchBorderActivate, defaultTouchBorderActivate );
  addItem( itemTouchBorderActivate, QStringLiteral( "TouchBorderActivate" ) );
  QList<int> defaultGridTouchBorderActivate;

  KConfigSkeleton::ItemIntList  *itemGridTouchBorderActivate;
  itemGridTouchBorderActivate = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "GridTouchBorderActivate" ), mGridTouchBorderActivate, defaultGridTouchBorderActivate );
  addItem( itemGridTouchBorderActivate, QStringLiteral( "GridTouchBorderActivate" ) );
}

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

