Diffstat (limited to 'core/pim/todo/taskeditoralarms.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/taskeditoralarms.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/core/pim/todo/taskeditoralarms.cpp b/core/pim/todo/taskeditoralarms.cpp index bcc40fe..930c94e 100644 --- a/core/pim/todo/taskeditoralarms.cpp +++ b/core/pim/todo/taskeditoralarms.cpp | |||
@@ -19,27 +19,26 @@ | |||
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = General Public License along with | 21 | -_. . . )=. = General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "taskeditoralarms.h" | 29 | #include "taskeditoralarms.h" |
30 | 30 | ||
31 | #include <opie/otodo.h> | 31 | #include <opie2/opimnotifymanager.h> |
32 | #include <opie/opimnotifymanager.h> | 32 | #include <opie2/otimepicker.h> |
33 | #include <opie/otimepicker.h> | ||
34 | 33 | ||
35 | #include <qpe/datebookmonth.h> | 34 | #include <qpe/datebookmonth.h> |
36 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
37 | 36 | ||
38 | #include <qlistview.h> | 37 | #include <qlistview.h> |
39 | #include <qlayout.h> | 38 | #include <qlayout.h> |
40 | 39 | ||
41 | 40 | ||
42 | class AlarmItem : public QListViewItem { | 41 | class AlarmItem : public QListViewItem { |
43 | public: | 42 | public: |
44 | AlarmItem( QListView*, const OPimAlarm& ); | 43 | AlarmItem( QListView*, const OPimAlarm& ); |
45 | ~AlarmItem(); | 44 | ~AlarmItem(); |
@@ -113,39 +112,39 @@ void TaskEditorAlarms::slotNew(){ | |||
113 | void TaskEditorAlarms::slotEdit(){ | 112 | void TaskEditorAlarms::slotEdit(){ |
114 | } | 113 | } |
115 | 114 | ||
116 | void TaskEditorAlarms::slotDelete(){ | 115 | void TaskEditorAlarms::slotDelete(){ |
117 | QListViewItem* item = lstAlarms->currentItem(); | 116 | QListViewItem* item = lstAlarms->currentItem(); |
118 | if (!item) return; | 117 | if (!item) return; |
119 | 118 | ||
120 | lstAlarms->takeItem( item ); delete item; | 119 | lstAlarms->takeItem( item ); delete item; |
121 | 120 | ||
122 | 121 | ||
123 | } | 122 | } |
124 | 123 | ||
125 | void TaskEditorAlarms::load( const OTodo& todo) { | 124 | void TaskEditorAlarms::load( const OPimTodo& todo) { |
126 | lstAlarms->clear(); | 125 | lstAlarms->clear(); |
127 | if (!todo.hasNotifiers() ) return; | 126 | if (!todo.hasNotifiers() ) return; |
128 | 127 | ||
129 | OPimNotifyManager::Alarms als = todo.notifiers().alarms(); | 128 | OPimNotifyManager::Alarms als = todo.notifiers().alarms(); |
130 | 129 | ||
131 | if (als.isEmpty() ) return; | 130 | if (als.isEmpty() ) return; |
132 | 131 | ||
133 | OPimNotifyManager::Alarms::Iterator it = als.begin(); | 132 | OPimNotifyManager::Alarms::Iterator it = als.begin(); |
134 | for ( ; it != als.end(); ++it ) | 133 | for ( ; it != als.end(); ++it ) |
135 | (void)new AlarmItem( lstAlarms, (*it) ); | 134 | (void)new AlarmItem( lstAlarms, (*it) ); |
136 | 135 | ||
137 | 136 | ||
138 | } | 137 | } |
139 | void TaskEditorAlarms::save( OTodo& todo ) { | 138 | void TaskEditorAlarms::save( OPimTodo& todo ) { |
140 | if (lstAlarms->childCount() <= 0 ) return; | 139 | if (lstAlarms->childCount() <= 0 ) return; |
141 | 140 | ||
142 | OPimNotifyManager::Alarms alarms; | 141 | OPimNotifyManager::Alarms alarms; |
143 | 142 | ||
144 | for ( QListViewItem* item = lstAlarms->firstChild(); item; item = item->nextSibling() ) { | 143 | for ( QListViewItem* item = lstAlarms->firstChild(); item; item = item->nextSibling() ) { |
145 | AlarmItem *alItem = static_cast<AlarmItem*>(item); | 144 | AlarmItem *alItem = static_cast<AlarmItem*>(item); |
146 | alarms.append( alItem->alarm() ); | 145 | alarms.append( alItem->alarm() ); |
147 | } | 146 | } |
148 | 147 | ||
149 | OPimNotifyManager& manager = todo.notifiers(); | 148 | OPimNotifyManager& manager = todo.notifiers(); |
150 | manager.setAlarms( alarms ); | 149 | manager.setAlarms( alarms ); |
151 | } | 150 | } |