author | alwin <alwin> | 2004-02-20 02:06:52 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-02-20 02:06:52 (UTC) |
commit | 55f4d502486e01927356908223622e435c975f7e (patch) (unidiff) | |
tree | 824b5c1e8992564677c4f39473bc108a32a2cf2a /libopie2/opiepim/core/orecur.cpp | |
parent | 060b4fc7a3fd5c1b5f745167fe084f7486719b7e (diff) | |
download | opie-55f4d502486e01927356908223622e435c975f7e.zip opie-55f4d502486e01927356908223622e435c975f7e.tar.gz opie-55f4d502486e01927356908223622e435c975f7e.tar.bz2 |
moved the opie pim stuff to libopie2 - pim. Tried to resort them, may be someone should take a look for a better file order. but now all applications can start using libopiepim2 instead of libopie1-pim-stuff.
Diffstat (limited to 'libopie2/opiepim/core/orecur.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/orecur.cpp | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/libopie2/opiepim/core/orecur.cpp b/libopie2/opiepim/core/orecur.cpp index f46f22e..033f264 100644 --- a/libopie2/opiepim/core/orecur.cpp +++ b/libopie2/opiepim/core/orecur.cpp | |||
@@ -1,33 +1,63 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | Copyright (C) The Main Author <main-author@whereever.org> | ||
4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | ||
5 | .=l. | ||
6 | .>+-= | ||
7 | _;:, .> :=|. This program is free software; you can | ||
8 | .> <`_, > . <= redistribute it and/or modify it under | ||
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
10 | .="- .-=="i, .._ License as published by the Free Software | ||
11 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
12 | ._= =} : or (at your option) any later version. | ||
13 | .%`+i> _;_. | ||
14 | .i_,=:_. -<s. This program is distributed in the hope that | ||
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
16 | : .. .:, . . . without even the implied warranty of | ||
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
19 | ..}^=.= = ; Library General Public License for more | ||
20 | ++= -. .` .: details. | ||
21 | : = ...= . :.=- | ||
22 | -. .:....=;==+<; You should have received a copy of the GNU | ||
23 | -_. . . )=. = Library General Public License along with | ||
24 | -- :-=` this library; see the file COPYING.LIB. | ||
25 | If not, write to the Free Software Foundation, | ||
26 | Inc., 59 Temple Place - Suite 330, | ||
27 | Boston, MA 02111-1307, USA. | ||
28 | */ | ||
29 | |||
1 | #include <time.h> | 30 | #include <time.h> |
2 | 31 | ||
3 | #include <qshared.h> | 32 | #include <qshared.h> |
4 | 33 | ||
5 | #include <qtopia/timeconversion.h> | 34 | #include <qtopia/timeconversion.h> |
6 | 35 | ||
7 | #include "otimezone.h" | 36 | #include <opie2/otimezone.h> |
8 | #include "orecur.h" | 37 | #include <opie2/orecur.h> |
9 | 38 | ||
39 | namespace Opie { | ||
10 | struct ORecur::Data : public QShared { | 40 | struct ORecur::Data : public QShared { |
11 | Data() : QShared() { | 41 | Data() : QShared() { |
12 | type = ORecur::NoRepeat; | 42 | type = ORecur::NoRepeat; |
13 | freq = -1; | 43 | freq = -1; |
14 | days = 0; | 44 | days = 0; |
15 | pos = 0; | 45 | pos = 0; |
16 | create = QDateTime::currentDateTime(); | 46 | create = QDateTime::currentDateTime(); |
17 | hasEnd = FALSE; | 47 | hasEnd = FALSE; |
18 | end = QDate::currentDate(); | 48 | end = QDate::currentDate(); |
19 | } | 49 | } |
20 | char days; // Q_UINT8 for 8 seven days;) | 50 | char days; // Q_UINT8 for 8 seven days;) |
21 | ORecur::RepeatType type; | 51 | ORecur::RepeatType type; |
22 | int freq; | 52 | int freq; |
23 | int pos; | 53 | int pos; |
24 | bool hasEnd : 1; | 54 | bool hasEnd : 1; |
25 | QDate end; | 55 | QDate end; |
26 | QDateTime create; | 56 | QDateTime create; |
27 | int rep; | 57 | int rep; |
28 | QString app; | 58 | QString app; |
29 | ExceptionList list; | 59 | ExceptionList list; |
30 | QDate start; | 60 | QDate start; |
31 | }; | 61 | }; |
32 | 62 | ||
33 | 63 | ||
@@ -570,24 +600,26 @@ void ORecur::fromMap( const QMap<int, QString>& map ) | |||
570 | QMap<QString, RepeatType> repTypeMap = rTypeValueConvertMap(); | 600 | QMap<QString, RepeatType> repTypeMap = rTypeValueConvertMap(); |
571 | 601 | ||
572 | data -> type = repTypeMap[ map [ORecur::RType] ]; | 602 | data -> type = repTypeMap[ map [ORecur::RType] ]; |
573 | data -> days = (char) map[ ORecur::RWeekdays ].toInt(); | 603 | data -> days = (char) map[ ORecur::RWeekdays ].toInt(); |
574 | data -> pos = map[ ORecur::RPosition ].toInt(); | 604 | data -> pos = map[ ORecur::RPosition ].toInt(); |
575 | data -> freq = map[ ORecur::RFreq ].toInt(); | 605 | data -> freq = map[ ORecur::RFreq ].toInt(); |
576 | data -> hasEnd= map[ ORecur::RHasEndDate ].toInt() ? true : false; | 606 | data -> hasEnd= map[ ORecur::RHasEndDate ].toInt() ? true : false; |
577 | OTimeZone utc = OTimeZone::utc(); | 607 | OTimeZone utc = OTimeZone::utc(); |
578 | if ( data -> hasEnd ){ | 608 | if ( data -> hasEnd ){ |
579 | data -> end = utc.fromUTCDateTime( (time_t) map[ ORecur::EndDate ].toLong() ).date(); | 609 | data -> end = utc.fromUTCDateTime( (time_t) map[ ORecur::EndDate ].toLong() ).date(); |
580 | } | 610 | } |
581 | data -> create = utc.fromUTCDateTime( (time_t) map[ ORecur::Created ].toLong() ).date(); | 611 | data -> create = utc.fromUTCDateTime( (time_t) map[ ORecur::Created ].toLong() ).date(); |
582 | 612 | ||
583 | #if 0 | 613 | #if 0 |
584 | // FIXME: Exceptions currently not supported... | 614 | // FIXME: Exceptions currently not supported... |
585 | // Convert the list of exceptions from QString into ExceptionList | 615 | // Convert the list of exceptions from QString into ExceptionList |
586 | data -> list.clear(); | 616 | data -> list.clear(); |
587 | QString exceptStr = map[ ORecur::Exceptions ]; | 617 | QString exceptStr = map[ ORecur::Exceptions ]; |
588 | QStringList exceptList = QStringList::split( " ", exceptStr ); | 618 | QStringList exceptList = QStringList::split( " ", exceptStr ); |
589 | ... | 619 | ... |
590 | #endif | 620 | #endif |
591 | 621 | ||
592 | 622 | ||
593 | } | 623 | } |
624 | |||
625 | } \ No newline at end of file | ||