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

akonadi

  • akonadi
cachepolicy.cpp
1 /*
2  Copyright (c) 2008 Volker Krause <vkrause@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #include "cachepolicy.h"
21 #include "collection.h"
22 
23 using namespace Akonadi;
24 
28 class CachePolicy::Private : public QSharedData
29 {
30  public:
31  Private() :
32  QSharedData(),
33  inherit( true ),
34  timeout( -1 ),
35  interval( -1 ),
36  syncOnDemand( false )
37  {}
38 
39  Private( const Private &other ) :
40  QSharedData( other )
41  {
42  inherit = other.inherit;
43  localParts = other.localParts;
44  timeout = other.timeout;
45  interval = other.interval;
46  syncOnDemand = other.syncOnDemand;
47  }
48 
49  bool inherit;
50  QStringList localParts;
51  int timeout;
52  int interval;
53  bool syncOnDemand;
54 };
55 
56 
57 CachePolicy::CachePolicy() :
58  d( new Private )
59 {
60 }
61 
62 CachePolicy::CachePolicy(const CachePolicy & other) :
63  d( other.d )
64 {
65 }
66 
67 CachePolicy::~ CachePolicy()
68 {
69 }
70 
71 CachePolicy & CachePolicy::operator =(const CachePolicy & other)
72 {
73  d = other.d;
74  return *this;
75 }
76 
77 bool Akonadi::CachePolicy::operator ==(const CachePolicy & other) const
78 {
79  if ( !d->inherit && !other.d->inherit ) {
80  return d->localParts == other.d->localParts
81  && d->timeout == other.d->timeout
82  && d->interval == other.d->interval
83  && d->syncOnDemand == other.d->syncOnDemand;
84  }
85  return d->inherit == other.d->inherit;
86 }
87 
88 bool CachePolicy::inheritFromParent() const
89 {
90  return d->inherit;
91 }
92 
93 void CachePolicy::setInheritFromParent(bool inherit)
94 {
95  d->inherit = inherit;
96 }
97 
98 QStringList CachePolicy::localParts() const
99 {
100  return d->localParts;
101 }
102 
103 void CachePolicy::setLocalParts(const QStringList & parts)
104 {
105  d->localParts = parts;
106 }
107 
108 int CachePolicy::cacheTimeout() const
109 {
110  return d->timeout;
111 }
112 
113 void CachePolicy::setCacheTimeout(int timeout)
114 {
115  d->timeout = timeout;
116 }
117 
118 int CachePolicy::intervalCheckTime() const
119 {
120  return d->interval;
121 }
122 
123 void CachePolicy::setIntervalCheckTime(int time)
124 {
125  d->interval = time;
126 }
127 
128 bool CachePolicy::syncOnDemand() const
129 {
130  return d->syncOnDemand;
131 }
132 
133 void CachePolicy::setSyncOnDemand(bool enable)
134 {
135  d->syncOnDemand = enable;
136 }
137 
138 QDebug operator<<( QDebug d, const CachePolicy& c )
139 {
140  return d << "CachePolicy: " << endl
141  << " inherit:" << c.inheritFromParent() << endl
142  << " interval:" << c.intervalCheckTime() << endl
143  << " timeout:" << c.cacheTimeout() << endl
144  << " sync on demand:" << c.syncOnDemand() << endl
145  << " local parts:" << c.localParts();
146 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:27:32 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 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