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

#include "desktopgridconfig.h"

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

#include <QDebug>

using namespace KWin;

namespace KWin {

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

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

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

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

DesktopGridConfig::DesktopGridConfig(  KSharedConfig::Ptr config  )
  : KConfigSkeleton( config )
{
  Q_ASSERT(!s_globalDesktopGridConfig()->q);
  s_globalDesktopGridConfig()->q = this;
  setCurrentGroup( QStringLiteral( "Effect-DesktopGrid" ) );

  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" ) );
  KConfigSkeleton::ItemInt  *itemZoomDuration;
  itemZoomDuration = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "ZoomDuration" ), mZoomDuration, 0 );
  addItem( itemZoomDuration, QStringLiteral( "ZoomDuration" ) );
  KConfigSkeleton::ItemInt  *itemBorderWidth;
  itemBorderWidth = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "BorderWidth" ), mBorderWidth, 10 );
  addItem( itemBorderWidth, QStringLiteral( "BorderWidth" ) );
  KConfigSkeleton::ItemInt  *itemDesktopNameAlignment;
  itemDesktopNameAlignment = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "DesktopNameAlignment" ), mDesktopNameAlignment, 0 );
  addItem( itemDesktopNameAlignment, QStringLiteral( "DesktopNameAlignment" ) );
  KConfigSkeleton::ItemInt  *itemLayoutMode;
  itemLayoutMode = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "LayoutMode" ), mLayoutMode, 0 );
  addItem( itemLayoutMode, QStringLiteral( "LayoutMode" ) );
  KConfigSkeleton::ItemInt  *itemCustomLayoutRows;
  itemCustomLayoutRows = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "CustomLayoutRows" ), mCustomLayoutRows, 2 );
  addItem( itemCustomLayoutRows, QStringLiteral( "CustomLayoutRows" ) );
  KConfigSkeleton::ItemBool  *itemPresentWindows;
  itemPresentWindows = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "PresentWindows" ), mPresentWindows, true );
  addItem( itemPresentWindows, QStringLiteral( "PresentWindows" ) );
  KConfigSkeleton::ItemBool  *itemShowAddRemove;
  itemShowAddRemove = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowAddRemove" ), mShowAddRemove, true );
  addItem( itemShowAddRemove, QStringLiteral( "ShowAddRemove" ) );
}

DesktopGridConfig::~DesktopGridConfig()
{
  s_globalDesktopGridConfig()->q = nullptr;
}

