summaryrefslogtreecommitdiffabout
path: root/libkcal/calendar.cpp
authorzautrix <zautrix>2004-08-10 19:41:31 (UTC)
committer zautrix <zautrix>2004-08-10 19:41:31 (UTC)
commit2f1b58e344b882578977dd3786f7a94495096d22 (patch) (side-by-side diff)
tree6658bef546b6feac1688aa465ca94344e15704d7 /libkcal/calendar.cpp
parent467e50111dfd6d66aca205501b6bf369b7f0a166 (diff)
downloadkdepimpi-2f1b58e344b882578977dd3786f7a94495096d22.zip
kdepimpi-2f1b58e344b882578977dd3786f7a94495096d22.tar.gz
kdepimpi-2f1b58e344b882578977dd3786f7a94495096d22.tar.bz2
More syncing stuff
Diffstat (limited to 'libkcal/calendar.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/calendar.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp
index 32aac7a..a3977d7 100644
--- a/libkcal/calendar.cpp
+++ b/libkcal/calendar.cpp
@@ -9,48 +9,49 @@
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <stdlib.h>
#include <time.h>
#include <kdebug.h>
#include <kglobal.h>
#include <klocale.h>
#include "exceptions.h"
#include "calfilter.h"
#include "calendar.h"
+#include "syncdefines.h"
using namespace KCal;
Calendar::Calendar()
{
init();
setTimeZoneId( i18n (" 00:00 Europe/London(UTC)") );
}
Calendar::Calendar( const QString &timeZoneId )
{
init();
setTimeZoneId(timeZoneId);
}
void Calendar::init()
{
mObserver = 0;
mNewObserver = false;
mModified = false;
@@ -226,49 +227,63 @@ void Calendar::setFilter(CalFilter *filter)
}
CalFilter *Calendar::filter()
{
return mFilter;
}
QPtrList<Incidence> Calendar::incidences()
{
QPtrList<Incidence> incidences;
Incidence *i;
QPtrList<Event> e = events();
for( i = e.first(); i; i = e.next() ) incidences.append( i );
QPtrList<Todo> t = todos();
for( i = t.first(); i; i = t.next() ) incidences.append( i );
QPtrList<Journal> j = journals();
for( i = j.first(); i; i = j.next() ) incidences.append( i );
return incidences;
}
+void Calendar::resetTempSyncStat()
+{
+ QPtrList<Incidence> incidences;
+
+ Incidence *i;
+
+ QPtrList<Event> e = rawEvents();
+ for( i = e.first(); i; i = e.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
+
+ QPtrList<Todo> t = rawTodos();
+ for( i = t.first(); i; i = t.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
+ QPtrList<Journal> j = journals();
+ for( i = j.first(); i; i = j.next() ) i->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
+}
QPtrList<Incidence> Calendar::rawIncidences()
{
QPtrList<Incidence> incidences;
Incidence *i;
QPtrList<Event> e = rawEvents();
for( i = e.first(); i; i = e.next() ) incidences.append( i );
QPtrList<Todo> t = rawTodos();
for( i = t.first(); i; i = t.next() ) incidences.append( i );
QPtrList<Journal> j = journals();
for( i = j.first(); i; i = j.next() ) incidences.append( i );
return incidences;
}
QPtrList<Event> Calendar::events( const QDate &date, bool sorted )
{
QPtrList<Event> el = rawEventsForDate(date,sorted);
mFilter->apply(&el);
return el;
}