author | zecke <zecke> | 2004-02-16 21:32:58 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-02-16 21:32:58 (UTC) |
commit | e228f4aa24ce73a49dde349544e55689cb0eccba (patch) (unidiff) | |
tree | 5b9be29793b2a72f9260cb1325751d31e40c18f0 /core/pim/datebook/datebookday.h | |
parent | 38d601a7d2a975bc0cbcc4cc933844f5572ec4fa (diff) | |
download | opie-e228f4aa24ce73a49dde349544e55689cb0eccba.zip opie-e228f4aa24ce73a49dde349544e55689cb0eccba.tar.gz opie-e228f4aa24ce73a49dde349544e55689cb0eccba.tar.bz2 |
Take care of the lifetime of the EffectiveEvent/Occurence
Make sure not to keep reference on non existing objects
Diffstat (limited to 'core/pim/datebook/datebookday.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebookday.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/pim/datebook/datebookday.h b/core/pim/datebook/datebookday.h index 3898cbc..c8cb26b 100644 --- a/core/pim/datebook/datebookday.h +++ b/core/pim/datebook/datebookday.h | |||
@@ -79,97 +79,97 @@ protected: | |||
79 | virtual void paintFocus( QPainter *p, const QRect &cr ); | 79 | virtual void paintFocus( QPainter *p, const QRect &cr ); |
80 | 80 | ||
81 | virtual void resizeEvent( QResizeEvent *e ); | 81 | virtual void resizeEvent( QResizeEvent *e ); |
82 | void keyPressEvent( QKeyEvent *e ); | 82 | void keyPressEvent( QKeyEvent *e ); |
83 | void contentsMouseReleaseEvent( QMouseEvent *e ); | 83 | void contentsMouseReleaseEvent( QMouseEvent *e ); |
84 | void initHeader(); | 84 | void initHeader(); |
85 | private: | 85 | private: |
86 | bool ampm; | 86 | bool ampm; |
87 | QDate currDate; | 87 | QDate currDate; |
88 | DateBookDayViewQuickLineEdit *quickLineEdit; | 88 | DateBookDayViewQuickLineEdit *quickLineEdit; |
89 | }; | 89 | }; |
90 | 90 | ||
91 | class DateBookDay; | 91 | class DateBookDay; |
92 | class DateBookDayWidget : public QWidget | 92 | class DateBookDayWidget : public QWidget |
93 | { | 93 | { |
94 | Q_OBJECT | 94 | Q_OBJECT |
95 | 95 | ||
96 | public: | 96 | public: |
97 | DateBookDayWidget( const EffectiveEvent &e, DateBookDay *db ); | 97 | DateBookDayWidget( const EffectiveEvent &e, DateBookDay *db ); |
98 | ~DateBookDayWidget(); | 98 | ~DateBookDayWidget(); |
99 | 99 | ||
100 | const QRect &geometry() { return geom; } | 100 | const QRect &geometry() { return geom; } |
101 | void setGeometry( const QRect &r ); | 101 | void setGeometry( const QRect &r ); |
102 | 102 | ||
103 | const EffectiveEvent &event() const { return ev; } | 103 | const EffectiveEvent &event() const { return ev; } |
104 | 104 | ||
105 | signals: | 105 | signals: |
106 | void deleteMe( const Event &e ); | 106 | void deleteMe( const Event &e ); |
107 | void duplicateMe( const Event &e ); | 107 | void duplicateMe( const Event &e ); |
108 | void editMe( const Event &e ); | 108 | void editMe( const Event &e ); |
109 | void beamMe( const Event &e ); | 109 | void beamMe( const Event &e ); |
110 | 110 | ||
111 | protected: | 111 | protected: |
112 | void paintEvent( QPaintEvent *e ); | 112 | void paintEvent( QPaintEvent *e ); |
113 | void mousePressEvent( QMouseEvent *e ); | 113 | void mousePressEvent( QMouseEvent *e ); |
114 | 114 | ||
115 | private: | 115 | private: |
116 | /** | 116 | /** |
117 | * Sets the text for an all day Event | 117 | * Sets the text for an all day Event |
118 | * All day events have no time associated | 118 | * All day events have no time associated |
119 | */ | 119 | */ |
120 | void setAllDayText( QString& text ); | 120 | void setAllDayText( QString& text ); |
121 | 121 | ||
122 | /** | 122 | /** |
123 | * Sets the EventText | 123 | * Sets the EventText |
124 | * it got a start and an end Time | 124 | * it got a start and an end Time |
125 | */ | 125 | */ |
126 | void setEventText( QString& text ); | 126 | void setEventText( QString& text ); |
127 | const EffectiveEvent ev; | 127 | EffectiveEvent ev; |
128 | DateBookDay *dateBook; | 128 | DateBookDay *dateBook; |
129 | QString text; | 129 | QString text; |
130 | QRect geom; | 130 | QRect geom; |
131 | }; | 131 | }; |
132 | 132 | ||
133 | //Marker for current time in the dayview | 133 | //Marker for current time in the dayview |
134 | class DateBookDayTimeMarker : public QWidget | 134 | class DateBookDayTimeMarker : public QWidget |
135 | { | 135 | { |
136 | Q_OBJECT | 136 | Q_OBJECT |
137 | 137 | ||
138 | public: | 138 | public: |
139 | DateBookDayTimeMarker( DateBookDay *db ); | 139 | DateBookDayTimeMarker( DateBookDay *db ); |
140 | ~DateBookDayTimeMarker(); | 140 | ~DateBookDayTimeMarker(); |
141 | 141 | ||
142 | const QRect &geometry() { return geom; } | 142 | const QRect &geometry() { return geom; } |
143 | void setGeometry( const QRect &r ); | 143 | void setGeometry( const QRect &r ); |
144 | void setTime( const QTime &t ); | 144 | void setTime( const QTime &t ); |
145 | 145 | ||
146 | signals: | 146 | signals: |
147 | 147 | ||
148 | protected: | 148 | protected: |
149 | void paintEvent( QPaintEvent *e ); | 149 | void paintEvent( QPaintEvent *e ); |
150 | 150 | ||
151 | private: | 151 | private: |
152 | QRect geom; | 152 | QRect geom; |
153 | QTime time; | 153 | QTime time; |
154 | DateBookDay *dateBook; | 154 | DateBookDay *dateBook; |
155 | }; | 155 | }; |
156 | 156 | ||
157 | //reimplemented the compareItems function so that it sorts DayWidgets by geometry heights | 157 | //reimplemented the compareItems function so that it sorts DayWidgets by geometry heights |
158 | class WidgetListClass : public QList<DateBookDayWidget> | 158 | class WidgetListClass : public QList<DateBookDayWidget> |
159 | { | 159 | { |
160 | private: | 160 | private: |
161 | 161 | ||
162 | int compareItems( QCollection::Item s1, QCollection::Item s2 ) | 162 | int compareItems( QCollection::Item s1, QCollection::Item s2 ) |
163 | { | 163 | { |
164 | //hmm, don't punish me for that ;) | 164 | //hmm, don't punish me for that ;) |
165 | if (reinterpret_cast<DateBookDayWidget*>(s1)->geometry().height() > reinterpret_cast<DateBookDayWidget*>(s2)->geometry().height()) | 165 | if (reinterpret_cast<DateBookDayWidget*>(s1)->geometry().height() > reinterpret_cast<DateBookDayWidget*>(s2)->geometry().height()) |
166 | { | 166 | { |
167 | return -1; | 167 | return -1; |
168 | } else | 168 | } else |
169 | { | 169 | { |
170 | return 1; | 170 | return 1; |
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | 174 | ||
175 | }; | 175 | }; |