[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/ktimetracker
From:       Thorsten Staerk <dev () staerk ! de>
Date:       2009-12-27 18:54:12
Message-ID: 1261940052.703950.17450.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1066694 by tstaerk:

We now use rawEvents().

 M  +0 -6      taskview.cpp  
 M  +0 -69     timetrackerstorage.cpp  
 M  +0 -3      timetrackerstorage.h  


--- trunk/KDE/kdepim/ktimetracker/taskview.cpp #1066693:1066694
@@ -1041,12 +1041,6 @@
     emit tasksChanged( d->mActiveTasks );
 }
 
-QList<HistoryEvent> TaskView::getHistory(const QDate& from,
-    const QDate& to) const
-{
-    return d->mStorage->getHistory(from, to);
-}
-
 void TaskView::markTaskAsIncomplete()
 {
     setPerCentComplete(50); // if it has been reopened, assume half-done
--- trunk/KDE/kdepim/ktimetracker/timetrackerstorage.cpp #1066693:1066694
@@ -1011,75 +1011,6 @@
     _todoUid = todoUid;
 }
 
-
-QList<HistoryEvent> timetrackerstorage::getHistory(const QDate& from,
-    const QDate& to)
-{
-    kDebug(5970) << "Entering function";
-    QList<HistoryEvent> retval;
-    QStringList processed;
-    KCal::Event::List events;
-    KCal::Event::List::iterator event;
-    QString duration;
-
-    for( QDate date = from; date <= to; date = date.addDays( 1 ) )
-    {
-        events = d->mCalendar->rawEventsForDate( date, KSystemTimeZones::local() );
-        for (event = events.begin(); event != events.end(); ++event)
-        {
-
-            // KArm events have the custom property X-KDE-Karm-duration
-            if (! processed.contains( (*event)->uid()))
-            {
-                // If an event spans multiple days, CalendarLocal::rawEventsForDate
-                // will return the same event on both days.  To avoid double-counting
-                // such events, we (arbitrarily) attribute the hours from both days on
-                // the first day.  This mis-reports the actual time spent, but it is
-                // an easy fix for a (hopefully) rare situation.
-                processed.append( (*event)->uid());
-
-                // ktimetracker was name karm till KDE 3 incl.
-                // if a KDE-karm-duRation exists and no KDE-ktimetracker-Duration, change this
-                if (
-                    (*event)->customProperty( KGlobal::mainComponent().componentName().toUtf8(),
-                    QByteArray( "duration" )) == QString::null && (*event)->customProperty( "karm",
-                    QByteArray( "duration" )) != QString::null )
-
-                (*event)->setCustomProperty(
-                    KGlobal::mainComponent().componentName().toUtf8(),
-                    QByteArray( "duration" ), (*event)->customProperty( "karm",
-                    QByteArray( "duration" )));
-
-                duration = (*event)->customProperty(KGlobal::mainComponent().componentName().toUtf8(),
-                    QByteArray("duration"));
-                if ( ! duration.isNull() )
-                {
-                    if ( (*event)->relatedTo()
-                        &&  ! (*event)->relatedTo()->uid().isEmpty() )
-                    {
-                        retval.append(HistoryEvent(
-                            (*event)->uid(),
-                            (*event)->summary(),
-                            duration.toLong(),
-                            (*event)->dtStart(),
-                            (*event)->dtEnd(),
-                            (*event)->relatedTo()->uid()
-                            ));
-                    }
-                    else
-                    // Something is screwy with the ics file, as this KArm history event
-                    // does not have a todo related to it. Could have been deleted
-                    // manually?  We'll continue with report on with report ...
-                        kDebug(5970) <<"timetrackerstorage::getHistory():"
-                            << "The event" << (*event)->uid()
-                            << "is not related to a todo.  Dropped.";
-                }
-            }
-        }
-    }
-    return retval;
-}
-
 bool timetrackerstorage::remoteResource( const QString& file ) const
 {
     kDebug(5970) << "Entering function";
--- trunk/KDE/kdepim/ktimetracker/timetrackerstorage.h #1066693:1066694
@@ -312,9 +312,6 @@
     /** Return a list of all task names */
     QStringList taskNames() const;
 
-    /** Return a list of start/stop events for the given date range. */
-    QList<HistoryEvent> getHistory(const QDate& from, const QDate& to);
-
   private:
     //@cond PRIVATE
     class Private;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic