summaryrefslogtreecommitdiffabout
path: root/libkcal/incidencebase.cpp
Unidiff
Diffstat (limited to 'libkcal/incidencebase.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/incidencebase.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp
index 022dead..cfef973 100644
--- a/libkcal/incidencebase.cpp
+++ b/libkcal/incidencebase.cpp
@@ -148,107 +148,118 @@ bool IncidenceBase::isTagged() const
148void IncidenceBase::setTagged( bool b) 148void IncidenceBase::setTagged( bool b)
149{ 149{
150 mIsTagged = b; 150 mIsTagged = b;
151} 151}
152void IncidenceBase::setCalID( int id ) 152void IncidenceBase::setCalID( int id )
153{ 153{
154 if ( mCalID > 0 ) { 154 if ( mCalID > 0 ) {
155 blockLastModified = true; 155 blockLastModified = true;
156 updated(); 156 updated();
157 blockLastModified = false; 157 blockLastModified = false;
158 } 158 }
159 mCalID = id; 159 mCalID = id;
160} 160}
161int IncidenceBase::calID() const 161int IncidenceBase::calID() const
162{ 162{
163 return mCalID; 163 return mCalID;
164} 164}
165void IncidenceBase::setCalEnabled( bool b ) 165void IncidenceBase::setCalEnabled( bool b )
166{ 166{
167 mCalEnabled = b; 167 mCalEnabled = b;
168} 168}
169bool IncidenceBase::calEnabled() const 169bool IncidenceBase::calEnabled() const
170{ 170{
171 return mCalEnabled; 171 return mCalEnabled;
172} 172}
173 173
174void IncidenceBase::setAlarmEnabled( bool b ) 174void IncidenceBase::setAlarmEnabled( bool b )
175{ 175{
176 mAlarmEnabled = b; 176 mAlarmEnabled = b;
177} 177}
178bool IncidenceBase::alarmEnabled() const 178bool IncidenceBase::alarmEnabled() const
179{ 179{
180 return mAlarmEnabled; 180 return mAlarmEnabled;
181} 181}
182 182
183 183
184void IncidenceBase::setUid(const QString &uid) 184void IncidenceBase::setUid(const QString &uid)
185{ 185{
186 mUid = uid; 186 mUid = uid;
187 updated(); 187 updated();
188} 188}
189 189
190QString IncidenceBase::uid() const 190QString IncidenceBase::uid() const
191{ 191{
192 return mUid; 192 return mUid;
193} 193}
194void IncidenceBase::setLastModifiedSubInvalid() 194void IncidenceBase::setLastModifiedSubInvalid()
195{ 195{
196 196 // virtual method
197} 197}
198void IncidenceBase::setLastModified(const QDateTime &lm) 198void IncidenceBase::setLastModified(const QDateTime &lm)
199{ 199{
200 if ( blockLastModified ) return; 200 if ( blockLastModified ) return;
201 // DON'T! updated() because we call this from 201 // DON'T! updated() because we call this from
202 // Calendar::updateEvent(). 202 // Calendar::updateEvent().
203 mLastModified = getEvenTime(lm); 203 mLastModified = getEvenTime(lm);
204 mLastModifiedKey.sprintf("%04d%02d%02d%02d%02d%02d",
205 mLastModified.date().year(),
206 mLastModified.date().month(),
207 mLastModified.date().day(),
208 mLastModified.time().hour(),
209 mLastModified.time().minute(),
210 mLastModified.time().second() );
204 setLastModifiedSubInvalid(); 211 setLastModifiedSubInvalid();
205 //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); 212 //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1());
206} 213}
214QString IncidenceBase::lastModifiedSortKey() const
215{
216 return mLastModifiedKey;
217}
207 218
208QDateTime IncidenceBase::lastModified() const 219QDateTime IncidenceBase::lastModified() const
209{ 220{
210 return mLastModified; 221 return mLastModified;
211} 222}
212 223
213void IncidenceBase::setOrganizer(const QString &o) 224void IncidenceBase::setOrganizer(const QString &o)
214{ 225{
215 // we don't check for readonly here, because it is 226 // we don't check for readonly here, because it is
216 // possible that by setting the organizer we are changing 227 // possible that by setting the organizer we are changing
217 // the event's readonly status... 228 // the event's readonly status...
218 mOrganizer = o; 229 mOrganizer = o;
219 if (mOrganizer.left(7).upper() == "MAILTO:") 230 if (mOrganizer.left(7).upper() == "MAILTO:")
220 mOrganizer = mOrganizer.remove(0,7); 231 mOrganizer = mOrganizer.remove(0,7);
221 232
222 updated(); 233 updated();
223} 234}
224 235
225QString IncidenceBase::organizer() const 236QString IncidenceBase::organizer() const
226{ 237{
227 return mOrganizer; 238 return mOrganizer;
228} 239}
229 240
230void IncidenceBase::setReadOnly( bool readOnly ) 241void IncidenceBase::setReadOnly( bool readOnly )
231{ 242{
232 mReadOnly = readOnly; 243 mReadOnly = readOnly;
233} 244}
234 245
235void IncidenceBase::setDtStart(const QDateTime &dtStart) 246void IncidenceBase::setDtStart(const QDateTime &dtStart)
236{ 247{
237// if (mReadOnly) return; 248// if (mReadOnly) return;
238 mDtStart = getEvenTime(dtStart); 249 mDtStart = getEvenTime(dtStart);
239 updated(); 250 updated();
240} 251}
241 252
242 253
243QDateTime IncidenceBase::dtStart() const 254QDateTime IncidenceBase::dtStart() const
244{ 255{
245 return mDtStart; 256 return mDtStart;
246} 257}
247 258
248QString IncidenceBase::dtStartTimeStr() const 259QString IncidenceBase::dtStartTimeStr() const
249{ 260{
250 return KGlobal::locale()->formatTime(dtStart().time()); 261 return KGlobal::locale()->formatTime(dtStart().time());
251} 262}
252 263
253QString IncidenceBase::dtStartDateStr(bool shortfmt) const 264QString IncidenceBase::dtStartDateStr(bool shortfmt) const
254{ 265{