// This file is generated by kconfig_compiler_kf6 from massif-visualizer-settings.kcfg.
// All changes you do to this file will be lost.

#include "massif-visualizer-settings.h"

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

using namespace Massif;

namespace Massif {

class SettingsHelper
{
  public:
    SettingsHelper() noexcept : q(nullptr) {}
    ~SettingsHelper() noexcept { delete q; q = nullptr; }
    SettingsHelper(const SettingsHelper&) = delete;
    SettingsHelper& operator=(const SettingsHelper&) = delete;
    Settings *q;
};

}
Q_GLOBAL_STATIC(SettingsHelper, s_globalSettings)
Settings *Settings::self()
{
  if (!s_globalSettings()->q) {
    new Settings;
    s_globalSettings()->q->read();
  }

  return s_globalSettings()->q;
}

Settings::Settings( )
  : KConfigSkeleton()
{
  Q_ASSERT(!s_globalSettings()->q);
  s_globalSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Settings" ) );

  mPrettyCostPrecisionItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "prettyCostPrecision" ), mPrettyCostPrecision, 1 );
  mPrettyCostPrecisionItem->setLabel( QCoreApplication::translate("Settings", "Cost Precision") );
  mPrettyCostPrecisionItem->setToolTip( QCoreApplication::translate("Settings", "Defines the number of places after the comma for memory costs shown in the application.") );
  addItem( mPrettyCostPrecisionItem, QStringLiteral( "PrettyCostPrecision" ) );
  mShortenTemplatesItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "shortenTemplates" ), mShortenTemplates, 0 );
  mShortenTemplatesItem->setLabel( QCoreApplication::translate("Settings", "Shorten Templates") );
  mShortenTemplatesItem->setToolTip( QCoreApplication::translate("Settings", "Defines whether identifiers of C++ template instantiations should be shortened by removing their template arguments.") );
  addItem( mShortenTemplatesItem, QStringLiteral( "ShortenTemplates" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesLegendPosition;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("North");
    valuesLegendPosition.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("East");
    valuesLegendPosition.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("South");
    valuesLegendPosition.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("West");
    valuesLegendPosition.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Floating");
    valuesLegendPosition.append( choice );
  }
  mLegendPositionItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "legendPosition" ), mLegendPosition, valuesLegendPosition, EnumLegendPosition::Floating );
  mLegendPositionItem->setLabel( QCoreApplication::translate("Settings", "Legend Position") );
  mLegendPositionItem->setToolTip( QCoreApplication::translate("Settings", "Defines the position of the legend relative to the plot.") );
  addItem( mLegendPositionItem, QStringLiteral( "LegendPosition" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesLegendAlignment;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Left");
    valuesLegendAlignment.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Center");
    valuesLegendAlignment.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Right");
    valuesLegendAlignment.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Top");
    valuesLegendAlignment.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Bottom");
    valuesLegendAlignment.append( choice );
  }
  mLegendAlignmentItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "legendAlignment" ), mLegendAlignment, valuesLegendAlignment, EnumLegendAlignment::Center );
  mLegendAlignmentItem->setLabel( QCoreApplication::translate("Settings", "Legend Alignment") );
  mLegendAlignmentItem->setToolTip( QCoreApplication::translate("Settings", "Defines the alignment of the legend.") );
  addItem( mLegendAlignmentItem, QStringLiteral( "LegendAlignment" ) );
  mLegendFontSizeItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "legendFontSize" ), mLegendFontSize, 12 );
  mLegendFontSizeItem->setMinValue(6);
  mLegendFontSizeItem->setMaxValue(14);
  mLegendFontSizeItem->setLabel( QCoreApplication::translate("Settings", "Legend Font Size") );
  mLegendFontSizeItem->setToolTip( QCoreApplication::translate("Settings", "Defines the font size used in the legend.") );
  addItem( mLegendFontSizeItem, QStringLiteral( "LegendFontSize" ) );
}

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

