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

#include "konversation_state.h"

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

class KonversationStateHelper
{
  public:
    KonversationStateHelper() : q(nullptr) {}
    ~KonversationStateHelper() { delete q; q = nullptr; }
    KonversationStateHelper(const KonversationStateHelper&) = delete;
    KonversationStateHelper& operator=(const KonversationStateHelper&) = delete;
    KonversationState *q;
};
Q_GLOBAL_STATIC(KonversationStateHelper, s_globalKonversationState)
KonversationState *KonversationState::self()
{
  if (!s_globalKonversationState()->q) {
    new KonversationState;
    s_globalKonversationState()->q->read();
  }

  return s_globalKonversationState()->q;
}

KonversationState::KonversationState( )
  : KConfigSkeleton( KSharedConfig::openStateConfig(QStringLiteral( "konversationrc") ) )
{
  Q_ASSERT(!s_globalKonversationState()->q);
  s_globalKonversationState()->q = this;
  setCurrentGroup( QStringLiteral( "Appearance" ) );

  QList<int> defaultTreeSplitterSizes;

  mTreeSplitterSizesItem = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "TreeSplitterSizes" ), mTreeSplitterSizes, defaultTreeSplitterSizes );
  mTreeSplitterSizesItem->setLabel( QCoreApplication::translate("KonversationState", "TreeSplitterSizes") );
  addItem( mTreeSplitterSizesItem, QStringLiteral( "TreeSplitterSizes" ) );
  QList<int> defaultTopicSplitterSizes;

  mTopicSplitterSizesItem = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "TopicSplitterSizes" ), mTopicSplitterSizes, defaultTopicSplitterSizes );
  mTopicSplitterSizesItem->setLabel( QCoreApplication::translate("KonversationState", "TopicSplitterSizes") );
  addItem( mTopicSplitterSizesItem, QStringLiteral( "TopicSplitterSizes" ) );
  QList<int> defaultChannelSplitterSizes;

  mChannelSplitterSizesItem = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "ChannelSplitterSizes" ), mChannelSplitterSizes, defaultChannelSplitterSizes );
  mChannelSplitterSizesItem->setLabel( QCoreApplication::translate("KonversationState", "ChannelSplitterSizes") );
  addItem( mChannelSplitterSizesItem, QStringLiteral( "ChannelSplitterSizes" ) );
}

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

