summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimevent.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim/core/opimevent.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimevent.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libopie2/opiepim/core/opimevent.cpp b/libopie2/opiepim/core/opimevent.cpp
index 9d46651..8752fce 100644
--- a/libopie2/opiepim/core/opimevent.cpp
+++ b/libopie2/opiepim/core/opimevent.cpp
@@ -12,48 +12,50 @@
._= =} : or (at your option) any later version.
.%`+i> _;_.
.i_,=:_. -<s. This program 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 "opimevent.h"
/* OPIE */
#include <opie2/opimrecurrence.h>
#include <opie2/opimresolver.h>
#include <opie2/opimnotifymanager.h>
+#include <opie2/odebug.h>
+
#include <qpe/categories.h>
#include <qpe/stringutil.h>
/* QT */
namespace Opie
{
int OCalendarHelper::week( const QDate& date )
{
// Calculates the week this date is in within that
// month. Equals the "row" is is in in the month view
int week = 1;
QDate tmp( date.year(), date.month(), 1 );
if ( date.dayOfWeek() < tmp.dayOfWeek() )
++week;
week += ( date.day() - 1 ) / 7;
return week;
}
int OCalendarHelper::ocurrence( const QDate& date )
@@ -620,52 +622,52 @@ void OPimEvent::fromMap( const QMap<int, QString>& map )
if ( map[ OPimEvent::FType ] == "AllDay" )
setAllDay( true );
else
setAllDay( false );
if ( !map[ OPimEvent::FTimeZone ].isEmpty() && ( map[ OPimEvent::FTimeZone ] != "None" ) )
{
setTimeZone( map[ OPimEvent::FTimeZone ] );
}
time_t start = ( time_t ) map[ OPimEvent::FStart ].toLong();
time_t end = ( time_t ) map[ OPimEvent::FEnd ].toLong();
/* AllDay is always in UTC */
if ( isAllDay() )
{
OPimTimeZone utc = OPimTimeZone::utc();
setStartDateTime( utc.fromUTCDateTime( start ) );
setEndDateTime ( utc.fromUTCDateTime( end ) );
setTimeZone( "UTC" ); // make sure it is really utc
}
else
{
/* to current date time */
- // qWarning(" Start is %d", start );
+ // owarn << " Start is " << start << "" << oendl;
OPimTimeZone zone( timeZone().isEmpty() ? OPimTimeZone::current() : timeZone() );
QDateTime date = zone.toDateTime( start );
- qWarning( " Start is %s", date.toString().latin1() );
+ owarn << " Start is " << date.toString() << "" << oendl;
setStartDateTime( zone.toDateTime( date, OPimTimeZone::current() ) );
date = zone.toDateTime( end );
setEndDateTime ( zone.toDateTime( date, OPimTimeZone::current() ) );
}
int alarmTime = -1;
if ( !map[ OPimEvent::FAlarm ].isEmpty() )
alarmTime = map[ OPimEvent::FAlarm ].toInt();
int sound = ( ( map[ OPimEvent::FSound ] == "loud" ) ? OPimAlarm::Loud : OPimAlarm::Silent );
if ( ( alarmTime != -1 ) )
{
QDateTime dt = startDateTime().addSecs( -1 * alarmTime * 60 );
OPimAlarm al( sound , dt );
notifiers().add( al );
}
if ( !map[ OPimEvent::FNote ].isEmpty() )
setNote( map[ OPimEvent::FNote ] );
if ( !map[ OPimEvent::FRecParent ].isEmpty() )
setParent( map[ OPimEvent::FRecParent ].toInt() );