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

#include "logviewerpluginsettings.h"

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

using namespace kt;

namespace kt {

class LogViewerPluginSettingsHelper
{
  public:
    LogViewerPluginSettingsHelper() : q(0) {}
    ~LogViewerPluginSettingsHelper() { delete q; }
    LogViewerPluginSettings *q;
};
}

K_GLOBAL_STATIC(LogViewerPluginSettingsHelper, s_globalLogViewerPluginSettings)
LogViewerPluginSettings *LogViewerPluginSettings::self()
{
  if (!s_globalLogViewerPluginSettings->q) {
    new LogViewerPluginSettings;
    s_globalLogViewerPluginSettings->q->readConfig();
  }

  return s_globalLogViewerPluginSettings->q;
}

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

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

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

