summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimnotifymanager.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/opimnotifymanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimnotifymanager.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libopie2/opiepim/core/opimnotifymanager.cpp b/libopie2/opiepim/core/opimnotifymanager.cpp
index 573340a..0f863aa 100644
--- a/libopie2/opiepim/core/opimnotifymanager.cpp
+++ b/libopie2/opiepim/core/opimnotifymanager.cpp
@@ -22,24 +22,25 @@
22 -. .:....=;==+<; You should have received a copy of the GNU 22 -. .:....=;==+<; You should have received a copy of the GNU
23 -_. . . )=. = Library General Public License along with 23 -_. . . )=. = Library General Public License along with
24 -- :-=` this library; see the file COPYING.LIB. 24 -- :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
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 "opimnotifymanager.h" 30#include "opimnotifymanager.h"
31 31
32/* OPIE */ 32/* OPIE */
33#include <opie2/opimdateconversion.h> 33#include <opie2/opimdateconversion.h>
34#include <opie2/odebug.h>
34 35
35/* QT */ 36/* QT */
36#include <qstringlist.h> 37#include <qstringlist.h>
37 38
38namespace Opie 39namespace Opie
39{ 40{
40 41
41OPimNotifyManager::OPimNotifyManager( const Reminders& rem, const Alarms& al ) 42OPimNotifyManager::OPimNotifyManager( const Reminders& rem, const Alarms& al )
42 : m_rem( rem ), m_al( al ) 43 : m_rem( rem ), m_al( al )
43{} 44{}
44 45
45 46
@@ -154,25 +155,25 @@ void OPimNotifyManager::registerNotify( const OPimNotify& )
154/** 155/**
155 * same as above... 156 * same as above...
156 * Also implement Url model 157 * Also implement Url model
157 * have a MainWindow.... 158 * have a MainWindow....
158 */ 159 */
159void OPimNotifyManager::deregister( const OPimNotify& ) 160void OPimNotifyManager::deregister( const OPimNotify& )
160{ 161{
161} 162}
162 163
163 164
164bool OPimNotifyManager::isEmpty() const 165bool OPimNotifyManager::isEmpty() const
165{ 166{
166 qWarning( "is Empty called on OPimNotifyManager %d %d", m_rem.count(), m_al.count() ); 167 owarn << "is Empty called on OPimNotifyManager " << m_rem.count() << " " << m_al.count() << "" << oendl;
167 if ( m_rem.isEmpty() && m_al.isEmpty() ) return true; 168 if ( m_rem.isEmpty() && m_al.isEmpty() ) return true;
168 else return false; 169 else return false;
169} 170}
170 171
171 172
172// Taken from otodoaccessxml.. code duplication bad. any alternative? 173// Taken from otodoaccessxml.. code duplication bad. any alternative?
173QString OPimNotifyManager::alarmsToString() const 174QString OPimNotifyManager::alarmsToString() const
174{ 175{
175 QString str; 176 QString str;
176 177
177 OPimNotifyManager::Alarms alarms = m_al; 178 OPimNotifyManager::Alarms alarms = m_al;
178 if ( !alarms.isEmpty() ) 179 if ( !alarms.isEmpty() )
@@ -182,25 +183,25 @@ QString OPimNotifyManager::alarmsToString() const
182 for ( ; it != alarms.end(); ++it ) 183 for ( ; it != alarms.end(); ++it )
183 { 184 {
184 /* only if time is valid */ 185 /* only if time is valid */
185 if ( ( *it ).dateTime().isValid() ) 186 if ( ( *it ).dateTime().isValid() )
186 { 187 {
187 als << OPimDateConversion::dateTimeToString( ( *it ).dateTime() ) 188 als << OPimDateConversion::dateTimeToString( ( *it ).dateTime() )
188 + ":" + QString::number( ( *it ).duration() ) 189 + ":" + QString::number( ( *it ).duration() )
189 + ":" + QString::number( ( *it ).sound() ) 190 + ":" + QString::number( ( *it ).sound() )
190 + ":"; 191 + ":";
191 } 192 }
192 } 193 }
193 // now write the list 194 // now write the list
194 qWarning( "als: %s", als.join( "____________" ).latin1() ); 195 owarn << "als: " << als.join( "____________" ) << "" << oendl;
195 str = als.join( ";" ); 196 str = als.join( ";" );
196 } 197 }
197 198
198 return str; 199 return str;
199} 200}
200 201
201 202
202QString OPimNotifyManager::remindersToString() const 203QString OPimNotifyManager::remindersToString() const
203{ 204{
204 QString str; 205 QString str;
205 206
206 OPimNotifyManager::Reminders reminders = m_rem; 207 OPimNotifyManager::Reminders reminders = m_rem;
@@ -216,25 +217,25 @@ QString OPimNotifyManager::remindersToString() const
216 } 217 }
217 218
218 return str; 219 return str;
219} 220}
220 221
221 222
222void OPimNotifyManager::alarmsFromString( const QString& str ) 223void OPimNotifyManager::alarmsFromString( const QString& str )
223{ 224{
224 QStringList als = QStringList::split( ";", str ); 225 QStringList als = QStringList::split( ";", str );
225 for ( QStringList::Iterator it = als.begin(); it != als.end(); ++it ) 226 for ( QStringList::Iterator it = als.begin(); it != als.end(); ++it )
226 { 227 {
227 QStringList alarm = QStringList::split( ":", ( *it ), TRUE ); // allow empty 228 QStringList alarm = QStringList::split( ":", ( *it ), TRUE ); // allow empty
228 qWarning( "alarm: %s", alarm.join( "___" ).latin1() ); 229 owarn << "alarm: " << alarm.join( "___" ) << "" << oendl;
229 qWarning( "alarm[0]: %s %s", alarm[ 0 ].latin1(), 230 qWarning( "alarm[0]: %s %s", alarm[ 0 ].latin1(),
230 OPimDateConversion::dateTimeFromString( alarm[ 0 ] ).toString().latin1() ); 231 OPimDateConversion::dateTimeFromString( alarm[ 0 ] ).toString().latin1() );
231 OPimAlarm al( alarm[ 2 ].toInt(), OPimDateConversion::dateTimeFromString( alarm[ 0 ] ), 232 OPimAlarm al( alarm[ 2 ].toInt(), OPimDateConversion::dateTimeFromString( alarm[ 0 ] ),
232 alarm[ 1 ].toInt() ); 233 alarm[ 1 ].toInt() );
233 add( al ); 234 add( al );
234 } 235 }
235} 236}
236 237
237 238
238void OPimNotifyManager::remindersFromString( const QString& str ) 239void OPimNotifyManager::remindersFromString( const QString& str )
239{ 240{
240 241