author | eilers <eilers> | 2004-05-04 18:48:35 (UTC) |
---|---|---|
committer | eilers <eilers> | 2004-05-04 18:48:35 (UTC) |
commit | 04a7f91591987c01d312fbcaf6554ec6d728554d (patch) (unidiff) | |
tree | 98e10bb02d2e6c663f9c632f5e67783085683954 | |
parent | aa7023b05a3355f5c3d81d6efcccd8c4e7f4348c (diff) | |
download | opie-04a7f91591987c01d312fbcaf6554ec6d728554d.zip opie-04a7f91591987c01d312fbcaf6554ec6d728554d.tar.gz opie-04a7f91591987c01d312fbcaf6554ec6d728554d.tar.bz2 |
This is the reason, why I sometimes hate C++ ..
Fixed crash in find of OPimDateBookBackend_SQL
-rw-r--r-- | libopie2/opiepim/core/opimrecurrence.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiepim/core/opimrecurrence.cpp b/libopie2/opiepim/core/opimrecurrence.cpp index 98bd647..4b1d886 100644 --- a/libopie2/opiepim/core/opimrecurrence.cpp +++ b/libopie2/opiepim/core/opimrecurrence.cpp | |||
@@ -26,97 +26,97 @@ | |||
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "opimrecurrence.h" | 30 | #include "opimrecurrence.h" |
31 | 31 | ||
32 | /* OPIE */ | 32 | /* OPIE */ |
33 | #include <opie2/opimtimezone.h> | 33 | #include <opie2/opimtimezone.h> |
34 | #include <qpe/timeconversion.h> | 34 | #include <qpe/timeconversion.h> |
35 | 35 | ||
36 | /* QT */ | 36 | /* QT */ |
37 | #include <qshared.h> | 37 | #include <qshared.h> |
38 | 38 | ||
39 | /* STD */ | 39 | /* STD */ |
40 | #include <time.h> | 40 | #include <time.h> |
41 | 41 | ||
42 | namespace Opie { | 42 | namespace Opie { |
43 | 43 | ||
44 | struct OPimRecurrence::Data : public QShared { | 44 | struct OPimRecurrence::Data : public QShared { |
45 | Data() : QShared() { | 45 | Data() : QShared() { |
46 | type = OPimRecurrence::NoRepeat; | 46 | type = OPimRecurrence::NoRepeat; |
47 | freq = -1; | 47 | freq = -1; |
48 | days = 0; | 48 | days = 0; |
49 | pos = 0; | 49 | pos = 0; |
50 | create = QDateTime::currentDateTime(); | 50 | create = QDateTime::currentDateTime(); |
51 | hasEnd = FALSE; | 51 | hasEnd = FALSE; |
52 | end = QDate::currentDate(); | 52 | end = QDate::currentDate(); |
53 | } | 53 | } |
54 | char days; // Q_UINT8 for 8 seven days;) | 54 | char days; // Q_UINT8 for 8 seven days;) |
55 | OPimRecurrence::RepeatType type; | 55 | OPimRecurrence::RepeatType type; |
56 | int freq; | 56 | int freq; |
57 | int pos; | 57 | int pos; |
58 | bool hasEnd : 1; | 58 | bool hasEnd : 1; |
59 | QDate end; | 59 | QDate end; |
60 | QDateTime create; | 60 | QDateTime create; |
61 | int rep; | 61 | int rep; |
62 | QString app; | 62 | QString app; |
63 | ExceptionList list; | 63 | ExceptionList list; |
64 | QDate start; | 64 | QDate start; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | 67 | ||
68 | OPimRecurrence::OPimRecurrence() { | 68 | OPimRecurrence::OPimRecurrence() { |
69 | data = new Data; | 69 | data = new Data; |
70 | } | 70 | } |
71 | 71 | ||
72 | OPimRecurrence::OPimRecurrence( const QMap<int, QString>& map ) | 72 | OPimRecurrence::OPimRecurrence( const QMap<int, QString>& map ) |
73 | { | 73 | { |
74 | OPimRecurrence(); | 74 | data = new Data; |
75 | fromMap( map ); | 75 | fromMap( map ); |
76 | } | 76 | } |
77 | 77 | ||
78 | 78 | ||
79 | OPimRecurrence::OPimRecurrence( const OPimRecurrence& rec) | 79 | OPimRecurrence::OPimRecurrence( const OPimRecurrence& rec) |
80 | : data( rec.data ) | 80 | : data( rec.data ) |
81 | { | 81 | { |
82 | data->ref(); | 82 | data->ref(); |
83 | } | 83 | } |
84 | 84 | ||
85 | 85 | ||
86 | OPimRecurrence::~OPimRecurrence() { | 86 | OPimRecurrence::~OPimRecurrence() { |
87 | if ( data->deref() ) { | 87 | if ( data->deref() ) { |
88 | delete data; | 88 | delete data; |
89 | data = 0l; | 89 | data = 0l; |
90 | } | 90 | } |
91 | } | 91 | } |
92 | 92 | ||
93 | 93 | ||
94 | void OPimRecurrence::deref() { | 94 | void OPimRecurrence::deref() { |
95 | if ( data->deref() ) { | 95 | if ( data->deref() ) { |
96 | delete data; | 96 | delete data; |
97 | data = 0l; | 97 | data = 0l; |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | 101 | ||
102 | bool OPimRecurrence::operator==( const OPimRecurrence& )const { | 102 | bool OPimRecurrence::operator==( const OPimRecurrence& )const { |
103 | return false; | 103 | return false; |
104 | } | 104 | } |
105 | 105 | ||
106 | 106 | ||
107 | OPimRecurrence &OPimRecurrence::operator=( const OPimRecurrence& re) { | 107 | OPimRecurrence &OPimRecurrence::operator=( const OPimRecurrence& re) { |
108 | if ( *this == re ) return *this; | 108 | if ( *this == re ) return *this; |
109 | 109 | ||
110 | re.data->ref(); | 110 | re.data->ref(); |
111 | deref(); | 111 | deref(); |
112 | data = re.data; | 112 | data = re.data; |
113 | 113 | ||
114 | return *this; | 114 | return *this; |
115 | } | 115 | } |
116 | 116 | ||
117 | 117 | ||
118 | bool OPimRecurrence::doesRecur()const { | 118 | bool OPimRecurrence::doesRecur()const { |
119 | return !( type() == NoRepeat ); | 119 | return !( type() == NoRepeat ); |
120 | } | 120 | } |
121 | 121 | ||
122 | 122 | ||