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

#include "globalsettings_base.h"

#include <klocalizedstring.h>

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

using namespace GrantleeThemeEditor;

namespace GrantleeThemeEditor {

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

}
Q_GLOBAL_STATIC(GrantleeThemeEditorSettingsHelper, s_globalGrantleeThemeEditorSettings)
GrantleeThemeEditorSettings *GrantleeThemeEditorSettings::self()
{
  if (!s_globalGrantleeThemeEditorSettings()->q) {
    new GrantleeThemeEditorSettings;
    s_globalGrantleeThemeEditorSettings()->q->read();
  }

  return s_globalGrantleeThemeEditorSettings()->q;
}

GrantleeThemeEditorSettings::GrantleeThemeEditorSettings( )
  : KConfigSkeleton()
{
  Q_ASSERT(!s_globalGrantleeThemeEditorSettings()->q);
  s_globalGrantleeThemeEditorSettings()->q = this;
  setCurrentGroup( QStringLiteral( "Global" ) );

  mAuthorEmailItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "authorEmail" ), mAuthorEmail );
  mAuthorEmailItem->setLabel( i18nd("libgrantleethemeeditor", "Store author email") );
  addItem( mAuthorEmailItem, QStringLiteral( "authorEmail" ) );
  mAuthorItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "author" ), mAuthor );
  mAuthorItem->setLabel( i18nd("libgrantleethemeeditor", "Store author name") );
  addItem( mAuthorItem, QStringLiteral( "author" ) );
  mPathItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "path" ), mPath );
  mPathItem->setLabel( i18nd("libgrantleethemeeditor", "Default theme path") );
  addItem( mPathItem, QStringLiteral( "path" ) );
}

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

