KCal Library
Go to the documentation of this file.
36 #include <kdatetime.h>
45 class KCal::Duration::Private
48 int seconds()
const {
return mDaily ? mDuration * 86400 : mDuration; }
62 if ( start.time() == end.time() && start.timeSpec() == end.timeSpec() ) {
63 d->mDuration = start.daysTo( end );
66 d->mDuration = start.secsTo( end );
75 KDateTime endSt( end.toTimeSpec( start ) );
76 d->mDuration = start.daysTo( endSt );
79 if ( start < endSt ) {
80 if ( endSt.time() < start.time() ) {
84 if ( endSt.time() > start.time() ) {
91 d->mDuration = start.secsTo( end );
99 d->mDuration = duration;
100 d->mDaily = ( type ==
Days );
104 : d( new KCal::
Duration::Private( *duration.d ) )
116 if ( &duration ==
this ) {
124 Duration::operator bool()
const
131 if ( d->mDaily == other.d->mDaily ) {
133 return d->mDuration < other.d->mDuration;
135 return d->seconds() < other.d->seconds();
144 d->mDuration == other.d->mDuration &&
145 d->mDaily == other.d->mDaily;
150 if ( d->mDaily == other.d->mDaily ) {
151 d->mDuration += other.d->mDuration;
152 }
else if ( d->mDaily ) {
153 d->mDuration = d->mDuration * 86400 + other.d->mDuration;
156 d->mDuration += other.d->mDuration + 86400;
173 d->mDuration *=
value;
179 d->mDuration /=
value;
185 return d->mDaily ? start.addDays( d->mDuration )
186 : start.addSecs( d->mDuration );
206 return d->mDaily ? d->mDuration : d->mDuration / 86400;
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:29:14 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.