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

#include "informationsettings.h"

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

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

  return s_globalInformationSettings()->q;
}

InformationSettings *InformationSettings::create(QQmlEngine *, QJSEngine *)
{
  QQmlEngine::setObjectOwnership(self(), QQmlEngine::CppOwnership);
  return self();
}

InformationSettings::InformationSettings( QObject *parent )
  : KConfigSkeleton( QStringLiteral( "haruna/haruna.conf" ) )
{
  setParent(parent);
  Q_ASSERT(!s_globalInformationSettings()->q);
  s_globalInformationSettings()->q = this;
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&InformationSettings::itemChanged);

  setCurrentGroup( QStringLiteral( "Information" ) );

  KConfigCompilerSignallingItem  *itemMpvLogging;
  KConfigSkeleton::ItemBool  *innerItemMpvLogging;
  innerItemMpvLogging = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "MpvLogging" ), mMpvLogging, false );
  itemMpvLogging = new KConfigCompilerSignallingItem(innerItemMpvLogging, this, notifyFunction, signalMpvLoggingChanged);
  addItem( itemMpvLogging, QStringLiteral( "MpvLogging" ) );
}

bool InformationSettings::defaultMpvLoggingValue_helper()
{

  return false;
}

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


void InformationSettings::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalMpvLoggingChanged:
    Q_EMIT MpvLoggingChanged();
    break;
  }
}
