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

#include "recentcontactscollectionssettings.h"

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

#include <kdebug.h>

using namespace Akonadi;

namespace Akonadi {

class RecentContactsCollectionsSettingsHelper
{
  public:
    RecentContactsCollectionsSettingsHelper() : q(0) {}
    ~RecentContactsCollectionsSettingsHelper() { delete q; }
    RecentContactsCollectionsSettings *q;
};
}

K_GLOBAL_STATIC(RecentContactsCollectionsSettingsHelper, s_globalRecentContactsCollectionsSettings)
RecentContactsCollectionsSettings *RecentContactsCollectionsSettings::self()
{
  if (!s_globalRecentContactsCollectionsSettings->q)
     kFatal() << "you need to call RecentContactsCollectionsSettings::instance before using";
  return s_globalRecentContactsCollectionsSettings->q;
}

void RecentContactsCollectionsSettings::instance(const QString& cfgfilename)
{
  if (s_globalRecentContactsCollectionsSettings->q) {
     kDebug() << "RecentContactsCollectionsSettings::instance called after the first use - ignoring";
     return;
  }
  new RecentContactsCollectionsSettings(cfgfilename);
  s_globalRecentContactsCollectionsSettings->q->readConfig();
}

RecentContactsCollectionsSettings::RecentContactsCollectionsSettings(  const QString& config  )
  : KConfigSkeleton( config )
{
  Q_ASSERT(!s_globalRecentContactsCollectionsSettings->q);
  s_globalRecentContactsCollectionsSettings->q = this;
  setCurrentGroup( QLatin1String( "SpecialCollections" ) );

  mDefaultResourceIdItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "DefaultResourceId" ), mDefaultResourceId );
  addItem( mDefaultResourceIdItem, QLatin1String( "DefaultResourceId" ) );
}

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

