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

#include "checkprintingsettings.h"

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

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

  return s_globalCheckPrintingSettings()->q;
}

CheckPrintingSettings::CheckPrintingSettings( )
  : KConfigSkeleton( QStringLiteral( "kmymoney/checkprintingrc" ) )
{
  Q_ASSERT(!s_globalCheckPrintingSettings()->q);
  s_globalCheckPrintingSettings()->q = this;
  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigSkeleton::ItemBool  *itemUseCustomCheckTemplate;
  itemUseCustomCheckTemplate = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useCustomCheckTemplate" ), mUseCustomCheckTemplate, true );
  addItem( itemUseCustomCheckTemplate, QStringLiteral( "useCustomCheckTemplate" ) );
  KConfigSkeleton::ItemPath  *itemCheckTemplateFile;
  itemCheckTemplateFile = new KConfigSkeleton::ItemPath( currentGroup(), QStringLiteral( "checkTemplateFile" ), mCheckTemplateFile, QStringLiteral( ":/plugins/checkprinting/templates/check_template.html" ) );
  addItem( itemCheckTemplateFile, QStringLiteral( "checkTemplateFile" ) );
  KConfigSkeleton::ItemStringList  *itemPrintedChecks;
  itemPrintedChecks = new KConfigSkeleton::ItemStringList( currentGroup(), QStringLiteral( "printedChecks" ), mPrintedChecks );
  addItem( itemPrintedChecks, QStringLiteral( "printedChecks" ) );
}

bool CheckPrintingSettings::defaultUseCustomCheckTemplateValue_helper()
{

  return true;
}

QString CheckPrintingSettings::defaultCheckTemplateFileValue_helper()
{

  return QStringLiteral( ":/plugins/checkprinting/templates/check_template.html" );
}

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

