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

#include "logviewerpluginsettings.h"

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

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

  return s_globalLogViewerPluginSettings()->q;
}

LogViewerPluginSettings::LogViewerPluginSettings( )
  : KConfigSkeleton( QStringLiteral( "ktorrent_logviewerrc" ) )
{
  Q_ASSERT(!s_globalLogViewerPluginSettings()->q);
  s_globalLogViewerPluginSettings()->q = this;
  setCurrentGroup( QStringLiteral( "general" ) );

  KConfigSkeleton::ItemBool  *itemUseRichText;
  itemUseRichText = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useRichText" ), mUseRichText, true );
  addItem( itemUseRichText, QStringLiteral( "useRichText" ) );
  KConfigSkeleton::ItemInt  *itemLogWidgetPosition;
  itemLogWidgetPosition = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "logWidgetPosition" ), mLogWidgetPosition, 0 );
  itemLogWidgetPosition->setMinValue(0);
  itemLogWidgetPosition->setMaxValue(2);
  addItem( itemLogWidgetPosition, QStringLiteral( "logWidgetPosition" ) );
  KConfigSkeleton::ItemInt  *itemMaxBlockCount;
  itemMaxBlockCount = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "maxBlockCount" ), mMaxBlockCount, 200 );
  itemMaxBlockCount->setMinValue(50);
  itemMaxBlockCount->setMaxValue(500000);
  addItem( itemMaxBlockCount, QStringLiteral( "maxBlockCount" ) );
}

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

