• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

akonadi/contact

  • akonadi
  • contact
recentcontactscollectionssettings.cpp
1 // This file is generated by kconfig_compiler from recentcontactscollections.kcfg.
2 // All changes you do to this file will be lost.
3 
4 #include "recentcontactscollectionssettings.h"
5 
6 #include <kglobal.h>
7 #include <QtCore/QFile>
8 
9 #include <kdebug.h>
10 
11 using namespace Akonadi;
12 
13 namespace Akonadi {
14 
15 class RecentContactsCollectionsSettingsHelper
16 {
17  public:
18  RecentContactsCollectionsSettingsHelper() : q(0) {}
19  ~RecentContactsCollectionsSettingsHelper() { delete q; }
20  RecentContactsCollectionsSettings *q;
21 };
22 }
23 
24 K_GLOBAL_STATIC(RecentContactsCollectionsSettingsHelper, s_globalRecentContactsCollectionsSettings)
25 RecentContactsCollectionsSettings *RecentContactsCollectionsSettings::self()
26 {
27  if (!s_globalRecentContactsCollectionsSettings->q)
28  kFatal() << "you need to call RecentContactsCollectionsSettings::instance before using";
29  return s_globalRecentContactsCollectionsSettings->q;
30 }
31 
32 void RecentContactsCollectionsSettings::instance(const QString& cfgfilename)
33 {
34  if (s_globalRecentContactsCollectionsSettings->q) {
35  kDebug() << "RecentContactsCollectionsSettings::instance called after the first use - ignoring";
36  return;
37  }
38  new RecentContactsCollectionsSettings(cfgfilename);
39  s_globalRecentContactsCollectionsSettings->q->readConfig();
40 }
41 
42 RecentContactsCollectionsSettings::RecentContactsCollectionsSettings( const QString& config )
43  : KConfigSkeleton( config )
44 {
45  Q_ASSERT(!s_globalRecentContactsCollectionsSettings->q);
46  s_globalRecentContactsCollectionsSettings->q = this;
47  setCurrentGroup( QLatin1String( "SpecialCollections" ) );
48 
49  mDefaultResourceIdItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "DefaultResourceId" ), mDefaultResourceId );
50  addItem( mDefaultResourceIdItem, QLatin1String( "DefaultResourceId" ) );
51 }
52 
53 RecentContactsCollectionsSettings::~RecentContactsCollectionsSettings()
54 {
55  if (!s_globalRecentContactsCollectionsSettings.isDestroyed()) {
56  s_globalRecentContactsCollectionsSettings->q = 0;
57  }
58 }
59 
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Jul 27 2021 06:51:14 by doxygen 1.8.20 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi/contact

Skip menu "akonadi/contact"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal