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

#include "logviewerpluginsettings.h"

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

class LogViewerPluginSettingsHelper
{
  public:
    LogViewerPluginSettingsHelper() : q(nullptr) {}
    ~LogViewerPluginSettingsHelper() { delete q; }
    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()
{
  s_globalLogViewerPluginSettings()->q = nullptr;
}

