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

KCal Library

  • sources
  • kde-4.12
  • kdepimlibs
  • kcal
freebusyurlstore.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the kcal library.
3 
4  Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
29 #include "freebusyurlstore.h"
30 #include <kconfig.h>
31 #include <kstandarddirs.h>
32 #include <kconfiggroup.h>
33 #include <QtCore/QCoreApplication>
34 
35 using namespace KCal;
36 
37 //@cond PRIVATE
38 class FreeBusyUrlStore::Private
39 {
40  public:
41  Private()
42  : mConfig(0)
43  {}
44  ~Private()
45  {
46  qRemovePostRoutine(cleanupFreeBusyUrlStore);
47  }
48  KConfig *mConfig;
49 
50  static FreeBusyUrlStore *sSelf;
51  static void cleanupFreeBusyUrlStore()
52  {
53  delete sSelf;
54  sSelf = 0;
55  }
56 };
57 FreeBusyUrlStore *FreeBusyUrlStore::Private::sSelf = 0;
58 //@endcond
59 
60 FreeBusyUrlStore *FreeBusyUrlStore::self()
61 {
62  static Private p;
63  if ( !p.sSelf ) {
64  p.sSelf = new FreeBusyUrlStore();
65  qAddPostRoutine( Private::cleanupFreeBusyUrlStore );
66  }
67  return p.sSelf;
68 }
69 
70 FreeBusyUrlStore::FreeBusyUrlStore() : d( new Private() )
71 {
72  QString configFile =
73  KStandardDirs::locateLocal( "data", "korganizer/freebusyurls" );
74  d->mConfig = new KConfig( configFile );
75 }
76 
77 FreeBusyUrlStore::~FreeBusyUrlStore()
78 {
79  delete d->mConfig;
80  delete d;
81 }
82 
83 void FreeBusyUrlStore::writeUrl( const QString &email, const QString &url )
84 {
85  KConfigGroup group = d->mConfig->group( email );
86  group.writeEntry( "url", url );
87 }
88 
89 QString FreeBusyUrlStore::readUrl( const QString &email )
90 {
91  KConfigGroup group = d->mConfig->group( email );
92  return group.readEntry( "url" );
93 }
94 
95 void FreeBusyUrlStore::sync()
96 {
97  d->mConfig->sync();
98 }
freebusyurlstore.h
This file is part of the API for handling calendar data and defines the FreeBusyUrlStore class...
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCal Library

Skip menu "KCal Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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