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

#include "kwincompositing_setting.h"

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

class KWinCompositingSettingHelper
{
  public:
    KWinCompositingSettingHelper() noexcept : q(nullptr) {}
    ~KWinCompositingSettingHelper() noexcept { delete q; q = nullptr; }
    KWinCompositingSettingHelper(const KWinCompositingSettingHelper&) = delete;
    KWinCompositingSettingHelper& operator=(const KWinCompositingSettingHelper&) = delete;
    KWinCompositingSetting *q;
};
Q_GLOBAL_STATIC(KWinCompositingSettingHelper, s_globalKWinCompositingSetting)
KWinCompositingSetting *KWinCompositingSetting::self()
{
  if (!s_globalKWinCompositingSetting()->q) {
    new KWinCompositingSetting;
    s_globalKWinCompositingSetting()->q->read();
  }

  return s_globalKWinCompositingSetting()->q;
}

KWinCompositingSetting::KWinCompositingSetting( )
  : KConfigSkeleton( QStringLiteral( "kwinrc" ) )
{
  Q_ASSERT(!s_globalKWinCompositingSetting()->q);
  s_globalKWinCompositingSetting()->q = this;
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&KWinCompositingSetting::itemChanged);

  setCurrentGroup( QStringLiteral( "Compositing" ) );

  KConfigCompilerSignallingItem  *itemAllowTearing;
  KConfigSkeleton::ItemBool  *innerItemAllowTearing;
  innerItemAllowTearing = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AllowTearing" ), mAllowTearing, true );
  itemAllowTearing = new KConfigCompilerSignallingItem(innerItemAllowTearing, this, notifyFunction, signalAllowTearingChanged);
  addItem( itemAllowTearing, QStringLiteral( "allowTearing" ) );
}

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


void KWinCompositingSetting::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalAllowTearingChanged:
    Q_EMIT allowTearingChanged();
    break;
  }
}
