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

#include "settings.h"

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

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

  return s_globalFreeSpaceNotifierSettings()->q;
}

FreeSpaceNotifierSettings::FreeSpaceNotifierSettings( )
  : KConfigSkeleton( QStringLiteral( "freespacenotifierrc" ) )
{
  Q_ASSERT(!s_globalFreeSpaceNotifierSettings()->q);
  s_globalFreeSpaceNotifierSettings()->q = this;
  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigSkeleton::ItemInt  *itemMinimumSpace;
  itemMinimumSpace = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "minimumSpace" ), mMinimumSpace, 200 );
  itemMinimumSpace->setMinValue(1);
  itemMinimumSpace->setMaxValue(100000);
  addItem( itemMinimumSpace, QStringLiteral( "minimumSpace" ) );
  KConfigSkeleton::ItemInt  *itemMinimumSpacePercentage;
  itemMinimumSpacePercentage = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "minimumSpacePercentage" ), mMinimumSpacePercentage, 5 );
  itemMinimumSpacePercentage->setMinValue(1);
  itemMinimumSpacePercentage->setMaxValue(30);
  addItem( itemMinimumSpacePercentage, QStringLiteral( "minimumSpacePercentage" ) );
  KConfigSkeleton::ItemBool  *itemEnableNotification;
  itemEnableNotification = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "enableNotification" ), mEnableNotification, 1 );
  addItem( itemEnableNotification, QStringLiteral( "enableNotification" ) );
}

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

