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

#include "jobsettings.h"

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

#include <QDebug>

using namespace NotificationManager;

namespace NotificationManager {

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

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

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

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

JobSettings::JobSettings(  KSharedConfig::Ptr config  )
  : KConfigSkeleton( config )
{
  Q_ASSERT(!s_globalJobSettings()->q);
  s_globalJobSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Jobs" ) );

  KConfigSkeleton::ItemBool  *itemInTaskManager;
  itemInTaskManager = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "InTaskManager" ), mInTaskManager, true );
  itemInTaskManager->setWriteFlags(KConfigBase::Notify);
  addItem( itemInTaskManager, QStringLiteral( "InTaskManager" ) );
  KConfigSkeleton::ItemBool  *itemInNotifications;
  itemInNotifications = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "InNotifications" ), mInNotifications, true );
  itemInNotifications->setWriteFlags(KConfigBase::Notify);
  addItem( itemInNotifications, QStringLiteral( "InNotifications" ) );
  KConfigSkeleton::ItemBool  *itemPermanentPopups;
  itemPermanentPopups = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "PermanentPopups" ), mPermanentPopups, true );
  itemPermanentPopups->setWriteFlags(KConfigBase::Notify);
  addItem( itemPermanentPopups, QStringLiteral( "PermanentPopups" ) );
}

bool JobSettings::defaultInTaskManagerValue_helper()
{

  return true;
}

bool JobSettings::defaultInNotificationsValue_helper()
{

  return true;
}

bool JobSettings::defaultPermanentPopupsValue_helper()
{

  return true;
}

JobSettings::~JobSettings()
{
  s_globalJobSettings()->q = nullptr;
}

