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

#include "globalscalesettings.h"

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

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

  return s_globalGlobalScaleSettings()->q;
}

GlobalScaleSettings::GlobalScaleSettings( )
  : KConfigSkeleton( QStringLiteral( "kdeglobals" ) )
{
  Q_ASSERT(!s_globalGlobalScaleSettings()->q);
  s_globalGlobalScaleSettings()->q = this;
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&GlobalScaleSettings::itemChanged);

  setCurrentGroup( QStringLiteral( "KScreen" ) );

  KConfigCompilerSignallingItem  *itemScaleFactor;
  KConfigSkeleton::ItemDouble  *innerItemScaleFactor;
  innerItemScaleFactor = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "ScaleFactor" ), mScaleFactor, 1.0 );
  itemScaleFactor = new KConfigCompilerSignallingItem(innerItemScaleFactor, this, notifyFunction, signalScaleFactorChanged);
  addItem( itemScaleFactor, QStringLiteral( "scaleFactor" ) );
  KConfigCompilerSignallingItem  *itemXwaylandClientsScale;
  KConfigSkeleton::ItemBool  *innerItemXwaylandClientsScale;
  innerItemXwaylandClientsScale = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "XwaylandClientsScale" ), mXwaylandClientsScale, true );
  itemXwaylandClientsScale = new KConfigCompilerSignallingItem(innerItemXwaylandClientsScale, this, notifyFunction, signalXwaylandClientsScaleChanged);
  addItem( itemXwaylandClientsScale, QStringLiteral( "xwaylandClientsScale" ) );
}

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


void GlobalScaleSettings::itemChanged(quint64 flags) {

  if ( flags & signalScaleFactorChanged ) {
    Q_EMIT scaleFactorChanged();
  }
  if ( flags & signalXwaylandClientsScaleChanged ) {
    Q_EMIT xwaylandClientsScaleChanged();
  }
}

#include "globalscalesettings.moc"

